Skip to content

fix(desktop): contain scrolling in the app shell - #105

Closed
mlubbad wants to merge 2 commits into
mainfrom
fix/desktop-app-shell-scroll-containment
Closed

mlubbad wants to merge 2 commits into
mainfrom
fix/desktop-app-shell-scroll-containment

Conversation

@mlubbad

@mlubbad mlubbad commented Jul 25, 2026

Copy link
Copy Markdown
Owner

The bug

The chat surface could grow a second, document-level scrollbar beside the transcript's own, and scrolling it slid the whole app up so transcript content ran underneath the composer.

Root cause

The shell was height: 100vh with html / body / #root never sized or clipped, and .app / .chat-col / .transcript missing min-height: 0.

A flex item defaults to min-height: auto and refuses to shrink past its content. So once the topbar + composer no longer fit, the overflow didn't go into the transcript's scroller — it escaped to the document.

The harness WorkspaceBar (#102 / #103) adds ~56px to the footer, which moved the break point from ~260px of viewport height to ~340px, close enough to real windows to start biting. Tauri's minHeight: 500 masks it in the packaged app; the dev browser at :1420 has no such floor.

Changes — all in desktop/src/styles.css

  • Lock the document. html, body, #root { height: 100% } and html, body { overflow: hidden; overscroll-behavior: none }. This is an app shell, not a page — only regions that opt in (transcript, sidebar recents, panel bodies) scroll. overscroll-behavior also kills rubber-banding, which reads as a bug in a desktop app.
  • .app-shell uses height: 100%, not 100vh. 100vh ignores a horizontal scrollbar and any surrounding chrome, so it overshoots by exactly the amount that used to leak out as page scroll.
  • min-height: 0 on .app, .workarea, .chat-col, .transcript.
  • .footer { flex: none } and deliberately no overflow on it. The tools / slash / model popovers are absolutely positioned and open upward out of that box — a scroll container there would clip them. The transcript above does the yielding instead.
  • @media (max-height: 560px) compacts the footer's optional chrome (hides the footer note, tightens padding, caps the textarea) so the composer never needs to escape in a short window.
  • .hero centred via margin: auto on .hero-inner, not align-items: center. A centred item that outgrows its scroll container overflows in both directions and its top can never be scrolled back to. The document scroll used to rescue that, so locking the document without this change would have made the greeting unreachable below ~380px of height.

Verification

Headless viewport sweep against the dev server, measuring documentElement.scrollHeight − clientHeight:

viewport before after
1280×260 19px vertical (composer 19px below the fold) 0
1280×180 99px vertical 0
1280×220 (workspace bar attached) 115px vertical 0
460×340 106px vertical + 34px horizontal 0
420×300 165px vertical + 55px horizontal 0
380×720 88px horizontal 0

Popovers re-checked live after the clip was added — model mega-menu, conversation menu, command palette and settings overlay all render fully inside the viewport, unclipped. Hero top confirmed reachable at 320px height.

npm run test 408/408 across 64 files · npm run typecheck clean · npm run build succeeds.

Each load-bearing rule is pinned as a text assertion in styles.contract.test.ts (new describe block, written failing first), so a future edit that drops one fails CI rather than silently reintroducing the bug.

Known limitation, not addressed here

Below ~520px width the layout is now clipped rather than horizontally scrollable: the sidebar is a fixed 264px with no responsive collapse, so it plus the composer's minimum width can't fit. Tauri's minWidth: 720 means the packaged app never reaches this — only a dev browser does. A proper fix is collapsing the sidebar to icons below ~700px with a toggle, which is a feature rather than part of this fix.

🤖 Generated with Claude Code

mlubbad and others added 2 commits July 25, 2026 17:15
The chat surface could grow a second, document-level scrollbar beside the
transcript's own, and scrolling it slid the whole app up so transcript content
ran underneath the composer.

Root cause: the shell was `height: 100vh` with html/body/#root never sized or
clipped, and `.app` / `.chat-col` / `.transcript` missing `min-height: 0`. A flex
item defaults to `min-height: auto` and refuses to shrink past its content, so
once the topbar + composer no longer fit, the overflow escaped to the document
instead of being absorbed by the transcript's scroller. The harness WorkspaceBar
(#102/#103) adds ~56px to the footer, which moved the break point from ~260px of
viewport height to ~340px — close enough to real windows to start biting. Tauri's
minHeight of 500 masks it in the packaged app; the dev browser has no such floor.

- Lock the document: html/body/#root pinned to 100% with overflow hidden, plus
  overscroll-behavior none (rubber-banding reads as a bug in a desktop app).
- `.app-shell` uses height 100% rather than 100vh, which ignores a horizontal
  scrollbar and overshoots by exactly the amount that used to leak out.
- min-height: 0 on .app, .workarea, .chat-col and .transcript.
- `.footer` is flex: none and deliberately keeps NO overflow of its own — the
  tools / slash / model popovers are absolutely positioned and open upward out of
  that box, so a scroll container there would clip them.
- A max-height: 560px media query compacts the footer's optional chrome so the
  composer never needs to escape in a short window.
- `.hero` centred via margin: auto on .hero-inner instead of align-items: center.
  A centred item that outgrows its scroll container overflows in both directions
  and its top can never be scrolled back to; the document scroll used to rescue
  that, so locking the document without this would have made the greeting
  unreachable below ~380px of height.

Verified with a headless viewport sweep against the dev server: page overflow is
0 in both axes at every size from 1280x720 down to 340x480, where it was
previously up to 165px vertical and 128px horizontal. Each load-bearing rule is
pinned in styles.contract.test.ts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
No code change. The original run (30161364146) was rejected by the runners
before executing a single step — all six jobs finished in ~2s with zero steps
and no logs or annotations, matching unrelated branches that began failing the
same way at 14:13Z on 2026-07-25, ~40 minutes after the last green run in this
repo. That is an account-level Actions block, not a fault in this diff.

GitHub now refuses to re-run that workflow ("created over a month ago"), so a
fresh commit is the only way to produce a new run and get real check results.

The tree is unchanged and still verified locally: styles.contract.test.ts 12/12
and `tsc -b --noEmit` clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mlubbad

mlubbad commented Nov 21, 2026

Copy link
Copy Markdown
Owner Author

Merged and shipped as part of the clean-slate VersoWork v0.1.0 open-source release.

@mlubbad mlubbad closed this Nov 21, 2026
@mlubbad
mlubbad deleted the fix/desktop-app-shell-scroll-containment branch November 21, 2026 20:26
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