Skip to content

Avoid flicker when checkpoint toolbar appears on request#298501

Merged
roblourens merged 1 commit intomainfrom
roblou/prickly-gerbil
Feb 28, 2026
Merged

Avoid flicker when checkpoint toolbar appears on request#298501
roblourens merged 1 commit intomainfrom
roblou/prickly-gerbil

Conversation

@roblourens
Copy link
Copy Markdown
Member

@roblourens roblourens commented Feb 28, 2026

When scrolling to a request row in the chat list, the checkpoint toolbar (and other MenuWorkbenchToolBar instances) would not populate their actions until after the debounced menu change event fired (~50-100ms after context keys were set in renderElement). This caused a visible height jump as the toolbar went from empty to populated.

Changes

src/vs/platform/actions/browser/toolbar.ts

  • Added a refresh() method to MenuWorkbenchToolBar that forces an immediate synchronous re-evaluation of menu actions
  • Promoted the local updateToolbar closure to a private _updateToolbar() method, storing the necessary state (_menu, _menuOptions, _toolbarOptions, _container) as class fields

src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts

  • After setting context keys during renderChatTreeItem, call refresh() on all four toolbars (title, footer, checkpoint, checkpoint restore) to force synchronous action evaluation
  • Removed the previous eventDebounceDelay: 0 workaround from the footer toolbar

(Written by Copilot)

cc @jrieken

Copilot AI review requested due to automatic review settings February 28, 2026 22:54
@vs-code-engineering vs-code-engineering bot added this to the March 2026 milestone Feb 28, 2026
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 addresses a UI flicker/height jump in the chat list by ensuring MenuWorkbenchToolBar instances can synchronously populate actions immediately after context keys are updated, instead of waiting for the menu’s debounced change event.

Changes:

  • Added MenuWorkbenchToolBar.refresh() to force an immediate synchronous re-evaluation of menu actions.
  • Refactored MenuWorkbenchToolBar’s internal update closure into a private method with stored state.
  • Updated the chat list renderer to call refresh() on relevant toolbars after setting context keys, and removed the prior eventDebounceDelay: 0 workaround on the footer toolbar.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/vs/platform/actions/browser/toolbar.ts Adds a synchronous refresh() API and refactors menu-driven toolbar update logic into a method.
src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts Forces immediate toolbar action evaluation after context key updates to avoid visible layout shifts.

Comment thread src/vs/platform/actions/browser/toolbar.ts
Comment thread src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts
@roblourens roblourens enabled auto-merge (squash) February 28, 2026 23:06
@roblourens roblourens merged commit e88a720 into main Feb 28, 2026
24 checks passed
@roblourens roblourens deleted the roblou/prickly-gerbil branch February 28, 2026 23:10
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants