Skip to content

Ensure to update ChatInputPart state before updating viewmodel#299119

Merged
DonJayamanne merged 2 commits intomainfrom
don/mobile-emu
Mar 4, 2026
Merged

Ensure to update ChatInputPart state before updating viewmodel#299119
DonJayamanne merged 2 commits intomainfrom
don/mobile-emu

Conversation

@DonJayamanne
Copy link
Contributor

Fixes #299116

Copilot AI review requested due to automatic review settings March 4, 2026 05:40
@DonJayamanne DonJayamanne self-assigned this Mar 4, 2026
@DonJayamanne DonJayamanne marked this pull request as ready for review March 4, 2026 05:41
@DonJayamanne DonJayamanne enabled auto-merge (squash) March 4, 2026 05:41
@vs-code-engineering vs-code-engineering bot added this to the 1.111.0 milestone Mar 4, 2026
Copy link
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

Fixes a chat sessions UI bug where the wrong language model label can appear after switching between sessions by ensuring the ChatInputPart state is synchronized before the ChatViewModel change event is fired.

Changes:

  • Reorders session-switch logic so inputPart.setInputModel(...) runs before assigning this.viewModel.
  • Adds an inline comment documenting why the ordering matters (because viewModel assignment fires onDidChangeViewModel, which ChatInputPart listens to).

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@DonJayamanne DonJayamanne merged commit f4e743c into main Mar 4, 2026
20 checks passed
@DonJayamanne DonJayamanne deleted the don/mobile-emu branch March 4, 2026 06:10
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.

Incorrect Model displayed when switching between Sessions

3 participants