Skip to content

Avoid getItemsWidth on chat toolbars when it's not actually used#286946

Merged
roblourens merged 1 commit intomainfrom
roblou/mammoth-ptarmigan
Jan 10, 2026
Merged

Avoid getItemsWidth on chat toolbars when it's not actually used#286946
roblourens merged 1 commit intomainfrom
roblou/mammoth-ptarmigan

Conversation

@roblourens
Copy link
Copy Markdown
Member

re: #286531 already fixed but this would improve this and all other layout scenarios

re: #286531 already fixed but this would improve this and all other layout scenarios
Copilot AI review requested due to automatic review settings January 10, 2026 20:12
@roblourens roblourens enabled auto-merge (squash) January 10, 2026 20:12
@roblourens roblourens self-assigned this Jan 10, 2026
@vs-code-engineering vs-code-engineering Bot added this to the January 2026 milestone Jan 10, 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 optimizes the layout performance of the chat input by deferring expensive toolbar width calculations until they are actually needed.

Changes:

  • Wrapped expensive getItemsWidth() calls in a lazily-evaluated function that only executes when renderStyle === 'compact'
  • Prevents layout thrashing during typing by avoiding unnecessary DOM measurements when toolbar width is not used (when result would be 0)

@roblourens roblourens merged commit ead9f32 into main Jan 10, 2026
27 of 28 checks passed
@roblourens roblourens deleted the roblou/mammoth-ptarmigan branch January 10, 2026 22:01
eli-w-king pushed a commit that referenced this pull request Jan 14, 2026
…6946)

re: #286531 already fixed but this would improve this and all other layout scenarios
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Feb 24, 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