Repository navigation
Description
Context
vh is the large viewport. In a phone browser tab with the toolbar showing, a 60vh cap is 60% of a height the user cannot currently see, so capped panels run under the browser chrome. The kit has already settled on dynamic units: overlay caps are written in dvh (docs/decisions/design-kit/overlays.md:23, :64; packages/ui-kit/src/tokens.css:2384, :2451, :2471). The phone handoff sheet uses 92dvh too (packages/ui-react/src/components/chat/handoff-sheet.tsx:344). But 18 vh values on 17 lines in 13 files remain:
| File | Line | Value |
|---|---|---|
packages/ui-kit/src/internal/sheet-dialog.tsx |
45 | min(60vh, 520px) |
packages/ui-kit/src/chrome/ModelPicker.tsx |
72 | calc(85vh - 90px) / 72vh |
packages/ui-kit/src/chrome/ModelPicker.tsx |
75 | 30vh |
packages/ui-kit/src/chrome/ModelPicker.tsx |
158 | 80vh |
packages/ui-kit/src/tokens.css |
2308 | .bk-follow-up-box min(50vh, 320px) |
packages/ui-react/src/theme.css |
760-761 | dictation sheet 40vh/60vh (comment at 755) |
packages/ui-react/src/components/voice/dictation-sheet.tsx |
167 | max-h-[min(60vh,32rem)] |
packages/ui-react/src/components/voice/recordings-tray.tsx |
103 | maxHeight: "40vh" |
packages/ui-react/src/components/files/file-panel.tsx |
160 | max-h-[45vh] |
packages/ui-react/src/components/files/file-viewer-binary.tsx |
69, 107 | max-h-[70vh] |
packages/ui-react/src/components/chat/turn-journal.tsx |
150 | max-h-[60vh] |
packages/ui-react/src/components/chat/journal-coverage.tsx |
32 | maxHeight: "50vh" |
packages/ui-react/src/components/activity/activity-run-detail.tsx |
238 | max-h-[60vh] |
packages/ui-react/src/components/report/diagnostic-review.tsx |
179 | max-h-[60vh] |
packages/ui-react/src/components/chat/handoff-sheet.tsx |
344 | min(86vh, 760px) (pointer branch) |
Guide css/responsive-design: "Use dynamic viewport units (dvh, dvw) instead of vh/vw to prevent layout breakage when mobile browser UI elements (like address bars) appear or disappear."
Support: Chrome Android 108, Samsung 21, Firefox Android 101 (MDN browser-compat-data). All targets have it, so no fallback is needed.
Scope
- Replace every
vhin the table withdvh, keeping each number and eachmin()/calc()around it. This includes the pointer-only and desktop branches, so that one rule holds everywhere. - Update the dictation comment at
theme.css:755to match.
Out of scope
vwvalues (for exampleModelPicker.tsx:158100vw).- Changing any cap's size, or switching to
svh. - Host viewport meta (
interactive-widget). That is shell: the on-screen keyboard overlays sheets and the composer instead of resizing the page brain-hosting-template#38 (split out of scrape: attribute-tolerant JSON-LD extraction and a shared JobPosting mapper #34 on 2026-10-24), which is not a blocker. - Tests and stories that use
vhfor scaffolding.
Acceptance criteria
-
grep -rnoE '(^|[^a-z0-9.])[0-9.]+vh\b' packages/ui-kit/src packages/ui-react/srcprints nothing. Before the change it prints the lines in the table. - A unit test in the style of
packages/ui-react/tests/copy-button-css.test.tsscanspackages/ui-kit/srcandpackages/ui-react/srcand fails, naming file and line, on anyvhlength outside comments. It fails on the tree before the change and passes after. This rule is static, so a predicate test is the right proof. A headless browser cannot fail-first here: without a dynamic toolbar,vhanddvhresolve the same. - Curated visual baselines are unchanged, for the same reason. The PR shows a
bun run visualpass.
Verification
grep -rnoE '(^|[^a-z0-9.])[0-9.]+vh\b' packages/ui-kit/src packages/ui-react/src
bun run visual
bun run test
bun run typecheck
bun run lintContract impact
- This touches the integration contract, so it needs the
contractlabel, aCONTRACT:commit prefix, and the doc updated in the same commit. - This changes a published package's behaviour, so it needs a changeset.
@schlessera/brain-ui-kit and @schlessera/brain-ui-react: patch.
2026-10-24: the keyboard viewport meta moved from brain-hosting-template#34 to the new brain-hosting-template#38; reference updated.
Activity