View the history of public and world readable Matrix rooms
Go to file
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
.github/workflows Add linting to CI (#74) 2022-09-27 22:21:00 -05:00
build Add support for client-side room alias hash `#` redirects to the correct URL (#111) 2022-10-28 00:32:24 -05:00
config Add a way to jump forwards and backwards to more activity in the room (seamless navigation) (#114) 2022-11-02 04:27:30 -05:00
public Add a way to jump forwards and backwards to more activity in the room (seamless navigation) (#114) 2022-11-02 04:27:30 -05:00
server Add a way to jump forwards and backwards to more activity in the room (seamless navigation) (#114) 2022-11-02 04:27:30 -05:00
shared Add a way to jump forwards and backwards to more activity in the room (seamless navigation) (#114) 2022-11-02 04:27:30 -05:00
test Add a way to jump forwards and backwards to more activity in the room (seamless navigation) (#114) 2022-11-02 04:27:30 -05:00
.eslintignore Fix lints 2022-02-15 21:33:31 -06:00
.eslintrc.json Room directory landing page v1 (#61) 2022-09-08 01:30:04 -05:00
.gitignore E2E test but still failing because fetching from start of day before test events happened 2022-02-23 21:25:05 -06:00
.prettierignore Add linting to CI (#74) 2022-09-27 22:21:00 -05:00
.prettierrc.json SSR with linkedom 2022-02-03 23:44:50 -06:00
Dockerfile Room directory landing page v1 (#61) 2022-09-08 01:30:04 -05:00
LICENSE.md Add Apache 2.0 license (#55) 2022-08-30 18:35:36 -05:00
README.md Small readme updates (#112) 2022-10-28 00:44:40 -05:00
docker-health-check.js Make sure container is able to start up (#23) 2022-06-15 17:12:44 -05:00
package-lock.json Add a way to jump forwards and backwards to more activity in the room (seamless navigation) (#114) 2022-11-02 04:27:30 -05:00
package.json Add a way to jump forwards and backwards to more activity in the room (seamless navigation) (#114) 2022-11-02 04:27:30 -05:00

README.md

Matrix Public Archive

NB: This project is very much a work-in-progress (WIP)! Undocumented config/secrets, using a draft branch of Hydrogen, etc.

In the vein of feature parity with Gitter, the goal is to make a public archive site for world_readable Matrix rooms like Gitter's archives which search engines can index and keep all of the content accessible/available. There is already https://view.matrix.org/ (https://github.com/matrix-org/matrix-static) but there is some desire to make something with more Element-feeling polish and loading faster (avoid the slow 502's errors that are frequent on view.matrix.org).

Plan summary

The plan is to server-side render (SSR) the Hydrogen Matrix client on a Node.js server (since both use JavaScript) and serve pages on the fly (probably with some Cloudflare caching on top) when someone requests /archives/${year}/${month}/${day}. To fetch the events for a given day/time, we will use MSC3030's /timestamp_to_event endpoint to jump to a given day in the timeline and fetch the messages from a Matrix homeserver.

Re-using Hydrogen gets us pretty and native(to Element) looking styles and keeps the maintenance burden of supporting more event types in Hydrogen.

Setup

Prerequisites

Get the app running

$ npm install

# Edit config/config.user-overrides.json so that `matrixServerUrl` points to your homeserver
# and has `matrixAccessToken` defined
$ cp config/config.default.json config/config.user-overrides.json

$ npm run start-dev
# To enable tracing, add the `--tracing` flag
$ npm run start-dev -- --tracing

Development

# We need to use a draft branch of Hydrogen to get the custom changes needed for
# `matrix-public-archive` to run. Hopefully soon, we can get all of the custom
# changes mainlined so this isn't necessary.
$ git clone git@github.com:vector-im/hydrogen-web.git
$ cd hydrogen-web
$ git checkout madlittlemods/matrix-public-archive-scratch-changes
$ yarn install
$ yarn build:sdk
$ cd target/ && npm link && cd ..
$ cd ..

# Now clone and install the `matrix-public-archive` project
$ git clone git@github.com:matrix-org/matrix-public-archive.git
$ cd matrix-public-archive
$ npm install
$ npm link hydrogen-view-sdk
# If you just want to run the tests, you can skip to the "Running tests" section at this point
#
# Edit config/config.user-overrides.json so that `matrixServerUrl` points to your homeserver
# and has `matrixAccessToken` defined
$ cp config/config.default.json config/config.user-overrides.json

# Now we can finally start the app
$ npm run start-dev

Running tests

See the testing readme.