Skip to content

fix(desktop): keep the conversation visible in a narrow window - #548

Merged
huichen merged 2 commits into
mainfrom
claude/narrow-layout
Sep 10, 2026
Merged

huichen merged 2 commits into
mainfrom
claude/narrow-layout

Conversation

@huichen

@huichen huichen commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Problem

With a narrow window the conversation area was not fully visible: body { min-width: 1024px } laid the shell out at 1024px inside a narrower window, and since body keeps overflow: hidden there was no way to scroll to the clipped part. Measured on a 900px viewport: body=1024, main right edge at 1024, and the composer (including its send button) 92px past the right edge. Independently, at the 1024px minimum with the context panel open the center pane is exactly its 384px floor — narrower than the composer toolbar needs, so the toolbar's controls ran past the card and overlapped the send button.

Change

  • Drop the CSS width floor (desktop/src/styles/globals.css). The shell now follows the actual viewport.
  • Side panels yield to the conversation (panelGeometry.ts, useWindowWidth.ts, AppShell.tsx): below the three-column floors (608px / 992px) the left rail folds into its existing hover overlay and the right context panel stays closed, instead of squeezing the center past its floor. The user's own collapsed/expanded choice is kept in state, so a panel comes back when the window grows; the rail toggle is a no-op while there is no room, so a click can't silently persist "collapsed".
  • Composer toolbar wraps (Composer.tsx): the model / thinking / send group drops to a second row (ms-auto, right-aligned) with min-w-0 on the triggers so long labels truncate — no overflow or overlap at the 384px floor.

Verification

Rendered the real AppShell in Chrome against a stubbed Tauri IPC (temporary harness, not committed) as sized iframes at 1440 / 1200 / 1024 / 992 / 900 / 700 / 600 / 500px, in both the default and context-panel-open states, and measured the DOM rather than eyeballing screenshots.

viewport before (measured) after
900 body=1024, 25 elements escaping the viewport, composer right edge 92px off-screen, send button not visible body=900, 0 escaping, main right edge = viewport, composer fits
1024 + context panel open center 384px, toolbar 1 row whose tail ran 30px past the card center 384px, toolbar wraps to 2 right-aligned rows, everything inside the card

Screenshots of the 1024px three-column window (context panel open, wrapped composer) and the narrow widths confirmed no clipped or overlapping controls.

npx tsc --noEmit, npx eslint "src/**/*.{ts,tsx}", npx stylelint "src/**/*.css", npx vitest run (91 files / 842 tests, including the new panelGeometry.test.ts) all pass.

Note: tauri.conf.json still declares minWidth: 1024 — this PR makes anything narrower work (Windows snap, zoomed/scaled displays) but doesn't change what the user can drag to. Lowering that minimum is a product decision, so it is left alone.

`body { min-width: 1024px }` laid the shell out at 1024px inside a narrower
window. With `overflow: hidden` that silently clipped the conversation area: at
a 900px window the center pane ended at x=1024 (measured), so its right edge -
including the composer's send button - was 124px off-screen.

- Drop the CSS width floor; the layout follows the actual viewport.
- The side panels now yield to the conversation instead of squeezing it: below
  the three-column floors (608px / 992px) the left rail folds into its hover
  overlay and the right context panel stays closed. The user's own
  collapsed/expanded choice is preserved and comes back with the window.
- The composer toolbar wraps to a second row (model / thinking / send
  right-aligned) instead of overflowing. At the 1024px minimum with the context
  panel open the center is exactly its 384px floor, where the row needed ~383px
  and the controls previously overlapped the send button.

Verified by rendering the real AppShell in a browser against a stubbed Tauri IPC
at 1440/1200/1024/992/900/700/600/500px, with and without the context panel:
every width now reports zero elements escaping the viewport and a composer whose
right edge fits, where the pre-fix build reported body=1024 inside a 900px
window, 25 escaping elements, and the composer 92px off-screen.
@huichen
huichen enabled auto-merge (squash) September 10, 2026 13:46
@huichen
huichen merged commit 27c6a85 into main Sep 10, 2026
12 checks passed
@huichen
huichen deleted the claude/narrow-layout branch September 10, 2026 13:49
huichen added a commit that referenced this pull request Oct 26, 2026
Below the three-column floors (992px) the right panel used to vanish
together with its own toggle, and the panel shortcut went inert with it:
`hideRightPanel` folded `!canShowRightPanel(...)` into the view-based
hides, so a narrow window had no way to reach Files / Runs / Review at
all, and nothing was rendered to open even if it had.

The panel now yields to the conversation without disappearing. Below the
floor it opens as an overlay anchored to the window's right edge, at full
height and out of the row's flow, so the conversation keeps its width
floor instead of being squeezed or clipped (the reason the column was
folded in the first place, #548). The header toggle and `mod+shift+b`
drive the drawer there; a drawer opened in a narrow window is promoted to
the column when the window grows rather than closing under the reader; a
column that no longer fits still folds, and shrinking never pops a drawer
over the conversation uninvited. A remote conversation's files panel gets
the same treatment, since it shares that corner and that state.

Verified by measuring the real shell in the screenshot harness at 900px
(scenario `context-panel-narrow`): the toggle sits at 852..884 of 900, the
opened panel spans 516..900 at full 860px height while `main` stays 644px
wide (unchanged by opening), nothing overflows the window, the panel is
hit-tested above the conversation, and close/reopen returns the toggle.
Column mode at 1280px is unchanged (`review-file-hover`). tsc, eslint and
vitest (5381 desktop tests) pass.
huichen added a commit that referenced this pull request Oct 26, 2026
)

Below the three-column floors (992px) the right panel used to vanish
together with its own toggle, and the panel shortcut went inert with it:
`hideRightPanel` folded `!canShowRightPanel(...)` into the view-based
hides, so a narrow window had no way to reach Files / Runs / Review at
all, and nothing was rendered to open even if it had.

The panel now yields to the conversation without disappearing. Below the
floor it opens as an overlay anchored to the window's right edge, at full
height and out of the row's flow, so the conversation keeps its width
floor instead of being squeezed or clipped (the reason the column was
folded in the first place, #548). The header toggle and `mod+shift+b`
drive the drawer there; a drawer opened in a narrow window is promoted to
the column when the window grows rather than closing under the reader; a
column that no longer fits still folds, and shrinking never pops a drawer
over the conversation uninvited. A remote conversation's files panel gets
the same treatment, since it shares that corner and that state.

Verified by measuring the real shell in the screenshot harness at 900px
(scenario `context-panel-narrow`): the toggle sits at 852..884 of 900, the
opened panel spans 516..900 at full 860px height while `main` stays 644px
wide (unchanged by opening), nothing overflows the window, the panel is
hit-tested above the conversation, and close/reopen returns the toggle.
Column mode at 1280px is unchanged (`review-file-hover`). tsc, eslint and
vitest (5381 desktop tests) pass.
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