Skip to content

feat: implement host-driven container dimension management via Resize…#2057

Merged
sugoi-yuzuru merged 4 commits into
mainfrom
fix_resizing
Jul 22, 2026
Merged

feat: implement host-driven container dimension management via Resize…#2057
sugoi-yuzuru merged 4 commits into
mainfrom
fix_resizing

Conversation

@sugoi-yuzuru

Copy link
Copy Markdown
Collaborator

…Observer and host-context-changed notification

Description

Update MCP Apps spec to allow host-controlled resizing. I.e., the Host can inform the app what window size it has room for it to display so that the app can adjust it size based on the host context to fit snuggly.

The protocol leverages the MCP's official protocol https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/2026-01-26/apps.mdx

Pre-launch Checklist

One time:

For this PR:

  • I have updated the relevant CHANGELOG.md file.
  • I updated/added relevant documentation.
  • My code changes (if any) have tests.
  • If my branch is on a fork, I have verified that scripts/e2e_test.sh passes.

If you need help, consider asking for advice on the discussion board.

…Observer and host-context-changed notification

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements host-driven container dimensions aligning with the Model Context Protocol Apps Specification. It updates pong_app.html to dynamically adjust its dimensions based on host context notifications, implements a ResizeObserver in mcp-app.ts to monitor and propagate iframe dimension changes, and documents the new ui/notifications/host-context-changed notification. The review feedback suggests: 1) adding a fallback to default dimensions in pong_app.html for backward compatibility, 2) setting the initial host context synchronously before connecting the bridge to ensure dimensions are available during the handshake, and 3) using strict type checks for dimensions to safely handle zero values.

Comment thread samples/community/agent/adk/mcp_app_proxy/pong_app.html Outdated
Comment thread samples/community/agent/adk/mcp_app_proxy/pong_app.html
Comment thread samples/community/agent/adk/mcp_app_proxy/pong_app.html
@sugoi-yuzuru
sugoi-yuzuru enabled auto-merge (squash) July 22, 2026 14:05
@sugoi-yuzuru
sugoi-yuzuru merged commit 250a2e1 into main Jul 22, 2026
24 checks passed
@sugoi-yuzuru
sugoi-yuzuru deleted the fix_resizing branch July 22, 2026 14:09
@github-project-automation github-project-automation Bot moved this from Todo to Done in A2UI Jul 22, 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