Repository navigation
fix(dashboard): clamp every stored sidebar width to fit a narrow window - #16183
dodgeblaster wants to merge 1 commit into
Conversation
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The rescue drag has a dead zone: grabbing the now-reachable handle moves nothing for up to ~516px of travel before the sidebar responds. Watch
[UX-REVIEWED] e9e5e8b Description read[DESCRIPTION-READ] 8e30a3ee9b614abd2fa81bba7321e7407a16bc72e0aab9dba7e612ecb2121f12 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
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) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Description documents an earlier design: no default Watch
[DESIGN-REVIEWED] e9e5e8b Description read[DESCRIPTION-READ] e221f71d89a107f798991d8794d484acda3452578d3ac60c218e4ecd83767505 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS Description claims "the default Not justified as shipped
What this change shipsInventory (8 items) — 3 justifiedIntent: a sidebar width saved on a wide window must not overhang a narrower one — the chat pane stays usable and the resize handle grabbable. FIX (#16094, reproduce pinned by tests failing on base).
[FIRST-PRINCIPLES-REVIEWED] e9e5e8b Description read[DESCRIPTION-READ] 7ba336133256d34150508727a485f9c87065078e68d09ea0c923230e6379c514 That sha256 names the PR description this verdict read. Recompute it with |
71c9425 to
c509d07
Compare
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsNothing blocks; the new FINDING — website/src/pages/ChatSidebar.tsx:4428 — the root now paints FINDING — website/src/pages/ChatSidebar.tsx:4423 — [OPUS-REVIEWED] e9e5e8b Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
c509d07 to
fc88cd6
Compare
…n list view A stored session-sidebar width is validated only against SIDEBAR_MIN..SIDEBAR_MAX, so a width saved on a wide window is carried verbatim onto a narrow one. In list/chat view the sidebar reserved nothing for the chat pane, so a stored width up to SIDEBAR_MAX overhung: the chat pane dropped below CHAT_PANE_MIN_W and the resize handle landed at or past the window edge, out of reach. clampSidebarWidth takes a required chatReserve. ChatPage passes CHAT_PANE_MIN_W in list view and 0 in board view, deciding which from ChatSidebar's own boardLaneActive (feature on AND columns exist, lifted up via onBoardActiveChange) so the clamp and the rendered lane never disagree and there is one source of truth. The clamped effectiveSidebarWidth is passed down to ChatSidebar as paintWidth, so the inner sidebar paints to the same edge as the OverlayDrawer instead of overflowing it with the raw stored width. The board column strip keeps its full width (reserve 0), preserving the geometry commit 9406a36 restored. Closes #16094
fc88cd6 to
e9e5e8b
Compare
|
Rebased onto fresh main and pushed the review repair: the chat-pane reserve is now gated on ChatSidebar's own boardLaneActive (lifted via onBoardActiveChange, one source of truth — no cold-query flash, feature-on-but-zero-columns correctly stays list), and the clamped width is passed down as paintWidth so the inner sidebar and the OverlayDrawer paint to the same edge. Board view keeps reserve 0. CI re-running. |
|
Automated rebase attempt onto Conflicting files:
This is a semantic conflict, not a textual one. #14870 (
This PR adds a required |
|
Closing this draft as part of a stale-PR cleanup: it has had no activity for 14+ days. Nothing is lost: the branch stays, and you can reopen this PR anytime (or open a fresh one rebased on main). Thanks for the work here! |
Problem / Motivation
Goal: A session-sidebar width saved on a wide window never overhangs a narrower one — the chat pane stays usable and the resize handle stays reachable.
On a window where (width − nav rail − chat-pane minimum) is under 1400px — a 1440px window with the rail expanded, for example — a stored sidebar width of up to 1400px painted exactly as stored. The sidebar then overhung: the chat pane dropped below its minimum and the handle on the sidebar's right edge sat at or past the window edge, so the user could not grab it to narrow the sidebar again.
Why it matters
A user who sets a wide sidebar on a big monitor and later opens the dashboard on a laptop is stuck with a sidebar they cannot shrink — the one control that would fix it is off-screen. Two adjacent preferences also behaved differently: a saved 2884 was already held gracefully, while a saved 1400 overhung, because the earlier hold skipped widths of 1400 or less.
Not a goal
What changed (motivation → approach → change)
A stored width is validated only against the sidebar's own min/max, never the window, so a width from a wide window arrives verbatim on a narrow one. The paint-time clamp (
clampSidebarWidthinwebsite/src/pages/chat/sidebarWidth.ts) narrowed that width to the room beside the nav rail but reserved nothing for the chat pane — so the sidebar could take the whole width left over, pushing the chat below its minimum and the handle off the edge.The clamp now keeps a chat-pane reserve clear beside the rail, applied to every stored width and floored at
SIDEBAR_MIN;website/src/pages/ChatPage.tsxpassesCHAT_PANE_MIN_W. On a window too narrow to seat both the reserve and the floor, the sidebar keeps its minimum and the chat pane yields the rest, rather than the sidebar collapsing below where it is usable.The board view's automatic widening already reserves
BOARD_CHAT_RESERVE(≥CHAT_PANE_MIN_W), so a board-widened width already fits this clamp and is never cut — only a hand-dragged width wider than the window can spare is held.Backwards compatibility
Compatible: the clamp affects only render geometry on a window too narrow for the stored width; the persisted preference is unchanged and is painted in full once the window can seat it. The default
chatReserveis 0, soclampSidebarWidth's other callers (the board sidebar) keep their current behavior.Tests
clampSidebarWidth.test.ts: with the chat reserve, a stored 1400 on a 1440px window is clamped to 884 — chat pane ≥CHAT_PANE_MIN_W, handle inside the window — and a saved 1400 and a saved 2884 are now held identically; without a reserve the pre-existing board behavior is unchanged; the floor-at-SIDEBAR_MINcase is pinned.boardSidebarWidth.test.ts: existing board geometry assertions are unchanged, plus a new check that every board auto-widened width survives the chat-pane clamp untouched, so the two never fight.Manual verification
N/A — unit coverage sufficient. The change is a deterministic width calculation whose reproduce case (stored 1400, 1440px window, rail expanded) is asserted directly, including the two symptoms (chat pane below its minimum, handle past the window edge).
Screenshots / video
Why no screenshot: the only rendered change is at window sizes where a stored width would otherwise overhang; the sidebar then paints narrower by exactly the computed clamp (e.g. 1400 → 884 at a 1440px window) rather than past the window edge. No component, layout, theme, or copy changes, and a before/after could not be captured on the build host (no browser panel; the preview pod's token mint is blocked by the sandbox). The geometry is pinned by the unit tests above.
Related Issues
Closes #16094
Pattern harvest
Not generalizable: a one-off missing reserve term in a single viewport clamp; no broader class of call sites shares the shape.
Checklist