Repository navigation
sessions: keep sticky approval rows from growing the session row - #342391
Merged
Alexandru Dima (alexdima) merged 4 commits intoOct 18, 2026
Merged
Alexandru Dima (alexdima) merged 4 commits into
Alexandru Dima (alexdima) merged 4 commits into
Conversation
The approval row inherited the list row's line-height, which ListView sets to the full row height. Its code-block label is filled in asynchronously, so a freshly rendered sticky copy measured the placeholder text with that line-height. Sticky scroll never shrinks the source row, so each re-render grew the session row by roughly one more line. Pin the approval row's line-height to the 18px that getApprovalRowHeight already assumes, matching the CI and input-needed rows, and add a regression test. Fixes #338189 Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix matches existing sizing assumptions, includes regression coverage, and has no unresolved findings.
No open issues 🎉
What changed in this PR
Prevents pending approvals from inflating sticky session rows in the Agents window, addressing #338189.
Changes:
- Sets approval line-height to 18px to prevent inherited row-height feedback.
- Adds a regression test using asynchronous code-block rendering and sticky scrolling.
| File | Description |
|---|---|
| src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts | Tests that sticky approvals preserve session row height. |
| src/vs/sessions/contrib/sessions/browser/media/sessionsList.css | Resets approval line-height and explains the measurement issue. |
Review effort: Balanced
…scrolling) Merge rksharma-owg's head 8c82d12 so their commits land with this fix. Conflict resolution: keep a single line-height declaration on .session-approval-row with the more detailed comment, keep main's listService import, and use their four sticky-scroll regression tests in place of the narrower single-case test, which they cover. Co-authored-by: rksharma-owg <[email protected]> Co-authored-by: Copilot <[email protected]>
Alexandru Dima (alexdima)
marked this pull request as ready for review
October 18, 2026 13:23
Alexandru Dima (alexdima)
enabled auto-merge
October 18, 2026 13:23
Dmitriy Vasyura (dmitrivMS)
approved these changes
Oct 18, 2026
Alexandru Dima (alexdima)
deleted the
alexdima/sessions-sticky-approval-row-height
branch
October 18, 2026 13:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #338189
Supersedes #338210 (includes its commits)
Important
Please merge with "Create a merge commit", not squash or rebase. This branch merges RKS (@rksharma-owg)'s #338210 head (
8c82d12f42), so their original commits land and GitHub marks #338210 as merged. Squashing or rebasing would drop those commit IDs.Problem
In the Agents window, an expanded session with a pending approval (for example "Write file? [Allow]") can grow to hundreds of pixels once it scrolls into the sticky header. The title moves into a mostly empty grey block and the rest of the list is pushed down. I hit this on Insiders
a0c6520313624aceb3f3a80eff7932be6a00405a(2026-10-17). The row was 363px tall when 64px was enough.Root cause
Three behaviors combine so that the row height keeps growing:
ListViewand the sticky scroll widget set each row'sline-heightto the full row height (setRowLineHeight)..session-approval-rowdid not override it, so the approval label inherits it. The sibling.session-ci-rowand.session-input-needed-rowalready reset theirs to 18px for this reason.EditorMarkdownCodeBlockRendererfills it in asynchronously, so a freshly rendered row briefly holds plain inline text, and that text's line box is as tall as the inheritedline-height.StickyScrollWidget.probeDynamicHeights) while the label is still a placeholder, and, because a sticky row "never shrinks the source row", pushes the larger height back to the real row throughonDidChangeHeight. The next sticky render starts from that largerline-height, so each cycle adds about one more line.SessionsTreeDelegate.getHeightandSessionItemRenderer.getApprovalRowHeightalready assume an 18px approval line, so the fix pins the CSS to that value.Evidence from a live Insiders window
I attached to the running Agents window with dbgjs and inspected the affected row:
top: 78px; height: 363px; line-height: 363px;(aria-label: "ExP triggered scorecards, …, State: Attention Needed").line-heightmatched the row height (363px). Its intrinsic content needs only 64px.I then measured the row the same way
probeDynamicHeightdoes, by clearingstyle.heightand readingoffsetHeightwhile varying the inheritedline-height. I ran it with the label tokenized and as a placeholder, with and without.session-approval-row { line-height: 18px }injected:The placeholder measurement is always the previous height plus about 43px, which is the ratchet. With the fix, every measurement is 64px.
History
This is not a regression in the latest Insiders. Nothing that affects it changed between
0b37947e9c38anda0c65203136. The ingredients arrived with:#338210 by RKS (@rksharma-owg) proposed the same CSS change and regression tests on Sep 27, but it no longer merged cleanly with
main. This PR merges their head commit and resolves the conflicts against currentmain, so their work lands with their authorship. It adds the live diagnosis above.Changes
sessionsList.css: setline-height: 18pxon.session-approval-row(from sessions: Stabilize approval row height during sticky scrolling #338210), with a comment explaining why.sessionsList.test.ts: the four regression tests from sessions: Stabilize approval row height during sticky scrolling #338210 (compact and normal layout, 1-line and 3-line approvals). They use the realEditorMarkdownCodeBlockRenderer, so the code block fills asynchronously as in the product, and scroll the expanded session through the sticky header three times while checking that the row height stays constant.2906c3046c0): keeps oneline-heightdeclaration with the longer comment, keepsmain'slistServiceimport, and drops my earlier single-case test, which their tests cover.Validation
Run on the merged branch, rebased on
maine7789ad24ce, on macOS Electron:./scripts/test.sh --run src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts --grep "approval height bounded": all 4 fail without the CSS line (compact 1-line row 62px → 224px, 3-line row 98px → 312px), all 4 pass with it../scripts/test.sh --run src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts: passed (247 passing).npm run typecheck-client: passed.npm run eslint -- src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts: passed.npm run stylelint: passed (no findings on changed lines).How to test