Repository navigation
fix(sidebar): render the rows that rise into view on a folder collapse - #19755
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the rows forced to [DESIGN-REVIEWED] fe5723a Description read[DESCRIPTION-READ] 6adb4cc254a2517e5f995c2937232f26fbf386760526da48a955c67c23a62f9a 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 (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Confirm that Not justified as shipped
What this change shipsInventory (5 items) — 3 justifiedIntent: A FIX. When a sidebar folder collapses, the folder that rises into its place should show its rows in the same frame as its header (#18121, with a repro table and tests that fail on main).
[FIRST-PRINCIPLES-REVIEWED] fe5723a Description read[DESCRIPTION-READ] cb9e87103da3bbb6d08cc50a7a906932603fbae8c16e04c5a8afd36945256ad0 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Check one thing before merge: whether a long scroll right after a collapse shows any row-height jump once the inline [UX-REVIEWED] fe5723a Description read[DESCRIPTION-READ] a040a2a0873cf18869f9cb8040782617cf752d2c0ab6f7994c7152c07b418dda That sha256 names everything this verdict read: the PR description, plus the 11 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 |
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: |
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: |
9155604 to
9d14419
Compare
Collapsing a tall list-view folder brings the next folder up under the pinned header in one frame. Its header painted on that frame, but its session rows stayed blank for one or two more: `.session-row` is `content-visibility: auto`, so rows that were below the lane had never been rendered, and the browser only notices they have come on screen in the rendering update after the layout that moved them. The gap showed with motion and under prefers-reduced-motion alike. The collapse hook now gives the rows that can rise into the lane `content-visibility: visible` inline in the collapsed commit, before it paints, and takes the override off once the close has finished (the collapse duration, then two frames). Only rows after the collapsing block in document order, and only as many as can reach the lane's bottom edge, so a never-rendered row above the lane keeps its placeholder height and nothing above the header moves. A recording harness, capture-collapse-rising-rows.mjs, measures each screencast frame of the collapse against the settled frame and counts the frames on which the risen folder's header has painted and its rows have not; it shares its scene with capture-sticky-folder-collapse.mjs.
9d14419 to
fe5723a
Compare
|
self-added: yes
|
|
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (5 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: fixes rows that rise into view on a folder collapse painting late, by rendering them for the collapse frame and restoring content-visibility afterwards; the rest is a shared recording scene for the capture scripts and tests.
Problem / Motivation
Goal: When a sidebar folder collapses, the folder that rises into its place shows its session rows in the same frame as its header.
Collapse a tall folder in the list view from its pinned header. The next folder comes up under the header at once, but its lane is empty for one or two frames, and then its session rows appear. The gap shows with motion on and under
prefers-reduced-motion.Why it matters
A header over an empty lane reads as a flash on every collapse of a tall folder. The sidebar collapse was just made to close in one frame so the lane is never blank; this gap is the part of that blank lane that stayed.
Not a goal
content-visibility: autoon.session-rowinindex.css, or the 60px placeholder every row measures before it paints (scroll memory and row windowing are built on it).What changed (motivation → approach → change)
Rows of a folder below the lane have never been rendered:
.session-rowiscontent-visibility: auto, and the browser only notices a skipped row has come on screen in the rendering update AFTER the layout that moved it. The collapse moves dozens of rows into the lane in one layout, so they paint one or two frames after the header, which has no such rule.The fix is in the hook that already runs in the collapsed commit, before it paints (
stickyCollapse.ts). It gives the rows that can rise into the lanecontent-visibility: visibleinline, so they render in that frame, and takes the override off once the close has finished: the collapse duration, then two frames. It touches only rows AFTER the collapsing block in document order, and only as many as can reach the lane's bottom edge after rising by the body's height. Rows inside a closed folder in between are passed over without being measured (a measure would force layout of a skipped subtree, and they never rise). A never-rendered row above the lane keeps its placeholder height, so nothing above the header moves. In that same commit the hook now clears the earlier arm's TTL timer and release frame for every collapse, not only an instant close: the arm has rendered, so both are finished with, and the earlier collapse's forced rows go with them.capture-collapse-rising-rows.mjsis the recording harness for this: it keeps every screencast frame across the collapse, measures the risen folder's header box and its first rows against the settled frame, and counts the frames on which the header has painted and the rows have not (exit 1 when there are any). Its scene is shared withcapture-sticky-folder-collapse.mjsthroughlib/folder-collapse-scene.mjs.Intended? / Repro
Intended? No.
content-visibility: autocame in with #6684 as a render-cost cut for long lists; the frame-late paint is a side effect nobody chose. No RFC, doc or comment calls the header-first order a design. #18057 (merged 2026-10-08) closed the folder in one frame for exactly the opposite reason: so the lane is never blank. The issue's filmstrips come from that PR's branch, and its author filed the gap as a defect.Repro on
origin/main@ 0412948, with the harness above (dark + light, motion + reduced motion; headless Chromium, 1400×900, two folders of 40 rows, lane scrolled 400px into the first):The same run with
.session-row{content-visibility:visible}injected on main also shows 0 blank frames, which pins the cause to that rule.Backwards compatibility
Compatible: nothing is rejected, renamed or removed. The inline override is set and removed by the hook on its own timer; a row's
styleattribute reads as before once the close has finished.Removes nothing: the diff adds a helper and a harness and moves fixture code into a shared module that both harnesses import.
Tests
stickyCollapse.test.ts:renderRowsRisingIntorenders only the rows after the block that can reach the lane (rows before it, rows inside it and rows too far below are left alone) and undoes it; the rows of a closed folder in between are neither measured nor rendered and do not end the walk; a body already closed rises by nothing, so only rows level with the lane are rendered; a missing lane or block is a no-op.Each fails on main: the helper does not exist and no row carries
content-visibility: visibleafter a collapse.Manual verification
The harness runs above, on a production build served by
lib/serve-dist.mjs. The sibling harnesscapture-sticky-folder-collapse.mjsstill records the pinned header at the same top before and after the collapse (125.14 → 125.14) on this branch.Screenshots / video
Filmstrips: every compositor frame from just before the collapse commits, cropped to the top of the sessions lane, labelled with its time from the commit and the per-frame verdict (red label = header painted, rows blank).
Before (main, dark): the frames at 44 ms and 60 ms show "beta folder" over an empty lane.
After (this branch, dark): rows arrive with the header.
Light theme, reduced motion, and the blank frame itself
Before, light:
After, light:
Before, dark,
prefers-reduced-motion(one blank frame):After, dark,
prefers-reduced-motion:The measured box on main at 44 ms, then settled:
Related Issues
Fixes #18121
Pattern harvest
Rule candidate: review-prompt
Pattern: content moved on screen by a layout change (not a scroll) under
content-visibility: autopaints a frame late; anything that must arrive with it in one frame needsvisiblefor that commit.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)