Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow storing highlights on arbitrary rooms #11

Open
frandavid100 opened this issue Dec 14, 2021 · 10 comments
Open

Allow storing highlights on arbitrary rooms #11

frandavid100 opened this issue Dec 14, 2021 · 10 comments

Comments

@frandavid100
Copy link

Right now, every time I want to annotate a webpage, I need to create a room specifically for that. Instead, I would like to be able to store annotations on an existing room of my choice. Consider the following use case:

I have a room where I hang out with a group of friends interested in movies. Whenever one of us reads some movie-related news, and thinks the others will be interested, he sends a link to that room and we comment the parts we found interesting.

It would be great to use Matrix Highlight for that. I would then be able to highlight some text as I read it, and send it to this particular room. My friends would then see some sort of message, e.g. "@david highlighted on example.com: lorem ipsum", and could then start a thread commenting that particular piece of text. Then I would easily find my friends' comments the next time I opened that same webpage, even if time had passed and they were old comments now, long lost in the room's timeline.

@frandavid100
Copy link
Author

Of course, in order to let you do that, the extension would need a way to show you your whole room list, including rooms that are not highlight rooms. Maybe with a checkbox which lets you choose between only seeing highlight rooms, or also seeing regular rooms.

@Stvad
Copy link
Contributor

Stvad commented Jan 2, 2023

At a basic level you can probably give people an ability to just enter the roomId.

This also allow people to create and configure rooms the way they like (e.g. make room public).


Implementation-wise the current approach is to write the url of the room into the creation data for the room, instead (or in addition to that) one can use a custom-state event. To configure room to map to a certain url

@DanilaFe
Copy link
Owner

DanilaFe commented Jan 2, 2023

instead [...] one can use a custom-state event

The hiccup with this is that state events aren't visible before joining a room. It would have to be done in addition (like you mentioned), because otherwise, it would be impossible to tell highlight rooms you're invited to from regular rooms you're invited to.

@Stvad
Copy link
Contributor

Stvad commented Jan 2, 2023

Ah, I see.

Trying to do that now, for some reason getting 403 when trying to add new event 🤔.
Afaik there are no power level requirements for a custom state event?

The current version of sdk seems to be using an older url scheme 🤔

https://matrix-client.matrix.org/_matrix/client/r0/rooms/!xbzjCqPEplGFOiGRTy:matrix.org/state/com.danilafe.highlight.state/?access_token=... vs ( /_matrix/client/v3/rooms/{roomId}/state/{eventType}/{stateKey})

Tempted to update it to the latest, but that leads to a ton of compilation errors =\

@Stvad
Copy link
Contributor

Stvad commented Jan 2, 2023

Looking at the older spec https://matrix.org/docs/spec/client_server/r0.5.0.html#put-matrix-client-r0-rooms-roomid-state-eventtype-statekey it doesn't seem like this should have changed

@Stvad
Copy link
Contributor

Stvad commented Jan 2, 2023

It seems Synaps defaults to "50" as a default power level required on unknown state events =. annoying
https://github.com/matrix-org/synapse/blob/develop/synapse/event_auth.py#L744

@Stvad
Copy link
Contributor

Stvad commented Jan 2, 2023

that's user-side solvable, but a bad UX =. Any suggestions @DanilaFe ?

@Stvad
Copy link
Contributor

Stvad commented Jan 2, 2023

Ah, I suppose this ticket also implies that one room can host highlights for a variety of pages, which would require more extensive changes 🤔

@Stvad
Copy link
Contributor

Stvad commented Jan 2, 2023

Another thing I'm somewhat confused about is how to trigger proper transition of state in the extension after joining the room.

  • Make sure the extension know that there is a room assigned and selected
  • Transition UI to the state of room overview

would appreciate your help on that @DanilaFe !

@Stvad
Copy link
Contributor

Stvad commented Jan 4, 2023

For annotating multiple pages in one room - I suppose the approach would be to post a variety of messages with different state keys and then make the room match any of the given URLs internally.

The annotation messages would need to include the URL it's associated with, and be filtered by extension correspondingly.

Longer-term, I imagine there also can be perf concerns:

  • assuming you're doing annotations in an active room - most of the messages would be irrelevant and there would be many of them
  • so loading all the messages (to get to all annotations) in the room becomes slow.
  • need to see if one can adjust filter to query only for relevant events.

Stvad added a commit to Stvad/matrix-highlight that referenced this issue Jan 9, 2023
Stvad added a commit to Stvad/matrix-highlight that referenced this issue Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants