Repository navigation
fix(sidebar): stop the session list collapsing and re-expanding on first load - #20520
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Rows that mount during the hold are never animated. A session created while a slow remote crew is still loading gets no slide-in; confirm that is acceptable. [DESIGN-REVIEWED] fe99702 Description read[DESCRIPTION-READ] 43c3efe83dc698948203dda0f7422aa1951403c56890ae82c1f6ae87716baced 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Watch the 2.5 s/call GIF to confirm the list paints once and stays still while the slow reads arrive. [UX-REVIEWED] fe99702 Description read[DESCRIPTION-READ] 6932bb88072ac89ce030de011dbf2f162106a2307368f6503f37a16d1548698d That sha256 names everything this verdict read: the PR description, plus the 7 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 6.1 Review — ✅ no blocking findingsGPT 6.1 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: |
Opus 5.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: |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check that every load path eventually settles. What this change shipsInventory (6 items) — 6 justifiedIntent: the session list should paint once in its final layout on first load, without collapsing and springing back open. FIX.
[FIRST-PRINCIPLES-REVIEWED] fe99702 Description read[DESCRIPTION-READ] 95e14aac0870134383f069e947c2b56e797aca24d23d7a6ca304529df0d99ef1 That sha256 names the PR description this verdict read. Recompute it with |
36592e8 to
69a7868
Compare
|
self-added: yes
|
|
self-added: yes
|
|
Holding 69a7868 only because the three current-head lane punchlines have no reply. The fix looks sound. The hold latches once ( KiroCrew/website/src/pages/chat-sidebar/rowAnimSettle.ts Lines 33 to 44 in 69a7868 layout/layoutId are still set at mount. Its inputs all settle on their own (KiroCrew/website/src/pages/ChatSidebar.tsx Lines 1147 to 1148 in 69a7868 To clear, post a reply for this head to each of:
A new push needs a fresh review. — crew-pr-reviewer (r102) |
69a7868 to
f459c64
Compare
|
Rebased: |
|
Main is red, not this PR: Backend Tests shard 6 (Linux and Windows), and Coverage Gate after it, fail on |
f459c64 to
fe99702
Compare
|
Rebased onto main 12835a8 to clear the conflict in docs/feature-map/README.md: kept main's Sessions row and re-added this PR's one rowAnimSettle.ts mention. The website patch is line-for-line unchanged from f459c64. tsc, eslint, the sidebar tests (the known createMenu load flake aside, which passes alone), the feature-map gate and docs-lint pass locally. |
|
HOLD at fe99702, only for unanswered review items. The code still looks sound to me. The hold latches once and never resets within a mount (rowAnimSettle.ts#L32-L44). It only drops the mount slide-in and makes the layout transition instant, so These three lane items on this head have no reply yet. They are the same asks from r102, carried through the rebases:
One disposition per lane for this head clears this. A new push needs a fresh review. — crew-pr-reviewer (r107) |
Problem / Motivation
Goal: The session list paints once, in its final layout, when it first loads, instead of collapsing and springing back open.
When the dashboard's session list first appears, its rows snap into a squashed, overlapping stack and then spring back into place over about 300 ms. It happens on every load. A remote crew makes it obvious: the crew's pane is already on screen while the list is still loading over the tunnel, so the reads land far apart and every one of them moves the rows.
Why it matters
Every user sees the list flash on load, and anyone opening a remote crew sees it worst. It reads as a broken, glitchy list at the exact moment the user is trying to pick a session.
Not a goal
What changed (motivation → approach → change)
The list flashed because each session row animates any change in its position, and the first moments of a fresh list are full of position changes that are not movement. Rows first lay out at a 60 px placeholder height (
content-visibility: auto) and then at their real height, and the folder, tag-column and session reads each land a moment apart and refile rows. Each of those layout changes was animated, and every row also played its mount slide-in, so the list collapsed and re-expanded while loading.While the list's first population settles, rows now snap to each new layout instead of springing, and skip their slide-in. They keep their layout animation from the moment they mount, because Framer reads a row's
layoutandlayoutIdonly once, at mount; only the layout transition is made instant ({ type: false }, the same path Framer uses for reduced motion). The hold ends once the session, folder and tag-column reads have settled and the rows have painted once. There is no time limit, so a slow remote crew is never handed back to animation halfway through its load. A gateway with no sessions counts as settled as soon as any session list has arrived since the page loaded (slotsGeneration). After that, rows animate exactly as before.The hook is
website/src/pages/chat-sidebar/rowAnimSettle.ts;ChatSidebar.tsxcomputes the hold and puts it on the shell scope asrowMotionHeld(chat-sidebar/scope.ts),chat-sidebar/laneRows.tsxpasses it into each row's placement throughrows.ts, andSessionRow.tsxapplies it. The sidebar root carriesdata-row-anim="holding"or"settled", which the test helpersettleSidebarRowAnim()inwebsite/src/test/helpers.tsxwaits on.docs/feature-map/README.mdand the sidebar owner table indocs/system-specs/modules/history.mdlist the helper.Backwards compatibility
Compatible: only how rows move during the first load changes; no API, stored data or prop contract changes.
Removes nothing: rows still spring on reorders and slide in when they appear after load; only the animation of the first load's layout changes is skipped.
Tests
website/src/pages/chat-sidebar/rowAnimSettle.test.ts(new): the hook holds while reads are outstanding, settles two frames after they settle (not on the same commit), stays settled if a read later goes back to unsettled (a reconnect), and keeps holding for as long as a slow read takes (60 s) before settling on it.ChatSidebar.animCap.test.tsx: rows mount with their layout projection (layout,layoutId, the lane'slayoutScroll) while the list is holding, with an instant layout transition and no slide-in, and the same elements switch to the spring once it settles; an empty gateway whose session list already arrived settles; the list holds while no session list has arrived and settles when one does. Its Framer mock records the props each element mounted with and keeps one component per tag, as the realmotion.divdoes.settleSidebarRowAnim()(animCap,boardDuplicate,selectorScope,staticRows,stickyFolderCollapse,ChatSidebarMoreCoverage); two setups also setslotsLoaded: true.ChatSidebar.ownerComposition.test.tspins the hook in the sidebar's owner-composition list.Determinism: the ten changed or affected test files passed five shuffled runs (
--sequence.shuffle, seeds 2101/2238/2375/2512/2649, 253/253 each).settleSidebarRowAnim()waits up to 5 s rather thanwaitFor's 1 s default: with six copies ofChatSidebar.animCap.test.tsxrunning at once, the 1 s budget failed 4 of 6 runs and 5 s passed 6 of 6. It is an event wait, so a passing run does not get slower.Manual verification
Reproduced on an isolated dev gateway with the dashboard inside an iframe (as a remote crew's pane is) and added delay on every API call, recorded frame by frame at the same viewport on
mainand on this branch. With 300 ms per call,main's rows moved for about 500 ms after first paint; this branch's did not move. With 2.5 s per call, well past any short cap, this branch's list still painted once and held still. Not reproduced over a real remote-crew tunnel; the iframe-plus-delay setup produces the same sequence of layout changes.Screenshots / video
Before (
main, 300 ms per call): rows collapse into an overlapping stack, then spring open.After (this branch, 300 ms per call): the list paints once and stays put.
After (this branch, 2.5 s per call): a slow load still paints once.
Frame strip: the first frames with the list on screen
Related Issues
No linked issue: a direct fix requested by a maintainer, with no tracking issue filed.
Pattern harvest
Rule candidate: review-prompt
Pattern: layout/mount animation left enabled during a list's initial population, so placeholder-to-real sizing and staggered data reads are animated as if they were movement.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)