Skip to content

sessions: ensure account/update widgets render with icons#312645

Merged
osortega merged 1 commit intomainfrom
sessions/fix-account-widget-icon-rendering
Apr 27, 2026
Merged

sessions: ensure account/update widgets render with icons#312645
osortega merged 1 commit intomainfrom
sessions/fix-account-widget-icon-rendering

Conversation

@osortega
Copy link
Copy Markdown
Contributor

No description provided.

…sectionObserver fires

actionViewItemService.register() does not fire onDidChange when a factory
is  it only fires when the optional `event` argument fires.registered
This caused a race: if the toolbar's IntersectionObserver fired its first
visible callback (and called _updateToolbar()) before AccountWidgetContribution
registered its view item factories, the toolbar rendered text-label fallbacks
and was never notified to re-render with the custom widgets.

Fix by passing a shared Emitter to both register() calls and firing it once
after both factories are in place. This triggers IActionViewItemService.onDidChange
for Menus.TitleBarRightLayout regardless of ordering, so the toolbar always
re-renders with TitleBarAccountWidget / TitleBarUpdateWidget.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 27, 2026 00:31
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

Adjusts the sessions window titlebar account/update widgets’ registration timing so the custom action view items are available when the titlebar toolbar is first built (ensuring the intended icon/widget rendering shows up reliably).

Changes:

  • Keep the titlebar actions registered at module-load time so Menus.TitleBarRightLayout is non-empty during initial toolbar construction.
  • Register the AccountWidgetContribution earlier (WorkbenchPhase.BlockRestore) so the custom IActionViewItemService mappings are in place before the toolbar renders.
Show a summary per file
File Description
src/vs/sessions/contrib/accountMenu/browser/account.contribution.ts Moves the custom view-item registration earlier in lifecycle and trims the explanatory comment for module-level action registration.

Copilot's findings

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

Comment thread src/vs/sessions/contrib/accountMenu/browser/account.contribution.ts
@osortega osortega marked this pull request as ready for review April 27, 2026 00:35
@osortega osortega enabled auto-merge (squash) April 27, 2026 00:39
@osortega osortega merged commit d0898dc into main Apr 27, 2026
30 checks passed
@osortega osortega deleted the sessions/fix-account-widget-icon-rendering branch April 27, 2026 01:35
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 27, 2026
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