feat(apps): AppRenderer with imperative ref (#1262)#1282
feat(apps): AppRenderer with imperative ref (#1262)#1282
Conversation
Introduces a thin host-side shell for embedded MCP Apps. The renderer owns the iframe element and the AppBridge lifecycle; the wiring layer constructs the bridge from the active MCP Client via bridgeFactory and drives input/result/cancellation through the imperative ref handle. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@claude review |
|
I'll analyze this and get back to you. |
|
Claude finished @cliffhall's task in 1m 53s —— View job Code Review — AppRenderer (#1262)
Overall this is a clean, well-thought-out component. The lifecycle management is solid and the test suite is thorough. A few things worth discussing:
|
| Severity | Item |
|---|---|
| Medium | iframe missing sandbox attribute — worth a design decision before wiring lands |
| Low | teardown + unmount double-dispose race — benign now, worth fixing |
| Low | bridgeFactory stability not documented or enforced |
| Nit | Error story name shadows global |
| Nit | flushAsync missing comment on microtask count |
| Branch |

Summary
clients/web/src/components/elements/AppRenderer/— a thin host-side shell for embedded MCP Apps. Owns the iframe and theAppBridgelifecycle; delegates bridge construction to abridgeFactorycallback so the wiring layer can supply the active MCPClient,Implementation, and host capabilities.AppRendererHandle) exposessendToolInput,sendToolResult,sendToolCancelled, andteardownso the wiring layer drives the bridge without prop drilling.teardownResourceorcloserejects.Closes #1262.
Test plan
npm run validatefromclients/web/(format, lint, build, full coverage suite — 634 tests pass)🤖 Generated with Claude Code