Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

MergedPixPMusic(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/17040/headmerged by juliusmarminge View on GitHub

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 pointsAfter: content-sized 150 points
Before: short card with unused spaceAfter: 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

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      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.

      No code changes detected at b534a5a. Prior analysis still applies.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      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: 7c0399eb-90bf-47d3-8151-041eaf7ab7cd

      📥 Commits

      Reviewing files that changed from the base of the PR and between a86b514076b2196a47e8b15e89fe43399d6033d9 and b534a5afb39c29e397009906ae143b86e0d7d334.


      📒 Files selected for processing (1)
      • apps/mobile/src/features/threads/ThreadFeed.tsx

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 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 use the list’s default measurement behavior.

      Priority: ➖ Normal

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix · Severity of issue fixed: Medium

      Suggested reviewers: juliusmarminge


      Merge Risk: ⚪ Minimal · up to b534a

      Inline MCP apps now size to their reported content height up to a 420-point cap. No concrete merge-blocking risk was established, and the PR reports device checks for growth, shrinking and fullscreen.

      Architecture Summary

      Architecture risk: 🔵 Low · up to b534a

      The change affects 1 system.

      Changed systems: apps/mobile

      Architecture concerns No architecture-level concerns identified.

      Review details

      Systems and components

      • observed — apps/mobile (service) was modified; 4 changed files map to changed impact.

      Before / after behavior

      • observed — Modified behavior in apps/mobile/src/features/threads/McpAppWebView.tsx: The fixed MCP_APP_ROW_HEIGHT constant and exported mcpAppRowHeight() helper are removed; the file imports inline sizing utilities instead.
      • observed — Modified behavior in apps/mobile/src/features/threads/McpAppWebView.tsx: The component documentation changes inline display from a fixed feed row to a content-sized row.
      • observed — Modified behavior in apps/mobile/src/features/threads/McpAppWebView.tsx: The prop documentation now says inline sizing follows the app's reported height instead of using a fixed feed row.
      • observed — Modified behavior in apps/mobile/src/features/threads/McpAppWebView.tsx: Height state is initialized to the inline maximum and reset to that maximum when the app reference changes; app-reference replacement still updates the stored app.

      Pre-merge checks | Passed 4
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the primary change: sizing inline mobile MCP Apps to their content.
      Description checkPassedThe description explains the problem, change, scope, UI impact, screenshots, verification results, and test limitations. It references issue #17032 and provides detailed validation evidence. The headi…
      Linked Issues checkPassedIssue #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 reports inli…
      Out of Scope Changes checkPassedThe changed files implement MCP app sizing and feed measurement for issue #17032. The focused tests support that implementation. No theme, cookie, web, or desktop changes are included.

      ✨ 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.
    4. @juliusmarminge @maria-rcks This HTML/MCP preview sizing fix is rebased onto current main and ready for maintainer review. Focused sizing tests, mobile typecheck, and scoped lint/format checks pass. Existing before/after evidence is in the description.

    5. juliusmarminge added labelsmacroscope-review

    6. juliusmarminge merged this74f9df3

    7. juliusmarminge closed this

Sign in to join this conversation.