Repository navigation
fix(sidebar): pin folder headers while scrolling the Sessions list - #14099
Conversation
|
Intent: Keep the folder you are scrolling through identifiable in the Sessions sidebar list: its header, and every ancestor folder's header, stays pinned at the top until the folder's rows have scrolled past. |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify pinned headers in Firefox/Safari once — every measurement and screenshot here is Chromium-only, and sticky-inside- [DESIGN-REVIEWED] 343d329 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
UX Review (Fable 5, fork) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS No blind reader has seen the pinned header stack, and the pinning/hand-off motion is evidenced only by static stills. Watch
[UX-REVIEWED] 343d329 |
b467d4e to
51d020a
Compare
|
|
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS
Not justified as shipped
What this change shipsInventory (9 items) — 8 justifiedIntent: keep a folder's header (and its ancestors') visible while scrolling that folder's sessions — a FIX (linked issue #14098, spec fails on base with measured offsets).
Verified against base: [FIRST-PRINCIPLES-REVIEWED] 343d329 |
51d020a to
7bafb43
Compare
|
CI note for 7bafb43: on the previous head, two Frontend Tests failures were inherited from main. Both fail the same way on a detached
The third failure was this PR's. |
Opus 5 Review (fork) — ✅ no blocking findingsReviewed |
|
|
|
|
The code checks that still fail on 9f6fe0d are inherited from main. This PR only changes sidebar frontend files.
The PR description now has the Goal line and the "Not a goal" section that main's template requires, and PR Hygiene passes. |
9f6fe0d to
5850d1b
Compare
… scrolling Folder header rows are position: sticky, stacked one row lower per nesting depth, with an opaque sidebar background. FolderBody clips with overflow: clip instead of hidden so nested headers stick to the scroll container.
5850d1b to
343d329
Compare
|
Rebased onto current main as 343d329 to re-run CI. The code is unchanged. On 5850d1b, Backend Tests (3.12, 2) failed in |
FolderBody's grid item switched to overflow: clip in #14099 so nested sticky headers pin to the lane. A clip box is not a scroll container, so its automatic minimum width became the content's min-content width, and the rows' single-line titles made every row in a folder as wide as its longest title. Add min-width: 0 beside the existing min-height: 0. Adds a real-Chromium spec for a long-titled row in a root folder, a nested folder and unfiled, and raises the E2E executed-spec floor by one. Fixes #14534
FolderBody's grid item switched to overflow: clip in #14099 so nested sticky headers pin to the lane. A clip box is not a scroll container, so its automatic minimum width became the content's min-content width, and the rows' single-line titles made every row in a folder as wide as its longest title. Add min-width: 0 beside the existing min-height: 0. Adds a real-Chromium spec for a long-titled row in a root folder, a nested folder and unfiled, and raises the E2E executed-spec floor by one. Fixes #14534
FolderBody's grid item switched to overflow: clip in #14099 so nested sticky headers pin to the lane. A clip box is not a scroll container, so its automatic minimum width became the content's min-content width, and the rows' single-line titles made every row in a folder as wide as its longest title. Add min-width: 0 beside the existing min-height: 0. Adds a real-Chromium spec for a long-titled row in a root folder, a nested folder and unfiled, and raises the E2E executed-spec floor by one. Fixes #14534 Co-authored-by: Nick Bowers <nrb@amazon.com>
Problem / Motivation
Goal: Keep each folder's header, and its parents' headers, pinned at the top of the Sessions sidebar while you scroll through that folder's sessions.
In the Sessions sidebar a folder's header scrolls off the top of the list together with its sessions. Scrolled into a long folder, you can't tell which folder you are in. With a nested folder, both headers are gone.
Why it matters
Folders are how people group many sessions. Losing the header mid-scroll means scrolling back up to find the folder name, and the header's own controls (collapse, new session, folder menu) go with it.
Not a goal
What changed (motivation → approach → change)
Folder headers now stay pinned to the top of the list while their folder is on screen. The next folder's header takes over when the folder ends. A subfolder's header pins one row below its parent's, so the whole path stays readable.
The header row in
ChatSidebar.tsxrenderFolderHeaderisposition: stickyinside its own folder block, offset one 32px row per nesting depth, with shallower headers painted above deeper ones. The.folder-row-stickyrule inindex.cssgives the pinned row the sidebar card's own surface, so sessions don't show through it. That surface is--bg-elevatedby default,--panelin kiro-light, and--bgin the/embed/sessionsview, whose wrapper inChatPage.tsxrepaints the card and sets--folder-row-sticky-bgto match. The same rule holds the row at the 32px its offset assumes, because a default-agent badge or the rename input would otherwise make it taller and let the header below overlap it. The offset also subtracts the list's 8px top padding. Without that, the pinned row sat 8px low.A row the arrow keys move to also lands below the pinned headers rather than behind them. Each folder block sets
--folder-pin-stackto the height of the headers pinned above its rows, and session rows use it asscroll-margin-top. Chromium'sscrollIntoView({ block: 'nearest' })ignores that margin for a row already inside the list, sofocusSiblingSessionRowinchat/sessionRowNav.tsre-aligns withblock: 'start'when the row sits inside the margin band.Dragging onto a pinned header lands in that header's folder. A pinned header paints over a subfolder block scrolled beneath it, while drag-and-drop still hit-tests the whole block rect. So
sidebarCollisioninChatSidebar.tsxnow checks first for a folder whose header row is under the pointer, and it measures the nest band from that header's live position.Nested headers could not pin before:
FolderBody.tsxclipped its inner box withoverflow: hidden, which made that box the subfolder header's scroll container. It usesoverflow: clipnow, which clips the same way without creating a scroll container, withmin-height: 0so the collapse animation still works.Backwards compatibility
Compatible: styling only. No API, stored data or prop contract changes, and the board/column view is untouched.
Tests
website/playwright/sidebar-sticky-folder-header.spec.ts(new) measures header positions in Chromium. The parent header sits on the list's top edge, the subfolder header exactly one row below it, the next folder takes over at the boundary, and the pinned row paints exactly the card's background. It runs on three surfaces: the default dark theme, kiro-light, and/embed/sessions. The parent folder has a default agent, so its badge is in the measured row. Without theChatPage.tsxvariable, the embedded case fails with the row one shade lighter than the card. On main this fails: both headers had scrolled 99px and 65px past the top, with a transparent background.website/src/test/ChatSidebar.arrowNav.test.tsxchecks thatfocusSiblingSessionRowre-aligns only a row inside its scroll margin, and leaves a clear row or a row with no margin wherenearestput it.website/src/test/ChatSidebar.stickyHeaderCollision.test.tsx(new) puts a subfolder block under its parent's pinned header. It checks that a session drag, a nested-folder drag and a root-folder nest drag on the parent header all resolve to the parent. The header's bottom edge is still a reorder edge, and a row below the headers still resolves to the subfolder. Three of the six cases fail without the collision change.website/src/test/DesignTweakRequestsCov80.test.tsxchecked for a collapsed request group by matching anyhiddenin the body's style, which the oldoverflow: hiddenalways satisfied. It now clicks the header twice, because a pending group starts open, and matchesvisibility: hidden.website/src/test/ChatSidebar.collapsedFolderGhostHeight.test.tsxchecksoverflow: clipwhere it checkedoverflow: hidden.sidebar-folder-alignment.spec.tsand the ChatSidebar vitest files still pass.Manual verification
Checked on an isolated gateway in dark mode, kiro-light and
/embed/sessions: scrolled through a parent folder, its subfolder and the next folder, moved through the subfolder with the arrow keys, and ransession-tags-folders.spec.tsfor folder drag and drop. The spec saves lane stills whenSTICKY_EVIDENCE_DIRis set, which is how the screenshots below were taken. The spec restores the gateway's saved theme after each run. Header rows measure 32px with a badge, in an empty folder, on hover and while renaming.Screenshots / video
Scrolled into the subfolder (dark): the parent and subfolder headers are both pinned.
Inside the next folder (dark): its header has taken the top.
kiro-light, scrolled into the subfolder: the pinned rows use the card's
--panelsurface./embed/sessions, scrolled into the subfolder: the pinned rows use the view's--bgsurface.Related Issues
Fixes #14098
Pattern harvest
Not generalizable: a new sticky row needs a scroll container with no clipping ancestor in between. That is a layout property of this one tree, not a code pattern a rule could catch.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)