-
-
Notifications
You must be signed in to change notification settings - Fork 829
Clicking jump to bottom resets room hash #5823
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a valuable thing to have, and is a common case, though I'm not sure it's fixing element-hq/element-web#2903 in its entirety. We should probably intercept the click on the permalink and manually do the navigation to avoid relying on browser behaviour if at all possible, or possibly take a look at our dispatcher flow to ensure it's able to send prop updates to the RoomView and such.
I'm happy for this to land as it's own feature, though.
and of course I failed to even mention the alternate case in my comment, sorry: the user can also scroll down without using the button (which is what I do when the message isn't that far down). |
I try in general to favour browser behaviour over JavaScript as they are more resilient and often more accessible. From what I gathered the hash change is picked up in vector-im/element.web
Thank you for sharing that, I failed to identify that use case. That makes me wonder whether we should reset the |
Resetting the hash as soon as the event is displayed would also work. The built-in browser history is something we do offer as a feature as well - does this cause a trap for users who try the back button? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting a bit stringy, sorry. I really think it'd be best to intercept the <a onClick>
instead - the next thing to consider is PgUp/Down keys, arrow key navigation, screen readers, etc. It all gets a bit messy, unfortunately.
I'm still a bit confused as to why we should favour an
I do intercept all those interactions with the newly introduced |
Intercepting the
I haven't tested accessibility tooling, but this sort of jumping/flickering is quite harsh on screen readers and the like. Intercepting the Using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
Sorry that pull request completely fell off my radar. I am using Could you give this another review. We should be able to move this forward! |
Oh no, this has been open long enough for it to land in the wasteland that is the normally untouched part of my review requests :( This is the sort of thing I don't mind being poked about to review sooner. My concern is mostly that we shouldn't have to listen for keyboard navigation, scrolling, etc to reset the hash manually: this is a path where we end up having to support the billion different input methods for accessing the app, and there will always be edge cases. Instead of resetting the hash, we can intercept the onClick manually and do various |
This feels tantalisingly close to fixing this chronic bug. Can we resolve the impasse on whether to onClick or not? I could try to ctxt switch in, but @jryans may be better positioned? |
Apologies, this has admitedly fell off my radar I have spent a bit of time trying to find an alternative approach this morning and it is slightly tricky. The two flags
I believe I moved away from the initial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we talked through this, and this does seem like the best solution we have for now. If the intersection observer stuff ends up working out, we might want to use that, but otherwise this is good to go.
After playing around a bit with the |
Fixes element-hq/element-web#2903
Clicking a matrix.to link jumps a user up to a message sent earlier in the timeline it also transitions the hash url
/#/room/{room-id}
=>/#/room/{room-id}/{event-id}
When clicking the "jump to bottom" button the
event-id
fragment remained in the hash. Transforming that a button to an anchor and making it reset the hash to its original state solved the problem, and permalinks can now be clicked as many time as one likes