Skip to content

chat: avoid session switch height flicker#319227

Open
roblourens wants to merge 2 commits into
mainfrom
agents/pr-318385-added-a-new-flicker-when-switching-cc2eea45
Open

chat: avoid session switch height flicker#319227
roblourens wants to merge 2 commits into
mainfrom
agents/pr-318385-added-a-new-flicker-when-switching-cc2eea45

Conversation

@roblourens
Copy link
Copy Markdown
Member

Summary

  • avoid deferred first-measurement chat row height updates when the row already fits its allocated height
  • preserve the cutoff fix by still scheduling an update when the initial measured height would clip
  • add focused unit coverage for the height scheduling decision

Validation

  • npm run compile-check-ts-native -- --pretty false
  • node --experimental-strip-types build/hygiene.ts src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts src/vs/workbench/contrib/chat/test/browser/widget/chatListRenderer.test.ts
  • npm run valid-layers-check
  • npm run test-browser-no-install -- --run src/vs/workbench/contrib/chat/test/browser/widget/chatListRenderer.test.ts --grep "shouldScheduleInitialHeightChange"

(Written by Copilot)

Only schedule first-measurement chat row height updates when the measured row would otherwise exceed the list's allocated height. This preserves the cutoff fix from PR 318385 without reintroducing first-measurement relayouts for rows that already fit. (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 31, 2026 23:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts chat list row height scheduling to avoid unnecessary first-measurement updates that can cause session-switch flicker, while retaining updates when the initial render would clip content.

Changes:

  • Adds a helper for deciding whether an initial chat row height change should be scheduled.
  • Tracks the list-allocated row height during rendering.
  • Adds focused browser unit coverage for the scheduling decision.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts Adds allocated-height tracking and gates first-measurement height updates.
src/vs/workbench/contrib/chat/test/browser/widget/chatListRenderer.test.ts Adds unit tests for the initial height scheduling helper.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts Outdated
Compare initial chat row measurements against the actual allocated height instead of the ceiled allocation so fractional row heights still schedule a corrective update when they would clip content. (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens roblourens marked this pull request as ready for review May 31, 2026 23:41
@roblourens roblourens enabled auto-merge (squash) May 31, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants