34 Commits

Author SHA1 Message Date
Kegan Dougal
4a03b12287 client/server: set 'initial' flag on a per-room basis and use it when rendering
Previously the 'initial' flag was set on the entire response which was pointless
as the client can detect this by the presence/absence of `?pos=`.

Instead, move the `initial` flag to be present on the Room object, so clients know
when to replace or update their databases. Use this to fix a bug where the timeline
would show incorrectly when clicking on rooms due to appending to the timeline when
the room subscription data was collected.
2022-02-24 16:48:39 +00:00
Kegan Dougal
923d3e084c client: Add input box and basic /commands
Supports:
 - /invite @user
 - /join #room-id-or-alias
 - /leave
 - /me thinks
 - basic text
2022-02-24 15:55:32 +00:00
Kegan Dougal
7ddcfd5ae5 client: refactor devtools, sync connection and debug commands
- Move svg / bandwidth code to devtools.js
- Move HTTP API code to SlidingSyncConnection (with abort controller and tx/rx stats)
- Remove debug commands: they need to be re-done to be actually useful for developers.
2022-02-23 18:05:09 +00:00
Kegan Dougal
52978edffd client: add render.js to put boring non-sliding-sync code in 2022-02-23 12:16:22 +00:00
Kegan Dougal
d5654f3c2f client: animate SYNC/INVALIDATE/INSERT/DELETE/UPDATE operations 2022-02-23 10:51:09 +00:00
Kegan Dougal
817b9b0442 client: Add svg visualisation of the sliding window ranges 2022-02-22 19:04:19 +00:00
Kegan Dougal
2e53b357d9 client: add Tx/Rx stats 2022-02-22 18:24:35 +00:00
Kegan Dougal
44bfebfab9 Invalidate ranges when the filter changes on a list
Some bugs still exist on the client where it gets confused about the
new offsets, but the server code seems to be doing the right thing.
2022-02-18 18:29:25 +00:00
Kegan Dougal
657ac946d2 Add multiple lists to the test jig
CSS needs some work
2021-11-10 18:13:04 +00:00
Kegan Dougal
e6a3543ac1 Ignore @ when working out room name sort positions 2021-11-02 18:05:38 +00:00
Kegan Dougal
42516c92cc Only display DEBUG button if the access token is set to 'debug' 2021-10-22 15:59:12 +01:00
Kegan Dougal
3564ef68f0 Add debug commands 2021-10-22 15:00:57 +01:00
Kegan Dougal
5f19fccd07 Implement unread counts on the client 2021-10-08 14:15:36 +01:00
Kegan Dougal
e60f75cb01 Use grey rectangles instead of blurring placeholders
It's far more performant and gives a better scrolling UX.
2021-10-08 12:47:36 +01:00
Kegan Dougal
362aca5954 Show the room topic; read the right required_state field on the muxed req for the room ID in question 2021-10-07 17:43:53 +01:00
Kegan Dougal
eeada4f75d Load room avatars via required_state 2021-10-07 16:58:03 +01:00
Kegan Dougal
c58c8d4d9a Remove New Session button and always make a new one on sync click 2021-10-07 11:22:53 +01:00
Kegan Dougal
1acee76fb6 client: highlight the active room in the room list 2021-10-06 14:03:22 +01:00
Kegan Dougal
3a2eb0d801 Rejig css 2021-10-06 13:20:26 +01:00
Kegan Dougal
311a45efef client: add styles.css in prep for dynamic styles
Specifically for highlighting the currently selected room.
2021-10-06 12:45:54 +01:00
Kegan Dougal
732ea46f1c server: handle cases where indexes do not bump up to 0-20
Previously this would then panic as we always assumed `toIndex`
could be upper clamped to a range. Whilst we only sort by timestamp,
some servers (particularly on Matrix HQ) are sufficiently far behind
for this to happen in the wild.
2021-10-06 12:26:45 +01:00
Kegan Dougal
e542034724 Move JS to dedicated file
It's slightly clearer, especially as we're padding out the feature
set of the test rig.
2021-10-06 10:06:16 +01:00
Kegan Dougal
c44b327d8c Add message template and render the timeline using it 2021-10-05 18:04:34 +01:00
Kegan Dougal
7609f443d9 Rejig layout for displaying messages in a room 2021-10-05 17:50:15 +01:00
Kegan Dougal
de2322f841 Prettify m.room.member events 2021-09-30 17:50:41 +01:00
Kegan Dougal
852d3b4ae0 Display canonical alias if no room name is set; display errors on UI 2021-09-30 17:28:36 +01:00
Kegan Dougal
02003cb31e Zero-pad dates 2021-09-30 17:03:34 +01:00
Kegan Dougal
49cfd0d856 Recycle views in the list
This prevents flickering when new events arrive.
2021-09-30 11:43:16 +01:00
Kegan Dougal
80a32566d3 Fix bug which caused 0,20 range to be invalidated 2021-09-30 11:02:07 +01:00
Kegan Dougal
dee74f1a8f client: request multiple ranges depending on scroll position
Also fix a bug with the last event JSON not matching the timestamp
2021-09-29 18:27:26 +01:00
Kegan Dougal
ec6fd34fb1 client: track visible room indexes in prep for asking for sliding windows 2021-09-28 20:45:20 +01:00
Kegan Dougal
886e870514 Fix tests; add placeholder rooms to global count 2021-09-28 19:38:10 +01:00
Kegan Dougal
29da970022 CSS and display most recent event 2021-09-28 18:33:10 +01:00
Kegan Dougal
415575d942 Flesh out client, fix session management
- Request first 100 rooms, with placeholder icons
- Add a `http.FileServer` for everything under `/client` for images.
- Sessions are only 400d if they provide a `?pos=` with the session ID.
2021-09-28 13:48:42 +01:00