You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web,mobile): MCP apps that report no content collapse instead of leaving an empty box - #46259
Every Datadog MCP call that returns no chart leaves an empty gray box in the thread. Datadog attaches its dataviz app (ui://apps/dataviz) to execute_code and get_datadog_metric. When a result has no charts (_meta["datadog/inline-chart-collection"].entries is []), the app renders nothing and sends ui/notifications/size-changed with height: 0. clampMcpAppHeight raises that to the 80px minimum. The app's own body paints a solid background, so each call becomes an 80px gray card with nothing in it. A busy Datadog turn stacks one per call, and they stay visible while "Worked for" is collapsed and after a reload.
A height of 0 now collapses the app's row. Every other height sizes exactly as before.
clampMcpAppHeight and the 80px floor from feat: MCP apps render and run inline in threads #16236 are unchanged. Heights from 1 to 79 still round up to 80. The host now tracks one extra fact: the app's last inline report was <= 0.
Web (McpAppFrame): while that flag is set, the row is 0px tall and drops its prefersBorder border. The iframe stays mounted, so the app grows back when it reports content. The "left its page and was stopped" message ignores the flag and keeps its height. "Show app" after a close clears the flag, the same way it already resets the frame.
Mobile (ThreadMcpApp): same rule for the live WebView row. It is 0px with no bottom margin. The bridge-missing, navigated-away and crashed messages ignore the flag, and the closed and full-screen placeholders don't read it. The flag is cleared wherever the row already resets its height: app change, reopen, inline reload and process restart.
Because the flag is separate from height, every status view renders exactly as on main.
Scope
Fixes#38253. #38086 and #39961 make the same fix by changing clampMcpAppHeight to return 0, which sends 0 into the status views and the reopen path that reuse height. Those views then each needed their own floor. This PR leaves the clamp and those views alone, so it touches only the live app row. #35911 (small non-zero heights) is out of scope.
Verification
Reproduced with Datadog's real app. The stub fixture in #39961 drew transparent blank space. This repro serves Datadog's own dataviz HTML (dataviz-mcp-ui v35.156918072, which loads its bundle from static.datadoghq.com) from a stdio MCP server. Its execute_code returns the same shape as a stored Datadog result: a JSON text block, _meta["datadog/inline-chart-collection"].entries: [], and "openai/closeWidget": true. A Claude thread (claude-haiku-5-5, started with t3 thread start --wait) called it three times. I opened the thread on the dev web client in dark mode, at 1280×900 and 2x scale, and measured each dataviz app row after the bundle loaded.
The same thread and DB were used for both. Only McpAppFrame.tsx was toggled.
Test. New browser test collapses an app that reports no content until it reports some in McpAppFrame.browser.test.tsx. The app sets prefersBorder and reports 0: the row must be 0px and the box must have no height, so no border line is left. It then reports 12, and the row must come back at 80px.
With McpAppFrame.tsx from main: Tests 1 failed | 5 passed (6).
With the fix: Tests 6 passed (6). The existing reopen and navigated-away tests pass unchanged.
vp run check:changed: format, lint, knip, typecheck (3 packages), test and React Compiler (2 files) all pass.
Not checked: mobile on a device or simulator. The mobile change mirrors the web rule, and the typecheck and React Compiler checks cover it.
Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.
Reviewing files that changed from the base of the PR and between 388d558 and 1d87b08.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The web and mobile MCP app views now track reports of nonpositive height and collapse inline rows under platform-specific conditions. The changes also reset empty state during specified app and document lifecycle actions.
Changes: Empty MCP app rows
Layer / File(s)
Summary
Web frame empty-height handling apps/web/src/components/chat/McpAppFrame.tsx, apps/web/src/components/chat/McpAppFrame.browser.test.tsx
The frame ignores missing heights and tracks whether a reported height is zero or less. It collapses the row unless the app has navigated away, resets the state when reopened, and omits the preferred border while collapsed. The browser test checks collapse at zero and expansion after a height report of 12.
Mobile inline empty-height handling apps/mobile/src/features/threads/McpAppWebView.tsx
The view resets empty state when the app reference changes or the WebView restarts. It ignores undefined or invalid heights and collapses eligible inline rows. Fullscreen sizing remains unchanged.
pingdotgg/t3code#35911 — The PR collapses rows for zero or negative heights, but retains the existing minimum-height clamp for positive heights below 80.
Suggested reviewers:juliusmarminge
Merge Risk: Minimal · previous review 388d5
This change collapses empty MCP app rows, such as Datadog results with no charts, to zero height on web and mobile. Other sizing behavior is unchanged. No merge-blocking risk was found. The mobile behavior has not been checked on a device or simulator.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: MCP apps that report no content now collapse instead of showing an empty box. It also names both affected areas (web and mobile). It follows the conventional commit fo…
Description check
The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each one is filled in. It gives a clear reproduction with Datadog's real dataviz app, wit…
Linked Issues check
[#38253] The issue requires that Datadog execute_code results with no charts stop leaving empty 80px cards. The head keeps clampMcpAppHeight and its 80px floor. The PR adds a separate empty flag, set …
Out of Scope Changes check
All changed files serve the #38253 fix. The web change in McpAppFrame.tsx adds the empty flag and the collapsed row. It keeps the stopped message at its height and clears the flag on 'Show app'. The m…
Full details: Title check
Explanation
The title names the main change: MCP apps that report no content now collapse instead of showing an empty box. It also names both affected areas (web and mobile). It follows the conventional commit format the template suggests. The changeset matches it: the live app row goes to 0px when an app reports a height of 0 or less, in both McpAppFrame.tsx and McpAppWebView.tsx.
Full details: Description check
Explanation
The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each one is filled in. It gives a clear reproduction with Datadog's real dataviz app, with before and after measurements. It links issue #38253 and explains why the clamp and status views stay unchanged. It includes a focused browser test with pass/fail results and a list of what was not checked (mobile on device). It also names the model and harness, as the template asks. The Verification section includes before/after screenshots, as the template requires for UI changes.
Full details: Linked Issues check
Explanation
[#38253] The issue requires that Datadog execute_code results with no charts stop leaving empty 80px cards. The head keeps clampMcpAppHeight and its 80px floor. The PR adds a separate empty flag, set when the app reports height <= 0. While the flag is set, the web row (McpAppFrame.tsx) is 0px and drops its border. The mobile live row (McpAppWebView.tsx) is 0px with no bottom margin. The iframe and WebView stay mounted, so the row grows when the app reports content. The browser test 'collapses an app that reports no content until it reports some' covers the 0px case and the recovery to 80px. The author reports that this test fails on main and passes with the change. The reproduction in the PR uses Datadog's real dataviz app, and the row measurements are [80, 80, 80] on main and [0, 0, 0] with the change. The #35911 small-height concern is excluded, as the PR states. This assessment used the whole-PR summary and one focused file read. The incremental diff from the previous head could not be read, so the head changes are assessed from the summary only. Mobile was not verified on a device. That is a verification gap, not a missing coding requirement.
Full details: Out of Scope Changes check
Explanation
All changed files serve the #38253 fix. The web change in McpAppFrame.tsx adds the empty flag and the collapsed row. It keeps the stopped message at its height and clears the flag on 'Show app'. The mobile change in McpAppWebView.tsx applies the same rule to the live row. It clears the flag at the existing reset points. The browser test in McpAppFrame.browser.test.tsx verifies the new behavior. The PR does not change clampMcpAppHeight, the status views, or the #35911 small-height behavior. The mobile summary states that inline size updates are ignored in fullscreen. The web summary does not state this. The previous review raised a possible fullscreen regression, where an inline 0 report followed by fullscreen could collapse the row. The incremental diff could not be read, so this point stays unverified. It is a possible regression, not a demonstrated unrelated change, so it does not change the verdict.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:M30-99 changed lines (additions + deletions).takeover:needs-juliusTakeover done; route gate says Julius decidesvouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every Datadog MCP call that returns no chart leaves an empty gray box in the thread. Datadog attaches its dataviz app (
ui://apps/dataviz) toexecute_codeandget_datadog_metric. When a result has no charts (_meta["datadog/inline-chart-collection"].entriesis[]), the app renders nothing and sendsui/notifications/size-changedwithheight: 0.clampMcpAppHeightraises that to the 80px minimum. The app's ownbodypaints a solid background, so each call becomes an 80px gray card with nothing in it. A busy Datadog turn stacks one per call, and they stay visible while "Worked for" is collapsed and after a reload.Fixes #38253.
Change
A height of 0 now collapses the app's row. Every other height sizes exactly as before.
clampMcpAppHeightand the 80px floor from feat: MCP apps render and run inline in threads #16236 are unchanged. Heights from 1 to 79 still round up to 80. The host now tracks one extra fact: the app's last inline report was<= 0.McpAppFrame): while that flag is set, the row is 0px tall and drops itsprefersBorderborder. The iframe stays mounted, so the app grows back when it reports content. The "left its page and was stopped" message ignores the flag and keeps its height. "Show app" after a close clears the flag, the same way it already resets the frame.ThreadMcpApp): same rule for the live WebView row. It is 0px with no bottom margin. The bridge-missing, navigated-away and crashed messages ignore the flag, and the closed and full-screen placeholders don't read it. The flag is cleared wherever the row already resets its height: app change, reopen, inline reload and process restart.Because the flag is separate from
height, every status view renders exactly as onmain.Scope
Fixes #38253. #38086 and #39961 make the same fix by changing
clampMcpAppHeightto return 0, which sends 0 into the status views and the reopen path that reuseheight. Those views then each needed their own floor. This PR leaves the clamp and those views alone, so it touches only the live app row. #35911 (small non-zero heights) is out of scope.Verification
Reproduced with Datadog's real app. The stub fixture in #39961 drew transparent blank space. This repro serves Datadog's own dataviz HTML (
dataviz-mcp-uiv35.156918072, which loads its bundle fromstatic.datadoghq.com) from a stdio MCP server. Itsexecute_codereturns the same shape as a stored Datadog result: a JSON text block,_meta["datadog/inline-chart-collection"].entries: [], and"openai/closeWidget": true. A Claude thread (claude-haiku-5-5, started witht3 thread start --wait) called it three times. I opened the thread on the dev web client in dark mode, at 1280×900 and 2x scale, and measured eachdataviz approw after the bundle loaded.main, d8b9253)[80, 80, 80]px[0, 0, 0]pxThe same thread and DB were used for both. Only
McpAppFrame.tsxwas toggled.Test. New browser test
collapses an app that reports no content until it reports someinMcpAppFrame.browser.test.tsx. The app setsprefersBorderand reports 0: the row must be 0px and the box must have no height, so no border line is left. It then reports 12, and the row must come back at 80px.McpAppFrame.tsxfrommain:Tests 1 failed | 5 passed (6).Tests 6 passed (6). The existing reopen and navigated-away tests pass unchanged.vp run check:changed: format, lint, knip, typecheck (3 packages), test and React Compiler (2 files) all pass.Not checked: mobile on a device or simulator. The mobile change mirrors the web rule, and the typecheck and React Compiler checks cover it.
Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.