Commit graph

2530 commits

Author SHA1 Message Date
Bruno Windels 498c00fe3c no need for try catch here as we already catch in getKeys 2021-09-22 10:38:29 +02:00
Bruno Windels ac5a4c2bc6 pass log item everywhere to tryInsert 2021-09-22 10:33:40 +02:00
Bruno Windels b58e10521f don't log tryInsert failures anymore as everything is logged in Store 2021-09-22 10:23:28 +02:00
Bruno Windels 1963635dd7 also log index keys for a value when write fails in Store 2021-09-22 10:22:52 +02:00
Bruno Windels a19d93dbef don't swallow anything that isn't a request error 2021-09-22 09:36:26 +02:00
Bruno Windels 704d7b32da add tests 2021-09-21 21:04:29 +02:00
Bruno Windels 6cded5319a change timelineEventStore.insert to tryInsert 2021-09-21 21:04:10 +02:00
Bruno Windels 12add19c31 add Store.tryAdd, which prevent abort on ConstraintError 2021-09-21 21:03:29 +02:00
Bruno Windels 0d486a14f6 add the logger property to the null logger as well, forgot this before 2021-09-21 21:01:35 +02:00
Danila Fedorin 92dcc6c980 Remove duplicated lines 2021-09-21 09:39:09 -07:00
Bruno Windels b8548afb71 export temporary vm typ def 2021-09-21 10:41:01 +02:00
Bruno Windels 07c6bf7055
Merge pull request #503 from vector-im/bwindels/fix-reactions-vm-null
use mapped value rather than reading parent vm again
2021-09-21 10:09:05 +02:00
Bruno Windels a020febf8d use mapped value rather than reading parent vm again 2021-09-21 10:02:17 +02:00
Danila Fedorin a3a743881d Make test adjustments requested in PR. 2021-09-20 19:37:39 -07:00
Danila Fedorin 50c8b995c3 Undo GapWriter algorithm changes 2021-09-20 18:41:01 -07:00
Danila Fedorin 9f6c48cf0c Merge branch 'master' into DanilaFe/backfill-changes 2021-09-17 15:19:16 -07:00
Danila Fedorin 6d84cc0a81 Fix util import 2021-09-17 14:51:20 -07:00
Danila Fedorin 820b048272 Finish up the more difficult tests 2021-09-17 10:57:51 -07:00
Bruno Windels 53a0d29244 example how to get more context for the failure of a write operation 2021-09-17 18:25:28 +02:00
Bruno Windels f5467a653c fix stores returning the delete promise which isn't returned anymore
I checked these aren't awaited in any js file
2021-09-17 18:24:24 +02:00
Bruno Windels ad45016b87 process write errors on complete or abort in transaction 2021-09-17 18:23:31 +02:00
Bruno Windels 533b0f40d3 pass write errors in a store to the transaction 2021-09-17 18:21:48 +02:00
Bruno Windels aeedb948cc pass logger to Storage and make it available in Transaction 2021-09-17 18:19:26 +02:00
Danila Fedorin 82c35355b6 Start translating GapWriter tests to using MockTimeline 2021-09-16 23:54:13 -07:00
Danila Fedorin 7d27b46873 Make the response of TimelineMock look like a room sync response 2021-09-16 23:53:38 -07:00
Danila Fedorin bcfca9ad9a Make event ID function public 2021-09-16 21:53:56 -07:00
Bruno Windels 41089e2806 remove leftover logging 2021-09-16 22:30:03 +02:00
Bruno Windels c4477a81ea don't create the avatar node when we won't need it 2021-09-16 22:29:48 +02:00
Bruno Windels f02d52ce4c with !interactive, an array of an array is not a valid Child value
why didn't this fail before?
2021-09-16 22:29:13 +02:00
Bruno Windels bae8dc7dd7 changes should be true when replyVM is not set and we set an entry 2021-09-16 22:28:19 +02:00
Bruno Windels e978202f36 add min-height: 0 2021-09-16 17:48:29 +02:00
Bruno Windels 9a9b206bf5
Merge pull request #486 from vector-im/bwindels/fix-scroll-jumps
Fix scroll jumps and loading of gaps not at top of the timeline
2021-09-16 17:14:17 +02:00
Bruno Windels a62627f6db fix lint warning 2021-09-16 16:39:17 +02:00
Bruno Windels 381a12db20 load 20 entries initially in timeline, otherwise it flickers a bit 2021-09-16 16:34:13 +02:00
Bruno Windels 898d32c6da use quotes in css url path 2021-09-16 16:34:01 +02:00
Bruno Windels 6ec2712eec remove debug logging 2021-09-16 16:33:09 +02:00
Bruno Windels c9f79343ef remove obsolete comment 2021-09-16 16:32:59 +02:00
Bruno Windels b1994918fe
Merge pull request #488 from vector-im/bwindels/list-and-timeline-view-to-ts
Convert ListView and TimelineView to typescript
2021-09-16 16:08:34 +02:00
Bruno Windels a6bcfac597 rename UIView to IView 2021-09-16 15:58:48 +02:00
Bruno Windels b71a26b04a avoid using ! in ListView 2021-09-16 15:56:57 +02:00
Bruno Windels 81ec8dca8c improve typing in utils 2021-09-16 15:51:45 +02:00
Bruno Windels d9ddeaf107 fix TS errors in TimelineView 2021-09-16 15:49:03 +02:00
Bruno Windels 00aa40ea7b copy Daniel's conversion of TemplateView to TypeScript from microui
with some minor type adjustments
2021-09-16 15:46:02 +02:00
Bruno Windels ea4d833a43 reuse ViewNode in Child type 2021-09-16 15:39:25 +02:00
Bruno Windels 040efa970c make className binding always have a value (may be undefined through T) 2021-09-16 15:39:17 +02:00
Bruno Windels 68fb093c9e don't require mount args in mountView, like in UIView interface 2021-09-16 15:23:48 +02:00
Bruno Windels 060f4aa297 change extension in preparation for TS conversion 2021-09-16 14:02:36 +02:00
Bruno Windels 65f69a121b copy Daniel's conversion of BaseUpdateView to TypeScript from microui 2021-09-16 14:01:33 +02:00
Bruno Windels 69672dd99c copy Daniel's conversion of html.js to TypeScript from microui 2021-09-16 10:45:06 +02:00
Bruno Windels cce8207870 copy Daniel's conversion of EventEmitter to TypeScript from microui 2021-09-16 10:23:03 +02:00
Danila Fedorin bbd174cd67 Add a class to mock timeline requests 2021-09-15 16:15:18 -07:00
Bruno Windels 2396a84c99 leave out svg editor markup from icon 2021-09-15 18:39:04 +02:00
Bruno Windels e4101ece65 add "jump down" button in timeline 2021-09-15 18:30:08 +02:00
Bruno Windels 1df12b8c89 only allow pixel gaps of < 1px for stick to bottom to prevent eleweb bug
https://github.com/matrix-org/matrix-react-sdk/pull/6751
2021-09-15 17:23:53 +02:00
Bruno Windels 2c415e37e7 where ResizeObserver is support, restore anchored node on resize 2021-09-15 17:23:28 +02:00
Bruno Windels 04edff29cf give more top padding to gaps that appear in the middle of the timeline 2021-09-15 15:57:31 +02:00
Danila Fedorin d2b604e1dd Stop using at to fix tests. 2021-09-14 15:57:32 -07:00
Danila Fedorin df273c5e2c Store more events from backfill 2021-09-14 15:40:15 -07:00
Danila Fedorin b2b5690739 Add more tests 2021-09-14 13:54:14 -07:00
Danila Fedorin f8117b6f98 Lift transaction property to QueryTarget 2021-09-14 11:18:24 -07:00
Danila Fedorin 41e568f783 Add more tests and extract common test code 2021-09-14 11:15:13 -07:00
Danila Fedorin 31577cd496 Draft first two tests 2021-09-14 10:24:18 -07:00
Bruno Windels 247d6a2148 add comments 2021-09-14 17:01:30 +02:00
Danila Fedorin b3df37b0bc Add the beginning of a tests function for GapWriter 2021-09-13 17:01:32 -07:00
Danila Fedorin 713f675f3a Mock IDBKeyRange, too 2021-09-13 17:00:49 -07:00
Danila Fedorin 71694787cd Add an IDBFactory mock parameter 2021-09-13 16:55:55 -07:00
Bruno Windels feb0cf7e39 fix viewport changing width when timeline starts filling the viewport
otherwise centered tiles like announcementview jump a bit vertically
2021-09-13 15:40:15 +02:00
Bruno Windels 906e5886e1 fix tiny jump when timeline starts filling viewport 2021-09-13 15:39:56 +02:00
Bruno Windels ecccadb77e avoid requestIdleCallback as it is not supported on Safari and IE11 2021-09-13 14:53:34 +02:00
Bruno Windels 8858cffc55 fallback from scrollBy() to setting scrollTop on IE11 2021-09-13 14:53:08 +02:00
Bruno Windels 02b8b37b4c disable native scroll anchoring as it interferes with our impl 2021-09-13 13:11:25 +02:00
Bruno Windels 5c40b75eab don't override newly requested ranges when retrying loadattop 2021-09-10 15:25:19 +02:00
Bruno Windels 9411e6f065 WIP 2021-09-10 14:47:05 +02:00
Bruno Windels 98cc1e2715 don't try to load more when end of timeline reached 2021-09-10 14:17:40 +02:00
Bruno Windels fe4bb5db40 remove comment 2021-09-09 17:15:28 +02:00
Bruno Windels d1242c4b67 make gaps taller 2021-09-09 17:15:06 +02:00
Bruno Windels d0f122a2be WIP-ish, batch visible range requests, allow setting empty ranges and...
don't try to notify when the tile becomes invisible again,
we don't need it currently
2021-09-09 17:14:16 +02:00
Bruno Windels 98678b991b no need to store visible state on gap tile & don't fill if edge reached 2021-09-08 16:39:46 +02:00
Bruno Windels ab67ac00b1 restore bottom of timeline initially after attach to DOM
this will also load more items if the viewport isn't filled
2021-09-08 12:06:17 +02:00
Bruno Windels e89f60bac0 fill gap tiles when they become visible 2021-09-08 12:05:59 +02:00
Bruno Windels 7578bfa3d9 let tiles know when they become visible & load more tiles close to top 2021-09-08 12:05:19 +02:00
Bruno Windels f4b4638ea8 actually, pass in just the tile instances for expressing the range 2021-09-07 19:10:53 +02:00
Bruno Windels b3cd2a0e03 express the visible range with EventKeys rather than list indices
This is less ambiguous in case the DOM and the ObservableList would be
out of sync.
2021-09-07 17:48:49 +02:00
Bruno Windels c78a83d398 restore most bottom tile in VP on any list change
and tell view model visible range so it can load more or fill gaps, ...
2021-09-07 15:17:27 +02:00
Bruno Windels 44ea65dd3e
Merge pull request #458 from MidhunSureshR/fix-457
Opening member-details panel should not open/close grid view
2021-09-07 12:16:24 +02:00
Bruno Windels ad4ec5f04c convert TimelineView to typescript 2021-09-06 17:51:32 +02:00
Bruno Windels 632d29795a convert ListView to typescript 2021-09-06 17:12:14 +02:00
RMidhunSuresh df74d0c814 Remove array from logic
Signed-off-by: RMidhunSuresh <hi@midhun.dev>
2021-09-06 17:41:36 +05:30
Bruno Windels c6b020a9e7 Rename TimelineList to TimelineView for consistency 2021-09-06 13:31:43 +02:00
Bruno Windels 5953cdf0cc turns out we do write these 2021-09-06 13:10:36 +02:00
Bruno Windels 35f8c40a0c fix rebase mistake 2021-09-06 13:09:16 +02:00
Bruno Windels 7cb686ce8e convert EventKey to ts 2021-09-06 13:07:41 +02:00
Bruno Windels 85c8415acd convert Direction to ts 2021-09-06 13:06:20 +02:00
Bruno Windels ed082c9869
Merge pull request #475 from vector-im/snowpack-ts-storage-4
Snowpack + Typescript conversion (Part 4)
2021-09-06 13:05:08 +02:00
Bruno Windels 36da02c14e use generics here to say return type of method is same as callback 2021-09-06 13:01:32 +02:00
Bruno Windels 360b4db17a
Merge pull request #474 from vector-im/snowpack-ts-storage-3
Snowpack + Typescript conversion (Part 3)
2021-09-06 12:55:46 +02:00
Bruno Windels ad28f1f9a3 split out Entry type for TimelineEventStore 2021-09-06 12:51:28 +02:00
Bruno Windels cd98cac4e4 split out Entry type for OlmSessionStore 2021-09-06 12:46:44 +02:00
Bruno Windels 5d8e66a3f3
Merge pull request #473 from vector-im/snowpack-ts-storage-2
Snowpack + Typescript conversion (Part 2)
2021-09-06 11:06:46 +02:00
RMidhunSuresh 4f4bc8f805 Add test
Signed-off-by: RMidhunSuresh <hi@midhun.dev>
2021-09-06 14:20:33 +05:30