Skip to content

fix(site/src/pages/AgentsPage/components): keep an open lightbox through the turn's fold - #31139

Closed
ibetitsmike wants to merge 3 commits into
mike/working-block-fold-focusfrom
mike/working-block-fold-lightbox
Closed

ibetitsmike wants to merge 3 commits into
mike/working-block-fold-focusfrom
mike/working-block-fold-lightbox

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

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 LightboxHost above its rows, so they stay open through the fold. The openers (attachment previews in messages, tool result images, recordings, and Mermaid diagrams) open them through useLightbox; 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
  • About 160 of the changed lines in ConversationTimeline.tsx only re-indent the timeline items under <LightboxHost>. With whitespace hidden, the PR is 309 changed lines instead of 473.
  • VideoLightbox now uses the shared Lightbox, which unmounts on close like the image and diagram lightboxes. It drops its open prop (its stories drop open: true) and its exit fade, and RecordingPreview drops the key it bumped to reset the video's error state, since each open now mounts a new VideoLightbox.
  • Known limits:
    • Focus return on close is unchanged from main: Radix returns focus only to a Dialog.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.
    • The Mermaid lightbox shows the SVG it opened with, so a theme change while it is open does not restyle it.
  • On f98de842ebc: frontend-deep-review passes all eight roles after three rounds, the test audit passes, and frontend-review FE1 to FE10 pass. The pre-commit hook, the unit tests in src/pages/AgentsPage, src/vendor, and src/testHelpers (the only failures are in ProjectChatsList.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.

Xum opened this PR on behalf of @ibetitsmike.

…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
@ibetitsmike
ibetitsmike added this pull request to stack #31026 October 21, 2026 19:00
@ibetitsmike ibetitsmike changed the title mike/working block fold lightbox fix(site/src/pages/AgentsPage/components): keep an open lightbox through the turn's fold Oct 21, 2026
@linear-code

linear-code Bot commented Oct 26, 2026

Copy link
Copy Markdown

CODAGT-1114

@ibetitsmike
ibetitsmike removed this pull request from stack #31026 October 27, 2026 18:58
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Folded into #30656: its single commit, rebased onto main, now carries this change, so review continues there.

Xum closed this PR on behalf of @ibetitsmike.

@github-actions github-actions Bot locked and limited conversation to collaborators Oct 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant