Skip to content

perf(workArea): contain each pane and the primary Chat column - #288

Merged
orbitingflea merged 1 commit into
proto/fullscreen-panelsfrom
feat/fullscreen-panels-pane-containment
Nov 24, 2026
Merged

orbitingflea merged 1 commit into
proto/fullscreen-panelsfrom
feat/fullscreen-panels-pane-containment

Conversation

@orbitingflea

@orbitingflea orbitingflea commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Why

Keep layout work inside whichever split pane changes, or the primary Chat column when it changes, during Chat streaming, a diff view, or PDF zoom. Popovers, tooltips, menus, dialogs, and drag overlays must stay unclipped and in place.

Behaviour change

Behaviour change: no
Users see the same pixels and interactions. Only browser layout scope changes.

What changed

  • WorkArea.tsx gives each pane Tailwind classes contain-size contain-layout any-pointer-coarse:has-[[data-file-browser-panel]]:contain-none (contain: size layout, except a Files tree pane on a touch screen).
  • useWorkAreaChat.ts adds contain-size contain-layout to PANE_COLUMN_CLASS and to the hidden AWAY placement of the primary Chat column.
  • WorkArea.browser.test.tsx adds two Chromium tests.

Scope

Three fork-only files in apps/web/src/fork/workArea/ change. Upstream files are unchanged.

Tradeoffs

On touch devices, a Files tree pane, including a file view with its explorer open, stays uncontained so its touch drag preview is not shifted. Other options lack isolation, clip overflow, or edit upstream files.

Blast Radius

Only work-area files change. Base UI popovers, tooltips, menus, dialogs, and toasts, plus the drop outline, dragged tab chip, and drag shield, already render in document.body outside panes.

Verification

Chromium UI, nine-view, and trace checks pass. Existing work-area browser tests and changed-files format, lint, knip, typecheck, tests, and React compiler checks pass.

Details

Size and stacking

In Chromium, contain: layout needs size containment for a relayout boundary. Panes and the primary Chat column get left, top, width, and height from split ratios, not content, so contain: size layout changes no box. Containment uses Tailwind classes so it applies only with the pane's position and size classes; tests rendered without the app stylesheet see no containment. The primary Chat column renders outside the pane DOM over the empty Chat slot, so it needs containment too. Its hidden AWAY placement is style-sized, so streaming stays contained. Each contained pane is a stacking context, so z-index inside it orders only its content.

Touch exemption and options

Layout containment makes a pane the containing block for position: fixed descendants. The @pierre/trees Files tree draws its touch drag preview as position: fixed in viewport coordinates, so containment shifts it by the pane origin. Mouse drag uses that node only as a browser drag image in its own coordinate space, so only @media (any-pointer: coarse) is exempt.

  • contain: layout style and contain: content make no relayout boundary in Chromium.
  • contain: strict adds paint containment, clips overflow, and gives no measurable extra benefit.
  • Fixed pixel sizes with overflow: clip avoid position: fixed, need a resize observer, risk a one-frame stale size on resize, and clip visible overflow.
  • Containing only the file body beside the Files tree needs a wrapper in an upstream file.

Verification

  • The test "starts every layout at a contained box while the primary Chat streams beside another pane" lays out pending work before tracing and reads the streamed paragraph box in the trace. A second test checks that the Files tree touch drag preview stays under the finger in an offset pane on an emulated touch screen.
  • Three-pane desktop and narrow strip Chromium checks ran with containment on and forced off. The pane add menu, tab context menu, composer model picker, tooltip, and drop outline stay on screen outside contained elements; the first three take center and corner pointer hits, the last two none by design. A screenshot shows the dragged tab chip whole across the sidebar and pane edge.
  • At rest and during tab drag, only hidden position: fixed nodes sit in a contained pane (Base UI focus guards while a popup is open, and the Diff view select input). Keyboard focus order and scrolling match. Screenshots match except anti-aliasing noise on one gradient button.
  • Nine views (preview, device, terminal, diff, pull requests, dashboard, whiteboard, replies, file) matched hit-testing, boxes, and scrolling on both layouts with and without containment. Desktop window dragging from tab-bar drag areas matched.
  • Chromium traces for Chat streaming and PDF zoom with the file explorer open show layout starts in the contained box, not the document. Layout work per frame drops, with no other measurable pipeline change.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for f3c2dba.

This comment will update automatically after the next completed run.

@orbitingflea
orbitingflea force-pushed the feat/fullscreen-panels-pane-containment branch from fe6fc8a to 71881db Compare November 24, 2026 15:55
Give work-area panes and the primary Chat column `contain: size layout`,
so a layout change inside one (a streaming Chat, a diff, a PDF) starts at
that box instead of the document. Both boxes are sized by their style, so
size containment changes no rect. The pane gets it as Tailwind classes, so
it applies only with the classes that position and size the pane. On
touch screens a pane holding the Files tree is left uncontained: the
tree's touch drag preview is fixed at viewport coordinates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@orbitingflea
orbitingflea force-pushed the feat/fullscreen-panels-pane-containment branch from 71881db to f3c2dba Compare November 24, 2026 16:33
@github-actions github-actions Bot added size:XS and removed size:S labels Nov 24, 2026
@orbitingflea
orbitingflea merged commit b44d3c3 into proto/fullscreen-panels Nov 24, 2026
23 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant