Commit Graph

37 Commits

Author SHA1 Message Date
Eric Eastwood 5d444d5044
Rename project from "Matrix Public Archive" to "Matrix Viewer" (#280)
Mentioned in the recent blog post: https://matrix.org/blog/2023/07/what-happened-with-the-archive/#next-steps

The canonical `view.matrix.org` instance is not live yet but this is pre-requisite work for that to happen.
2023-07-14 15:52:35 -05:00
Eric Eastwood 0fc4421432
Indicate when the room was set to `world_readable` and by who (#278) 2023-06-28 20:29:49 -05:00
Eric Eastwood b10884505a
Fix time selector showing when less than the page limit of messages (#213)
Fix https://github.com/matrix-org/matrix-public-archive/issues/211
2023-05-04 20:50:43 -05:00
Eric Eastwood 8255e644e6
Fix broken links with the matrix-media-repo because there are too many slashes (#199)
The extra slash seems to work fine with the built-in media repo in Synapse but noticed broken links when using `matrix.org` which delegates to the `matrix-media-repo`

Before:
```
http://localhost:8008//_matrix/media/r0/thumbnail/my.synapse.server/abcde?width=30&height=30&method=crop
```

After:
```
http://localhost:8008/_matrix/media/r0/thumbnail/my.synapse.server/abcde?width=30&height=30&method=crop
```
2023-04-27 21:36:30 -05:00
Eric Eastwood f0a11139cb
Update Hydrogen SDK dependency `0.26.0-scratch` - 2023-04-26 (#189)
Of note:

 - Adds date headers, https://github.com/vector-im/hydrogen-web/pull/938
 - Add "Copy matrix.to permalink" message action, https://github.com/vector-im/hydrogen-web/pull/921
 - Removes `?v=3.13` query parameters from Inter font references in CSS, https://github.com/vector-im/hydrogen-web/pull/961
    - This is what we need to solve https://github.com/matrix-org/matrix-public-archive/pull/187#discussion_r1177638781
2023-04-26 16:18:34 -05:00
Eric Eastwood 954b22995a
Add a way to select time of day (#139)
- 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
2023-04-05 04:25:31 -05:00
Eric Eastwood b41d15a92c
Add `Copy permalink` option to messages (`matrix.to`) (#136)
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 
2022-11-14 17:55:00 -06:00
Eric Eastwood 776347207e
Updates to be compatible with the latest Hydrogen changes (rename `urlCreator` -> `urlRouter`) (#134)
Hydrogen changes:

 - https://github.com/vector-im/hydrogen-web/pull/918
2022-11-10 17:37:08 -06:00
Eric Eastwood 5bae040d72
Add permalink highlighting - `?at=$xxx` (#123)
ex.
```
http://localhost:3050/r/test-room1:my.synapse.server/date/2022/07/28?at=$O9fDg42JoSh9VdcL820FDUS0Gi_CkPt_hrN1pK1fPEY
````

Fix https://github.com/matrix-org/matrix-public-archive/issues/4

Split out from https://github.com/matrix-org/matrix-public-archive/pull/121
2022-11-03 04:49:07 -05:00
Eric Eastwood 08254cbb49
Add a way to jump forwards and backwards to more activity in the room (seamless navigation) (#114)
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)
2022-11-02 04:27:30 -05:00
Eric Eastwood dc7017ae4c
Move Hydrogen `timelineViewModel` creation to our main view model (#118)
Move Hydrogen `timelineViewModel` creation to our main view model.

Was it better to keep this Hydrogen boilerplate outside? Maybe 🤷. It's possible that all of this will go away with something like https://github.com/MadLittleMods/hydrogen-static-archives-prototype/pull/2

Should we also move the [`room` VM creation](8275f120a6/shared/hydrogen-vm-render-script.js (L88-L111))? Maybe but it's not as much noise as all of this tile/timeline stuff.
2022-11-01 08:54:43 -05:00
Eric Eastwood 718f01e5a4
Refactor to use `TimelineView` (#117)
We have to figure out our own layout but does get rid of some of the `RoomView` boilerplate.
The `TimelineView` still has outside boilerplate styles to work.

There shouldn't be any visible change.
2022-11-01 08:36:32 -05:00
Eric Eastwood 7a88ea0c19
Add support for room aliases (#107)
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
2022-10-27 01:09:13 -05:00
Eric Eastwood b34c1b817d
Add homeserver selector to room directory landing page (#87)
Opting for the simple solution and using `include_all_networks` instead of needing to fetch the information about the third-party networks.

Fix https://github.com/matrix-org/matrix-public-archive/issues/6 (last piece done with this PR)
2022-10-20 02:06:43 -05:00
Eric Eastwood be837515fe
Show surrounding messages for a full screen of content (#71)
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
2022-09-20 16:02:09 -05:00
Eric Eastwood 92668996d7
Add search to room directory landing page (#70)
Part of https://github.com/matrix-org/matrix-public-archive/issues/6
2022-09-15 20:41:55 -05:00
Eric Eastwood 127d416e6a
Room directory landing page v1 (#61)
Part of https://github.com/matrix-org/matrix-public-archive/issues/6
2022-09-08 01:30:04 -05:00
Eric Eastwood 02b86a8405
Render pipeline separation of concerns (#64)
Follow-up to https://github.com/matrix-org/matrix-public-archive/pull/36

Render pipeline separation of concerns:

 1. Run in `child_process`
 2. Hydrogen render
 
It's now just a generic `child_process` runner that runs the Hydrogen render in it. This eliminates the windy path of the 1-4 steps that was only held together by the file names themselves.
2022-09-02 20:49:06 -05:00
Eric Eastwood f738dbc1da
Stop Hydrogen from running in the background after we get our SSR HTML render data (#36)
We now run the Hydrogen render in a `child_process` so we can exit the whole render process. We still use the `vm` to setup the browser-like globals. With a `vm`, everything continues to run even after it returns and there isn't a way to clean up, stop, kill, terminate the vm script or context so we need this extra `child_process` now to clean up. I don't like the complexity necessary for this though. I wish the `vm` API allowed for this use case. The only way to stop a `vm` is the `timeout` and we want to stop as soon as we return.

Fix https://github.com/matrix-org/matrix-public-archive/issues/34
2022-07-05 17:30:52 -05:00
Eric Eastwood 9fc71a3412
Remove `matrix-bot-sdk` usage in tests (#15)
Remove `matrix-bot-sdk` usage in tests because it didn't have timestamp massaging `?ts` and it's not really necessary to rely on since we can just call the API directly 🤷. `matrix-bot-sdk` is also very annoying having to build rust crypto packages.

We're now using direct `fetch` requests against the Matrix API and lightweight `client` object.

All 3 current tests pass 
2022-06-09 20:44:57 -05:00
Eric Eastwood 7dfe8cabc9
Add lightbox support and Hydrogen URL hashes relative to the room (#12)
Add image lightbox support and Hydrogen URL hashes relative to the room

Related to https://github.com/vector-im/hydrogen-web/issues/677

Requires the changes from https://github.com/vector-im/hydrogen-web/pull/749 (split out from https://github.com/vector-im/hydrogen-web/pull/653)

![](https://user-images.githubusercontent.com/558581/172526457-38c108e8-8c46-4e0c-9979-734348ec67fc.gif)


### Hydrogen routing relative to the room (remove session and room from the URL hash)

Before:
Page URL: doesn't work
```html
<div class="Timeline_messageBody">
   <div class="media" style="max-width: 400px">
      <div class="spacer" style="padding-top: 48.75%;"></div>
      <a href="undefined">
          <img src="http://192.168.1.182:8008//_matrix/media/r0/thumbnail/my.synapse.server/RxfuMxEgYcXHKYWERkKVUkqO?width=400&amp;height=195&amp;method=scale" alt="Friction_between_surfaces.jpeg" title="Friction_between_surfaces.jpeg" style="max-width: 400px; max-height: 195px;">
      </a>
      <time>2/24 6:20 PM</time>
   </div>
   <!--node binding placeholder-->
</div>
```

Before (not relative):
Page URL: `http://localhost:3050/!HBehERstyQBxyJDLfR:my.synapse.server/date/2022/02/24#/session/123/room/!HBehERstyQBxyJDLfR:my.synapse.server/lightbox/$17cgP6YBP9ny9xuU1vBmpOYFhRG4zpOe9SOgWi2Wxsk`
```html
<div class="Timeline_messageBody">
   <div class="media" style="max-width: 400px">
      <div class="spacer" style="padding-top: 48.75%;"></div>
      <a href="#/session/123/room/!HBehERstyQBxyJDLfR:my.synapse.server/lightbox/$17cgP6YBP9ny9xuU1vBmpOYFhRG4zpOe9SOgWi2Wxsk">
          <img src="http://192.168.1.182:8008//_matrix/media/r0/thumbnail/my.synapse.server/RxfuMxEgYcXHKYWERkKVUkqO?width=400&amp;height=195&amp;method=scale" alt="Friction_between_surfaces.jpeg" title="Friction_between_surfaces.jpeg" style="max-width: 400px; max-height: 195px;">
      </a>
      <time>2/24 6:20 PM</time>
   </div>
   <!--node binding placeholder-->
</div>
```

After (nice relative links):
Page URL: `http://localhost:3050/!HBehERstyQBxyJDLfR:my.synapse.server/date/2022/02/24#/lightbox/$17cgP6YBP9ny9xuU1vBmpOYFhRG4zpOe9SOgWi2Wxsk`
```html
<div class="Timeline_messageBody">
   <div class="media" style="max-width: 400px">
      <div class="spacer" style="padding-top: 48.75%;"></div>
      <a href="#/lightbox/$17cgP6YBP9ny9xuU1vBmpOYFhRG4zpOe9SOgWi2Wxsk">
          <img src="http://192.168.1.182:8008//_matrix/media/r0/thumbnail/my.synapse.server/RxfuMxEgYcXHKYWERkKVUkqO?width=400&amp;height=195&amp;method=scale" alt="Friction_between_surfaces.jpeg" title="Friction_between_surfaces.jpeg" style="max-width: 400px; max-height: 195px;">
      </a>
      <time>2/24 6:20 PM</time>
   </div>
   <!--node binding placeholder-->
</div>
```
2022-06-08 14:03:36 -05:00
Eric Eastwood 40f9d2ea5a
Update to work with latest `hydrogen-view-sdk@0.0.12` (#10)
Get this project running again after a few months of changes
from `hydrogen-view-sdk` and now finally after
https://github.com/vector-im/hydrogen-web/pull/693
merged to make the SDK friendly to locally link and develop on.
2022-06-06 18:58:45 -05:00
Eric Eastwood db6d3797d7 Working e2e test 2022-02-24 03:27:53 -06:00
Eric Eastwood 839e31a35e E2E test but still failing because fetching from start of day before test events happened 2022-02-23 21:25:05 -06:00
Eric Eastwood b41ee62e59 Add year select fallback for Firefox 2022-02-17 21:10:36 -06:00
Eric Eastwood 6d5ad656b6 Add month/year selector and use UTC date functions 2022-02-17 20:45:47 -06:00
Eric Eastwood b401cbbc3a Add active date to calendar 2022-02-16 23:08:18 -06:00
Eric Eastwood 6a5d011a45 Link calendar days 2022-02-16 19:58:32 -06:00
Eric Eastwood 8160b6d928 Fix reply permalinks having undefined room ID's 2022-02-16 14:56:20 -06:00
Eric Eastwood 166857e0de Fix lints 2022-02-15 21:33:31 -06:00
Eric Eastwood 6c1cf6d46a Stop restarting server when the client bundle updates 2022-02-15 17:30:30 -06:00
Eric Eastwood ae4b529879 Working calendar month navigation 2022-02-15 02:30:26 -06:00
Eric Eastwood 72a6297ae5 Re-mount on client to get JS interactivity 2022-02-15 01:33:16 -06:00
Eric Eastwood 0aab8383c5 Pass data by window which is also serialized on the client 2022-02-14 23:20:25 -06:00
Eric Eastwood a75b12a608 WIP: Add calendar to right panel 2022-02-14 21:11:55 -06:00
Eric Eastwood 82ba92b806 Add custom RightPanel support 2022-02-10 02:21:49 -06:00
Eric Eastwood c0a2a65c2f Add support for the room header (RoomView) 2022-02-10 01:42:02 -06:00