Repository navigation
fix(sidebar): let folder bodies shrink to the lane after overflow: clip - #14579
chenmingwei23 wants to merge 1 commit into
Conversation
…: clip change FolderBody's inner box clips with overflow: clip so pinned folder headers stick to the sidebar lane. A clip box is not a scroll container, so its automatic minimum width is the widest unbreakable line inside it: one long session title widens the folder body, its block and the sidebar, pushing every folder row's count, menu and add button past the lane's right edge and stopping the sidebar from being narrowed. min-width: 0 clamps the box to its grid column again, the same way min-height: 0 keeps the 0fr collapse working.
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify a long-title sidebar in the real dashboard — the Chromium numbers come from a standalone reproduction, not the app itself. Suggestions
[DESIGN-REVIEWED] 7d92285 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the fix in the real sidebar, not just the standalone reproduction — the author's Chromium measurement was a 300px mock, and the passing Playwright spec measures height only. What this change shipsInventory (2 items) — 2 justifiedIntent: restore the sidebar folder rows' ellipsizing and trailing controls, which #14099's
The fix sits at cause level within scope: the box whose automatic minimum width changed is the box that gets the explicit 0, exactly mirroring the [FIRST-PRINCIPLES-REVIEWED] 7d92285 |
UX Review (Fable 5) — ✅ PASSUX-level review of UX-Verdict: PASS Verify in the running sidebar that long session titles ellipsize and the folder-row count/menu/add buttons return; the PR proves the fix only in a standalone reproduction. [UX-REVIEWED] 7d92285 |
Opus 5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Problem / Motivation
Goal: Every folder row in the Sessions sidebar shows its count, menu and add button again, and the sidebar can be narrowed.
Since #14099 landed on main, one long session title makes the whole sidebar wider than its pane: every folder row's session count, kebab menu and add button sit past the lane's right edge, session cards are cut off, and dragging the sidebar narrower does nothing.
Why it matters
The folder row cluster is the only way to rename, sort, hide or add to a folder from the sidebar, and the lane is unreadable when its rows are wider than the pane. Any workspace with a single long session title loses the whole cluster; a dashboard used for crew work has many.
Not a goal
What changed (motivation → approach → change)
Symptom: after #14099 the sidebar overflows horizontally and the folder row's trailing cluster is off-screen.
Root cause: #14099 switched the inner box of
FolderBodyfromoverflow: hiddentooverflow: clipso a pinned folder header sticks to the sidebar lane instead of to that box. Aclipbox is not a scroll container, so its automatic minimum width is no longer 0 but the widest unbreakable line inside it. A session title iswhite-space: nowrapand only ellipsizes when its row can shrink, so one long title widens the folder body, the folder block above it and the sidebar itself, and every row's trailing cluster lands off-screen. The same commit already addedmin-height: 0to that box for the same reason on the vertical axis (aclipbox would also stop collapsing to the0frtrack).Change:
website/src/components/FolderBody.tsxaddsmin-width: 0besidemin-height: 0, so the box clamps to its grid column again and rows ellipsize as before.Standalone reproduction, a 300px sidebar holding one long title, measured in Chromium:
overflow: hidden(before #14099)overflow: clip(main)overflow: clip+min-width: 0(this PR)Backwards compatibility
Compatible: one added CSS declaration on an internal layout box; nothing main accepts is rejected, renamed or removed.
Tests
website/src/test/ChatSidebar.collapsedFolderGhostHeight.test.tsxpinsmin-width: 0on the inner box next to the existingoverflow: clipandmin-height: 0pins. Mutation checked: removing the declaration makes that assertion fail.vitest runonChatSidebar.collapsedFolderGhostHeight,ChatSidebar.stickyHeaderCollision,ChatSidebar.emptyFolderNoBody,ChatSidebar.folderAlignment: 4 files, 26 tests passed.Manual verification
Chromium measurement of the reproduction table above, plus the screenshots below from a pod running this branch.
Screenshots / video
Both shots are the Sessions lane of an isolated gateway built from this branch's tree (default theme, 260px lane), seeded with nested folders and one long session title.
Before (main,
overflow: clipalone): theossandcommand barfolder rows have lost their count and trailing buttons, and every title runs past the lane's edge without an ellipsis.After (this PR): each folder row shows its count at the lane's edge, titles ellipsize.
Measured in the same run: the
ossandcommand barrows' right edge sat 727px past the lane before, and 9px inside it after (matching every other row).Related Issues
Regression from #14099.
Pattern harvest
Rule candidate: review-prompt
Pattern: switching
overflow: hiddentooverflow: clip(or removing a scroll container) on a flex or grid child changes its automatic minimum size on BOTH axes; checkmin-width/min-heighttogether.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)