Commit Graph

48 Commits

Author SHA1 Message Date
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 940c73868f
Organize file and add more nodemon logging (#14)
Spawned from https://github.com/vitejs/vite/issues/8492
2022-06-07 20:27:22 -05:00
Eric Eastwood cc958326ea
Use new Hydrogen light-theme asset directly instead of legacy style.css (#13) 2022-06-07 20:21:56 -05:00
Eric Eastwood dff2209e56
Fix nodemon not being able to watch for changes because vite is interfering (#11)
We use `vite@2.9.6` because `vite>=2.9.7` is interfering with `nodemon`, see https://github.com/vitejs/vite/issues/8492

This means that when using `npm run start-dev` -> [`start-dev.js`](40f9d2ea5a/server/start-dev.js), `nodemon` wasn't restarting when a change was made.
2022-06-07 14:56:46 -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 c34ed9ea0e Fix last event in day not being shown 2022-02-24 13:06:19 -06:00
Eric Eastwood 2153fa4852 Use file that will resolve in new `./assets/*` export
Because we had to update the `assets` `export` to avoid the following deprecation warning:

```
(node:133896) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./assets/" in the "exports" field module resolution of the package at C:\Users\MLM\Documents\GitHub\element\matrix-public-archive\node_modules\hydrogen-view-sdk\package.json.
Update this package.json to use a subpath pattern like "./assets/*".
(Use `node --trace-deprecation ...` to show where the warning was created)
```

`hydrogen-view-sdk` `package.json` before:
```json
{
  "exports": {
      ".": {
          "import": "./lib-build/hydrogen.es.js",
          "require": "./lib-build/hydrogen.cjs.js"
      },
      "./paths/vite": "./paths/vite.js",
      "./style.css": "./style.css",
      "./assets/": "./asset-build/assets/"
  }
}
```

`hydrogen-view-sdk` `package.json` after:

```json
{
  "exports": {
      ".": {
          "import": "./lib-build/hydrogen.es.js",
          "require": "./lib-build/hydrogen.cjs.js"
      },
      "./paths/vite": "./paths/vite.js",
      "./style.css": "./style.css",
      "./assets/*": "./asset-build/assets/*"
  }
}
```
2022-02-24 13:02:55 -06: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 40fa71df03 Clean up federation test 2022-02-22 20:55:42 -06:00
Eric Eastwood 0f493a241e Federated homeservers in Docker for e2e tests 2022-02-22 20:25:24 -06:00
Eric Eastwood aea382e4f8 WIP: start of tests 2022-02-22 16:06:29 -06:00
Eric Eastwood 7d95681611 Make sure input value is zero padded to parse properly 2022-02-18 12:34:21 -06:00
Eric Eastwood 652b96950b Some grid offset simplications thanks to setting correct 1-based date 2022-02-17 21:50:31 -06:00
Eric Eastwood 4f506f0b7e Fix grid-offset when month starts on Sunday like February 2015 2022-02-17 21:29:27 -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 fe3f515862 Calendar styles and server hydrogen assets 2022-02-17 16:56:54 -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 8482c1b667 Clarify that Node.js v16 will also work 2022-02-16 17:11:09 -06:00
Eric Eastwood 8160b6d928 Fix reply permalinks having undefined room ID's 2022-02-16 14:56:20 -06:00
Eric Eastwood d9af4b6b7c Reload when locally linked hydrogen-web changes 2022-02-16 14:55:52 -06:00
Eric Eastwood 56f7d17126 Ensure deps available 2022-02-16 14:13:39 -06:00
Eric Eastwood 5386c5aac7 Point to the right file path 2022-02-16 14:13:30 -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 e0279e080e Add npm run start-dev to build vite and run server at once 2022-02-15 17:17:14 -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
Eric Eastwood 2378ed72c7 Add in date routes 2022-02-09 20:29:18 -06:00
Eric Eastwood a268086cfd Add readme first draft 2022-02-09 02:39:24 -06:00
Eric Eastwood f80f9fbbb6 Make displayname and avatars show up and handle avatar changes 2022-02-09 02:07:16 -06:00
Eric Eastwood 1c7c6bf440 Pass config so images render with correct media repo 2022-02-09 01:49:02 -06:00
Eric Eastwood a49657f9e3 Fetch and render from homeserver 2022-02-07 19:55:11 -06:00
Eric Eastwood 4ab26ef2d1 Strip out PoC pieces (just leave the SSR stuff) 2022-02-05 04:35:02 -06:00
Eric Eastwood e95c8ad4e6 Add CSS support 2022-02-04 01:54:12 -06:00
Eric Eastwood 4e881d6487 Working render (without CSS)
See ![](https://user-images.githubusercontent.com/558581/152488518-a93d320e-608e-4bf4-90a6-43787134894f.png)
2022-02-04 01:24:31 -06:00
Eric Eastwood 3a54d3b652 SSR with linkedom
Currently doesn't work because the `window` object doesn't include
things like `window.crypto`.
2022-02-03 23:44:50 -06:00
Eric Eastwood 3986412a8a Use more Hydrogen built-in functions to avoid brittleness
Messages, replies, images, reactions working,
![](https://user-images.githubusercontent.com/558581/152109238-4c161ebb-32f0-4951-a503-eb9d6a778a2a.png)
2022-02-02 01:07:06 -06:00
Eric Eastwood 1db3d9d9c9 Make sure images and reactions show up 2022-02-01 23:45:09 -06:00
Eric Eastwood 29c5c7e1f3 Get replies to work 2022-02-01 22:32:59 -06:00
Eric Eastwood 070ef6806d main2 working from static event JSON 2022-02-01 21:39:23 -06:00