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

Showing 4 changed files with 48 additions and 26 deletions (loading 1).

x
0 of 4 viewed, 4 left
24 additions and 24 deletionsapps/mobile/src/features/threads/McpAppWebView.tsxModified
View file
@@ -38,15 +38,10 @@
import { enqueueThreadOutboxMessage } from "../../state/thread-outbox";
import { useAtomCommand } from "../../state/use-atom-command";
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
+import { MCP_APP_INLINE_MAX_HEIGHT, mcpAppInlineHeight } from "./mcpAppSizing";
​
-/** The feed reserves a fixed box for an app; a taller app scrolls inside it. */
-const MCP_APP_ROW_HEIGHT = 420;
const ROW_BOTTOM_MARGIN = 8;
​
-export function mcpAppRowHeight() {
- return MCP_APP_ROW_HEIGHT + ROW_BOTTOM_MARGIN;
-}
-​
// The WebView loads a tiny outer page that hosts the app in a real
// opaque-origin iframe, as web does, so the app's `window.parent` and the
// `event.source` of host replies are a real window, which the MCP Apps SDK
@@ -104,7 +99,7 @@
​
/**
* A captured MCP App, hosted in a WebView over the MCP Apps bridge: inline as
- * a fixed row of the thread feed, or full screen in its own modal screen. A
+ * a content-sized row of the thread feed, or full screen in its own modal screen. A
* WebView cannot move between the two without reloading, so each is its own
* view of the app: the inline one is torn down before full screen opens, and
* comes back when it closes.
@@ -119,7 +114,7 @@
readonly revision: string;