Repository navigation
Conversation
They do not |
I was under the impression they did, but see now that they don't. I will try to fix this. |
There was a problem hiding this comment.
What's going on with this change?
There was a problem hiding this comment.
Ah sorry, seems to be the result of prettier write. I didn't change anything.
t3chguy
left a comment
There was a problem hiding this comment.
Would be good if you could include some screenshots so design can review it
| onPrev?(): void; | ||
| onNext?(): void; | ||
| hasPrev?: boolean; | ||
| hasNext?: boolean; |
There was a problem hiding this comment.
Can these booleans not be implied by the presence of onPrev/onNext respectively?
Need doc comments also
There was a problem hiding this comment.
Yes we can do without them. We could keep them internally in NavigableImageViewDialog but not forward them as props like so:
onPrev={hasPrev ? onPrev : undefined}
onNext={hasNext ? onNext : undefined}
There was a problem hiding this comment.
Why not just build params for NavigableImageviewDialog here instead? Otherwise half the params get discard, e.g. params.src
| @@ -0,0 +1,293 @@ | |||
| /* | |||
| Copyright 2026 | |||
There was a problem hiding this comment.
What is the convention to put there? My name? Element?
|
|
||
| useEffect(() => { | ||
| let cancelled = false; | ||
| const controller = new AbortController(); |
There was a problem hiding this comment.
This controller doesn't seem to be used for anything?
There was a problem hiding this comment.
Thx. I will remove it. Was left over from trying to fix a bug where backpagination lost its place in the timeline. I added a more robust (I hope) of paginateBackwards.
| @@ -0,0 +1,190 @@ | |||
| /* | |||
| Copyright 2026 | |||
| if (!ev || ev.isRedacted()) return false; | ||
| if (ev.getType() !== EventType.RoomMessage) return false; | ||
| const c = ev.getContent<ImageContent>(); | ||
| return c?.msgtype === MsgType.Image; |
There was a problem hiding this comment.
I'm not sure this is sufficient, given some image events aren't rendered as image events for security, e.g. ones which lie about their mimetype. Iirc you need to check if the renderer for the event would be MImageBody instead.
There was a problem hiding this comment.
I agree. I now model the behaviour from MImageBody.render(). Events that will not be rendered as an image shouldnt be navigated as one.
There was a problem hiding this comment.
Yes good spot, feel free to extract the logic to share it. I was wrong that checking the renderer alone was sufficient.
|
This PR also seems to break rendering of SVGs. Screen.Recording.2026-02-05.at.16.13.01.movpoor video, but I switch tabs to a develop build and it works fine half way through |
Ooh good catch, that's not good of course. But I think it works now. The dialog swapped the src to an unrenderable blob URL. My test svgs now render fine. I will upload the fix tomorrow. |
…est for ImageView to increase coverage
| /*hasPrev?: boolean; | ||
| hasNext?: boolean;*/ |
There was a problem hiding this comment.
Please don't leave commented code, it adds no value
|
I don't see any way how this PR interferes with the wysiwyg_composer test... |
|
That test is flaky, as documented in #31227 |
|
@Snamhdaen hey 👋 Looks like this is close? Would you be able to solve the merge conflicts & slightly improve upon the test coverage. |
Will be able to work on this in the coming days. |
There was a problem hiding this comment.
Hi thanks very much for the contribution.
1/ Currently you are displaying the Next/Back buttons over the image. I wonder if instead, we could display them so not over the image. In the case of a timeline lightbox, the buttons should appear on either side (outside) of the image.
2/ The buttons being used are not quite right especially in terms of contrast and size. Could we use Quick Action Large buttons Dark Theme instead ? https://compound.element.io/?path=/docs/compound-web_button-actions--docs
3/ Could we have the tooltips to read: Left button = Previous / Right button = Next
|
Since it's been 2 months since we've heard from the contributor and 28 days since Gaelle's review, I think this one is stale unfortunately.As always, code is here if someone has the motivation to pick it up. |
Per suggestion by t3chguy in original PR element-hq#31932 (comment)
Move navigation buttons beside the image, preserve focus at boundaries, and disable navigation during pagination. Reset zoom, rotation, and panning when the image changes. Addresses gaelledel's design review (points 1 and 2) on element-hq#31932.
|
I've updated @Snamhdaen's PR, implemented changes fromt the review, and opened a new PR #35507. |



Checklist
public/exportedsymbols have accurate TSDoc documentation.I tried my hand at #337
I don't really know whether the handling of media sorting I did here is what you want, please advise.