Happens to address part of https://github.com/matrix-org/matrix-public-archive/issues/271
but made primarily as a follow-up to https://github.com/matrix-org/matrix-public-archive/pull/239
---
Only 42% rooms on the `matrix.org` room directory are `world_readable` which means we will get pages of rooms that are half-empty most of the time if we just naively fetch 9 rooms at a time.
Ideally, we would be able to just add a filter directly to `/publicRooms` in order to only grab the `world_readable` rooms and still get full pages but the filter option doesn't allow us to slice by `world_readable` history visibility.
Instead, we have to paginate until we get a full grid of 9 rooms, then make a final `/publicRooms` request to backtrack to the exact continuation point so next page won't skip any rooms in between.
---
We had empty spaces in the grid before because some rooms in the room directory are private which we filtered out before. But that was a much more rare experience since only 2% of rooms were private .
- Default to a nice `[matrix]` banner
- There is room for improvement here when the Matrix Public Archive gets it's own logo (https://github.com/matrix-org/matrix-public-archive/issues/94) and maybe says "Matrix Public Archive" somewhere in the banner.
- This is good enough for now (and certainly better than downstream previews using the first image on the page).
- For rooms, it will use the room avatar
Part of https://github.com/matrix-org/matrix-public-archive/issues/202
Image is sized to 1200x630 to match conventions of `og:image`.
Crafted the banner image by modifying the header on the room directory homepage and taking a node screenshot. Page zoom @ 175%
Fix https://github.com/matrix-org/matrix-public-archive/issues/59
Other updates:
- Update tests to use `/roomid/room1/date/2022/01/03` format instead of trying to retrofit the weird alias stuff on there. Which also makes the fancy to actual URL utilities much more simple.
- Update to specify `archiveMessageLimit` in the test case because pages have different number of events depending on if we are against a boundary, hidden events, etc.
- Less test bulk
- Single source of truth: there is no mismatch between the comment and the expectations (we already caught a few mistakes in the conversion thanks to this benefit)
- Easier to maintain and update
- Fix https://github.com/matrix-org/matrix-public-archive/issues/7
- A URL with time looks like
- `/r/too-many-messages-on-day:my.synapse.server/date/2022/11/16T23:59`
- Or when more precision is required (seconds): `/r/too-many-messages-on-day:my.synapse.server/date/2022/11/16T23:59:59`
- Add new custom time picker/scrubber (pictured below) with momentum scrubbing
- Native built-in `<input type="time">` for easier picking if you prefer that and accessibility.
- Uses localized time strings
- Design inspired by Thiago Sanchez's *Time Zone Translate* concept, https://dribbble.com/shots/14590546-Time-Zone-Translate
This might be a little ambiguous since we'll have permalinks within the Matrix Public Archive with `?at=$xxx` (related https://github.com/matrix-org/matrix-public-archive/issues/137) which is different from `matrix.to` permalinks 🤔
But will just go with it for now ⏩
Fix https://github.com/matrix-org/matrix-public-archive/issues/46
Follow-up to https://github.com/matrix-org/matrix-public-archive/pull/71
Summary:
- Changes the "Jump to next activity in room" to actually continue you to the next 100 messages ahead. Previously, it only jumped you to the single next event in the room which meant a lot of backwards overlap each time.
- Jumping this direction will also start your scroll position at the top of the timeline to continue reading seamlessly `?continue=top`
- Adds "Jump to previous activity in room" to the top of the timeline to continue reading the previous part of the conversation.
[1]: There is a caveat with seamless here which is also commented on in the code:
> XXX: This is flawed in the fact that when we go `/messages?dir=b` it could backfill messages which will fill up the response before we perfectly connect and continue from the position they were jumping from before. When `/messages?dir=f` backfills, we won't have this problem anymore because any messages backfilled in the forwards direction would be picked up the same going backwards.
(need forwards fill MSC)
This helps when someone just pastes a room alias on the end of the domain,
- `/#room-alias:server` -> `/r/room-alias:server`
- `/r/#room-alias:server/date/2022/10/27` -> `/r/room-alias:server/date/2022/10/27`
Since these redirects happen on the client, we can't write any e2e tests. Those e2e tests do everything but run client-side JavaScript.
Follow-up to https://github.com/matrix-org/matrix-public-archive/pull/107
Part of https://github.com/matrix-org/matrix-public-archive/issues/25
Also does friendly redirects if you don't exactly use the right URL pattern.
For example, if you paste the full room ID with the `!` like `/roomid/!foo:bar`,
it will properly redirect you to `/roomid/foo:bar`. It also does this sort of
thing for URL encoded room ID's and aliases.
Fix https://github.com/matrix-org/matrix-public-archive/issues/25
**Before:**
```
Child printed something to stdout: Mounting Hydrogen...
Child printed something to stderr: Skipping `addedHomservers` read from LocalStorage since LocalStorage is not available
Child printed something to stdout: Completed mounting Hydrogen: 22.188ms
Child printed something to stdout: 2 uncaughtException TypeError: this.dialogNode.close is not a function
at ModalView.closeModal (C:\Users\MLM\Documents\GitHub\element\matrix-public-archive\shared\views\ModalView.js:115:21)
at Timeout._onTimeout (C:\Users\MLM\Documents\GitHub\element\matrix-public-archive\shared\views\ModalView.js:87:18)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
```
**After:**
```
Child printed something to stdout: Mounting Hydrogen...
Child printed something to stderr: Skipping `addedHomservers` read from LocalStorage since LocalStorage is not available
Child printed something to stdout: Completed mounting Hydrogen: 14.2ms
```
This would happen after opening the "Add server" modal
Before:
```
/?search=&homeserver=foo.bar#/add-server?search=&homeserver=foo.bar
```
After:
```
/?search=&homeserver=foo.bar#/add-server
```
1. Add surrounding messages to the given messages so we have a full screen of content to make it feel lively even in quiet rooms
- As you scroll around the timeline across different days, the date changes in the URL, calendar, etc
2. Add summary item to the bottom of the timeline that explains if we couldn't find any messages in the specific day requested
- Also allows you to the jump to the next activity in the room. Adds `/:roomId/jump?ts=xxx&dir=[f|b]` to facilitate this.
- Part of https://github.com/matrix-org/matrix-public-archive/issues/46
3. Add developer options modal which is linked from the bottom of the right-panel
- Adds an option so you can debug the `IntersectionObserver` and how it's selecting the active day from the top-edge of the scroll viewport.
- In the future, this will also include a nice little visualization of the backend timing traces
Use `DisabledComposerView` instead of no composer to add message:
> You're viewing an archive of events from 2022-02-08. Use a [Matrix client](https://matrix.to/#/!HBehERstyQBxyJDLfR:my.synapse.server) to start chatting in this room.
Also refactors some of the `views` and `viewmodels` out to their own files