Skip to content

Conversation

@connor4312
Copy link
Member

  • Adopt rename viewport->containerDimensions
  • Add some code to fix the postMessage.source validation issues
  • Fix apps not restoring when chat is remounted

- Adopt rename viewport->containerDimensions
- Add some code to fix the postMessage.source validation issues
- Fix apps not restoring when chat is remounted
Copilot AI review requested due to automatic review settings January 7, 2026 22:30
@connor4312 connor4312 enabled auto-merge (squash) January 7, 2026 22:30
@connor4312 connor4312 self-assigned this Jan 7, 2026
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 7, 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

This PR updates the MCP (Model Context Protocol) Apps implementation to align with the latest specification and fixes bugs related to webview restoration when the chat sidebar is hidden and shown again.

Key Changes:

  • Renamed viewport to containerDimensions in the protocol spec to match the MCP Apps spec
  • Refactored width tracking from a simple number to an IObservable<number> to enable reactive updates
  • Added remounting logic triggered by visibility changes to restore webviews when chat becomes visible again

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
modelContextProtocolApps.ts Updates protocol types to rename viewport to containerDimensions with more flexible type structure; adds --color-text-ghost CSS variable; converts JSDoc comment to regular block comment
chatListRenderer.ts Converts _currentLayoutWidth from a number to an observable, propagates as observable to render context
chatToolInvocationPart.ts Adds context parameter to ChatMcpAppSubPart constructor
chatMcpAppSubPart.ts Adds visibility change listener to remount apps when chat becomes visible; passes observables for maxHeight and currentWidth to model
chatMcpAppModel.ts Removes ResizeObserver-based viewport tracking; accepts maxHeight and currentWidth as observables; adds postMessage event listener wrapping to fix source validation; removes unused import
chatToolOutputContentSubPart.ts Updates to call .get() on observable currentWidth
chatToolInputOutputContentPart.ts Updates to call .get() on observable currentWidth
chatMarkdownContentPart.ts Updates to call .get() on observable currentWidth
chatContentParts.ts Changes currentWidth from a function to an IObservable; adds onDidChangeVisibility event
chatConfirmationWidget.ts Updates to call .get() on observable currentWidth

@connor4312 connor4312 merged commit c21cd6d into main Jan 8, 2026
27 of 28 checks passed
@connor4312 connor4312 deleted the connor4312/mcp-apps-up branch January 8, 2026 00:03
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