Skip to content

fix(web): make the file lightbox a real scrim viewer#623

Merged
gbasin merged 1 commit into
masterfrom
fix/lightbox-scrim-viewer
Jul 21, 2026
Merged

fix(web): make the file lightbox a real scrim viewer#623
gbasin merged 1 commit into
masterfrom
fix/lightbox-scrim-viewer

Conversation

@gbasin

@gbasin gbasin commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Problem

The file preview overlay didn't feel like a lightbox: it was a solid full-screen page, documents sat left-aligned with a dead right half, the mouse wheel only scrolled when directly over the text, and previews taller than the window couldn't scroll at all on desktop.

Root causes:

  • The renderer root didn't stretch inside the flex preview section, so content sized to itself and stuck left (mx-auto had no room to work) and the scroll container was only content-wide.
  • md:grid-rows-none left the desktop grid row auto-sized, so tall content grew the row past the viewport instead of scrolling — the scroll container never overflowed.

Change

Drive/Slack-style scrim viewer (shared Lightbox, so it applies to /files, chat attachments, quote cards, and unfurls alike):

  • Root is a dimmed, blurred scrim over the page; header controls, nav arrows, and the zoom/pager pills float on it as dark glass (fixed colors — theme tokens invert in light mode and would be unreadable on the scrim).
  • Renderers stretch to the full section and mark their empty margins with data-lightbox-backdrop: the wheel scrolls from the side gutters, and a stationary click there closes the lightbox (pans, text-selection drags, and scrollbar clicks are filtered out).
  • Text-like content renders as a centered paper card: markdown/notebooks at reading width, code/CSV/JSON in wider cards; images/video center fit-to-view with a shadow; PDF pages float on the scrim with a glass pager; edit/conflict modes keep a solid work surface.
  • Desktop grid row fixed to minmax(0,1fr) so tall previews actually scroll.
  • Filmstrip and info/history panels intentionally unchanged.

Validation

  • pnpm check green; pnpm e2e 119/120 with one unrelated flake (message-action-sheet overflow popover) that passes in isolation.
  • Browser-QA'd against a built preview: centering geometry, gutter wheel-scroll, scrim-click close, Esc, image zoom pill, filmstrip nav.

The preview overlay was a solid full-screen page: the renderer root did
not stretch inside the flex section, so documents sat left-aligned with
a dead right half, the wheel only scrolled directly over the text, and
nothing about it read as a lightbox.

- Root is now a dimmed blurred scrim over the page; header controls,
  nav arrows, and zoom/pager pills float on it as dark glass.
- Renderers stretch to the full section and mark their empty margins
  with data-lightbox-backdrop: the wheel scrolls from the gutters, and
  a stationary click there (drags, pans, and scrollbar hits are
  filtered) dismisses the lightbox.
- Text-like content renders as a centered paper card: markdown/notebook
  at reading width, code/CSV/JSON in wider cards, media fit-to-view
  with a shadow; edit/conflict modes keep a solid work surface.
- Fix the desktop grid row (md:grid-rows-none -> minmax(0,1fr)): tall
  content used to grow the row past the viewport, so previews taller
  than the window could not scroll at all.
@gbasin
gbasin enabled auto-merge July 21, 2026 00:37
@gbasin
gbasin added this pull request to the merge queue Jul 21, 2026
Merged via the queue into master with commit e735bde Jul 21, 2026
18 checks passed
@gbasin
gbasin deleted the fix/lightbox-scrim-viewer branch July 21, 2026 01:00
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

Successfully merging this pull request may close these issues.

1 participant