Skip to content

fix(web): sheets and drawers no longer collapse when the page reads as off screen - #920

Merged
badcuban merged 1 commit into
mainfrom
fix/panels-collapse-after-fold
Nov 14, 2026
Merged

badcuban merged 1 commit into
mainfrom
fix/panels-collapse-after-fold

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

The problem

On an iPhone Duo (a folding iPhone, here on a developer beta of iOS), going from the open screen to the folded one sometimes left the thread list and the right panel "transparent": their fixed-size rows stacked with nothing behind them and the scrolling part gone. Closing the panel and opening it again cleared it.

The panels were not see-through. They had collapsed to no height. Sheets, drawers and dialogs pad themselves above an on-screen keyboard by comparing the visual viewport with the window. Feeding the app a visual viewport of about no height reproduces both reported screenshots exactly: the padding takes the whole window.

The best explanation, not measured on the phone, is that iOS reports that for a moment while the page moves between the two screens, and sends no resize event when the reading recovers.

The fix

  • A visual viewport under a tenth of the window's height is not read as a keyboard.
  • The keyboard readings are taken again on the window's own resize, not only on the visual viewport's events.

Also swaps three calc() offsets for a plain offset plus a margin (image viewer arrows, both find bars). Same geometry, fewer startup CSS bytes: main sits about 150 B under the startup size budget, and this change measures about 45 B over main locally. If the size check trips, #916 (the browser panel's code out of web startup, about 22 KB) clears it.

Checked

  • vp fmt, vp lint, vp run typecheck
  • Web unit tests and the full browser suite (1060), with three new browser tests. The two that cover the collapse fail with the fix turned off.
  • In Chromium at the Duo's folded size, with the visual viewport's height faked to 12px: both panels collapse before, open whole after.

Not checked

  • A real iPhone Duo. The cause on the phone is inferred from two screenshots and the reproduction above.
  • A stale reading that is wrong but plausible (a few hundred px short) is not caught by the tenth-of-the-window rule; only the next window resize corrects it.

…s off screen

On an iPhone Duo, going from the open screen to the folded one could
leave the thread list and the right panel squeezed to no height: their
fixed-size rows stacked with nothing behind them, until the panel was
closed and opened again.

Sheets, drawers and dialogs pad themselves above an on-screen keyboard
by comparing the visual viewport with the window. Feeding a visual
viewport of about no height reproduces the reported state exactly: the
padding takes the whole window. The best explanation, not measured on
the phone, is that iOS reports that for a moment while the page moves
between the two screens and sends no resize event when it recovers.

- A visual viewport under a tenth of the window's height is not read
  as a keyboard.
- The keyboard readings are taken again on the window's own resize,
  not only on the visual viewport's events.

Also swaps three calc() offsets for a plain offset plus a margin (image
viewer arrows, both find bars): same geometry, fewer startup CSS bytes,
since main sits about 150 B under the startup size budget.
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 14, 2026 7:13pm UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 40c989c Nov 14, 2026
24 checks passed
@badcuban
badcuban deleted the fix/panels-collapse-after-fold branch November 14, 2026 19:29

This branch was previously deployed

1 inactive deployment
Preview — 6a797fe0 Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant