83 Commits

Author SHA1 Message Date
Kegan Dougal
613cbd9a67 client: swap to lists-as-keys 2023-02-13 17:13:42 +00:00
Kegan Dougal
beeb128be0 Use the same client code as js-sdk 2022-12-15 10:51:29 +00:00
Kegan Dougal
2009749651 Fix client test rig to not expect a room_id field to exist 2022-05-27 15:31:00 +01:00
Kegan Dougal
9e0295267d Remove the UPDATE command
It is not required now that `ops` only relate to rooms changing positions.
2022-05-27 13:47:14 +01:00
Kegan Dougal
7f4030d8ee Use new API format 2022-05-27 13:21:03 +01:00
Kegan Dougal
d1e253da21 Set sensible default timeout if not provided 2022-03-23 12:24:48 +00:00
Kegan Dougal
61bd94fe4b Set timeout on test jig 2022-03-23 12:18:32 +00:00
Kegan Dougal
8e60b217f9 client: refactor how the room list is rendered 2022-03-07 17:29:36 +00:00
Kegan Dougal
1e98854571 client: save cpu cycles by not re-rendering placeholders. Move IntersectionObserver to list.js 2022-03-07 15:37:22 +00:00
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
cccaccd17c More comments 2022-02-24 15:03:10 +00:00
Kegan Dougal
ea495ed0d3 client: migrate room list rendering code to render.js 2022-02-24 14:43:45 +00:00
Kegan Dougal
6400a0c6d1 Function names and comments 2022-02-24 14:28:05 +00:00
Kegan Dougal
8a677347f8 server/bugfix: fix panic on invited rooms; expose v2 server url to client
- Expose `/client/server.json` so clients know the CS API base endpoint for things like media requests
  (and in future sending events, etc)
- Tidy up a few comments.
2022-02-24 14:14:59 +00:00
Kegan Dougal
f79eb957de client: Move sliding sync loop code to sync.js
- use callbacks to propagate room data and notices when the response has been processed.
2022-02-24 11:10:12 +00:00
Kegan Dougal
808d7f8d21 client: use prettier; add README 2022-02-23 19:26:38 +00:00
Kegan Dougal
3867cece40 client: tidy up error message handling 2022-02-23 18:31:49 +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
05a731dfbc client: Move some sliding sync code to sync.js 2022-02-23 17:39:31 +00:00
Kegan Dougal
0b7405d062 client/bugfix: ensure that when you filter the room list it bumps to the top of the list 2022-02-23 12:34:14 +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
693a75ee66 client: Add white dots for room positions with data (default off as it's expensive) 2022-02-23 11:01:40 +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
356423e2cd client/bugfix: Deep-copy DEFAULT_RANGES
Otherwise the list ranges are set to the same values for different
lists which causes one list to not render correctly.
2022-02-22 17:45:19 +00:00
Kegan Dougal
c8f44f6c6b Delete children at the end of the list, not the beginning
Else the IDs are wrong and need to be updated. This fixes the
bug with it requesting huge offsets when filtering by room name.
2022-02-18 18:39:55 +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
eaa6593d36 client: bugfix which resulted in dupe rooms 2022-01-04 16:47:56 +00:00
Kegan Dougal
6257027a29 s/rooms/ranges 2022-01-04 15:32:50 +00:00
Kegan Dougal
398fc1ec6c bugfix: rooms with no events shouldn't cause the sync loop to die
Also run some formatting fixes
2021-11-12 15:15:31 +00:00
Kegan Dougal
82e9336054 client: bugfix where the intersection indexes did not honour the list index
So you'd end up with huge ranges as it took min(i) and max(i) for all visible
indexes.
2021-11-11 13:17:44 +00:00
Kegan Dougal
794e0eeaa3 Fix CSS for room list headings 2021-11-11 13:00:32 +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
d1e9409694 Implement multiple list support
Untested but seems to work empirically as integration tests pass and
the test jig doesn't explode. Needs refactoring once tests land.
2021-11-09 16:57:57 +00:00
Kegan Dougal
1315701e99 Fix client to pass in a list 2021-11-08 10:18:54 +00:00
Kegan Dougal
e6a3543ac1 Ignore @ when working out room name sort positions 2021-11-02 18:05:38 +00:00
Kegan Dougal
f581d44440 Load highlight/notification counts for sorting 2021-11-02 15:59:03 +00:00
Kegan Dougal
9f3364d9ed PollerMap: ensure callbacks are always called from a single goroutine
Document a nasty race condition which can happen if >1 user is joined
to the same room. Fixed to ensure that `GlobalCache` will always stay
in-sync with the database without having to hit the database.
2021-10-28 16:15:17 +01:00
Kegan Dougal
e8841183de client: scroll to bottom when new events are loaded 2021-10-26 18:12:21 +01:00
Kegan Dougal
d7913c8e26 Return the most recent timeline events for each room
TODO: the global cache isn't being kept updated so live
streamed events don't load (though they sort correctly)
2021-10-22 18:18:02 +01:00
Kegan Dougal
0a7c62defc Log valid commands for easier debugging from logs 2021-10-22 16:11:50 +01:00
Kegan Dougal
9474a723ba fix #13: rooms can be duplicated
This happens when there are >1 window and a DELETE/INSERT op do not affect the same window.
2021-10-22 16:07:04 +01: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
0ebf6b6fd0 Render m.reaction events 2021-10-21 15:57:50 +01:00
Kegan Dougal
0295e968b0 Refer to top level rooms correctly 2021-10-21 15:47:50 +01:00
Kegan Dougal
43d36efe8d Improve client logging for duplicate room indexes 2021-10-21 13:15:32 +01:00
Kegan Dougal
ab359c7ff3 bugfix: #9 2021-10-11 10:37:10 +01:00