Skip to content

fix(mobile): size inline MCP apps to their content - #17040

Open
PixPMusic wants to merge 1 commit into
pingdotgg:mainfrom
PixPMusic:pixpmusic/fix-mobile-mcp-app-height
Open

PixPMusic wants to merge 1 commit into
pingdotgg:mainfrom
PixPMusic:pixpmusic/fix-mobile-mcp-app-height

Conversation

@PixPMusic

@PixPMusic PixPMusic commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What Changed

Size inline mobile MCP Apps from their ui/notifications/size-changed height and let the feed measure the resulting row. Preserve the existing 420-point cap for taller apps and fullscreen sizing. Reset the initial height when a captured app or its document changes.

Why

The mobile host supplied an exact 420-point height, ignored app size notifications, and reserved a fixed 428-point feed row. Short cards consequently left large gaps. Supplying maxHeight lets the app report its natural content height; the sample document now occupies 150 points plus the existing 8-point row margin.

Fixes #17032. Independent of the theme and sandbox-cookie fixes in #17026 and #17027; this PR only changes the mobile host and feed sizing.

UI Changes

Same fictional document, iPhone 17 simulator, portrait, dark mode, and 370-point embed width. Crops contain only the embed. The height difference is the behavior being fixed.

Before: fixed 420 points After: content-sized 150 points
Before: short card with unused space After: short card fits its content

Reusable sanitized fixture bundle. The fixture preserves captured vendor HTML while replacing company and conversation data; it runs in a disposable T3 home.

Verification

  • vp test run apps/mobile/src/features/threads/mcpAppSizing.test.ts: 9 cases passed, covering invalid heights, rounding, minimum, and maximum.
  • vp run --filter @t3tools/mobile typecheck: passed.
  • Touched-file lint and formatting: passed; existing React compiler warnings in ThreadFeed.tsx remain.
  • iPhone 17 / iOS 26.5: both real captured document cards measure 150 points. A temporary synthetic app verified growth to the 420-point cap, internal scrolling of 900-point content, shrinking to 150, fullscreen, and close/reopen remeasurement.
  • iPad Pro 13-inch / iOS 26.5: sidebar toggle changes live embed width from 652 to 920 points. Resizing to a narrow window changes width to 343 points; the description wraps from one line to two, and the two document heights change from 130 to 172/194 points. Returning to full width restores 130-point heights. Text sizes remain unchanged.
  • Pixel 9 Pro Fold / Android emulator: on the unfolded display, toggling the sidebar changes embed width from approximately 532 to 812 points. Metadata reflows from two lines to one, and card height changes from 150 to 130 points; reopening the sidebar reverses the change. The original closed-display override was restored afterward.
  • Web and desktop are unchanged. The app is configured for portrait orientation.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes (no new animation or interaction)

Model: GPT-6.1 Sol | Harness: Codex in T3 Code

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 8, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This changes the default mobile presentation of existing inline MCP apps from fixed-height rows to content-sized, host-reported rows and alters feed virtualization behavior. Because the change affects the production mobile path and product-default UI behavior, human review is warranted.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fe582d7f-a236-47d0-8138-f8ff72655cab
📥 Commits

Reviewing files that changed from the base of the PR and between 83a82a4 and a86b514.

📒 Files selected for processing (4)
  • apps/mobile/src/features/threads/McpAppWebView.tsx
  • apps/mobile/src/features/threads/ThreadFeed.tsx
  • apps/mobile/src/features/threads/mcpAppSizing.test.ts
  • apps/mobile/src/features/threads/mcpAppSizing.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Inline MCP app rows now use tracked, app-reported heights capped at 420 pixels. ThreadFeed no longer assigns MCP app rows a fixed height.

Changes

Inline MCP app sizing

Layer / File(s) Summary
Inline height handling
apps/mobile/src/features/threads/mcpAppSizing.ts, apps/mobile/src/features/threads/mcpAppSizing.test.ts, apps/mobile/src/features/threads/McpAppWebView.tsx
The sizing helper returns undefined for missing or non-finite heights and caps valid heights at 420 pixels. McpAppWebView updates tracked height from valid inline size reports and resets it when the app reference or document changes. Inline host context reports a maximum height; fullscreen context reports its supplied height or the inline maximum.
Thread feed measurement
apps/mobile/src/features/threads/ThreadFeed.tsx
MCP app rows use the attachment ID as their React key and fall through to the list’s default measurement behavior.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to a86b5

Short inline apps can shrink while tall apps remain capped. No actionable merge-blocking issue was established.

Security Architecture Review

Security architecture risk: 🔵 Low · up to a86b5

Embedded apps gain bounded control over their own displayed height, not additional permissions. Heights remain between 80 and 420 points. Delayed-message behavior during document replacement has not been verified, but the observed sizing path affects presentation rather than privileged operations.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — An app capable of sending bridge notifications can influence its own bounded row height and resulting feed geometry. The observed new sink does not alter tool authority, resource access, credentials or environment scope.

Trust Boundaries and Controls

  • observed — Layout negotiation remains separate from privileged host callbacks. Changing container dimensions does not change the host capability families or bypass the existing bridge checks.

Resilience and Maintainability Implications

  • inferred — The secret is initialized once per component and reused across same-component document restarts. If native delivery permits a queued old-document notification to reach the replacement host, it could overwrite the reset height, still within the inline bounds. Delivery was not established; no corresponding privileged-state effect was demonstrated.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #17032 requires short inline MCP Apps to use reported content height, tall apps to remain capped with internal scrolling, and fullscreen apps to fill the screen. McpAppWebView.tsx now reports …
Out of Scope Changes check ✅ Passed The changed files are limited to MCP app sizing, MCP app rendering, feed row measurement, and focused sizing tests. The changes directly implement issue #17032. No theme, cookie, web, or desktop chang…
Title check ✅ Passed The title clearly and concisely describes the main change: sizing inline mobile MCP Apps to their content.
Description check ✅ Passed The description explains the problem, implementation, scope, issue reference, UI impact, screenshots, and focused verification results. It does not use the template's exact section headings, but it pr…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Short MCP App cards reserve excessive blank space in the mobile feed

1 participant