Repository navigation
fix(site/src/pages/AgentsPage/components): keep an open lightbox through the turn's fold - #31139
Closed
ibetitsmike wants to merge 3 commits into
Closed
ibetitsmike wants to merge 3 commits into
ibetitsmike wants to merge 3 commits into
Conversation
…ugh the turn's fold A lightbox kept its open state in the component that opened it. When a turn ended, its fold collapsed and unmounted that component, so an image, text file, recording, or diagram the reader had opened from the turn closed. LightboxHost now renders the lightbox above the timeline rows, and the openers open it through useLightbox. Outside a host, useLightbox renders the lightbox in place, as before. Only one lightbox opens at a time. VideoLightbox now uses the shared Lightbox, so it unmounts on close like the other lightboxes and no longer fades out.
…e Markdown preview that holds the lightbox host
…t that the timeline host makes unused
Collaborator
Author
|
Folded into #30656: its single commit, rebased onto
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #31138.
An image, text file, recording, or Mermaid diagram lightbox kept its open state in the component that opened it. When a turn ended, its fold unmounted that component, so the open lightbox closed under the reader, and a recording stopped playing.
Lightboxes opened from the timeline now render in a
LightboxHostabove its rows, so they stay open through the fold. The openers (attachment previews in messages, tool result images, recordings, and Mermaid diagrams) open them throughuseLightbox; outside a host, they keep the lightbox themselves, as before. One lightbox opens at a time, so a text attachment preview whose fetch finishes after the reader opened another lightbox is dropped instead of stacking a second dialog on it. A Markdown text preview has a host of its own, so a diagram in it still opens over the preview.Review notes
ConversationTimeline.tsxonly re-indent the timeline items under<LightboxHost>. With whitespace hidden, the PR is 309 changed lines instead of 473.VideoLightboxnow uses the sharedLightbox, which unmounts on close like the image and diagram lightboxes. It drops itsopenprop (its stories dropopen: true) and its exit fade, andRecordingPreviewdrops the key it bumped to reset the video's error state, since each open now mounts a newVideoLightbox.main: Radix returns focus only to aDialog.Trigger, which these openers are not, and only the Mermaid lightbox focuses its trigger itself. When the fold has unmounted the trigger, closing the lightbox leaves focus on the page body.f98de842ebc:frontend-deep-reviewpasses all eight roles after three rounds, the test audit passes, andfrontend-reviewFE1 to FE10 pass. The pre-commit hook, the unit tests insrc/pages/AgentsPage,src/vendor, andsrc/testHelpers(the only failures are inProjectChatsList.test.tsx, which fails the same way without this PR), and the story tests of the ChatConversation folder and the changed lightbox components pass. Each new test fails without its fix: the image test without the timeline's host, the late text preview test when a late open replaces the open lightbox, and the diagram test without the Markdown preview's own host.