web: deep-link openApp/appArgs/autoOpen — pre-select and pre-fill an app from the URL (#1577)#1671
web: deep-link openApp/appArgs/autoOpen — pre-select and pre-fill an app from the URL (#1577)#1671cliffhall wants to merge 2 commits into
Conversation
…p from the URL (#1577) Closes #1577 Extends the deep link (#1576) to land on a rendered MCP App: - `&openApp=<toolName>` — once connected and the tool appears in the app list, InspectorView switches to the Apps tab and pre-selects it. - `&appArgs=<base64url(JSON)>` — pre-fills the tool form; values are merged **over** `collectSchemaDefaults()` so required-with-default fields don't disable "Open App". - `&autoOpen=<token>` — token-gated auto-click of "Open App". Adapted to the current architecture (differs from PR #1510's reference): - Tab state is lifted to App.tsx (#1417), so the openApp effect lives in InspectorView and drives `onActiveTabChange("Apps")` + `onAppsUiChange` seed + `onSelectApp`, guarded by `deepLinkOpenAppRef` to fire once. - AppsScreen owns the `running`/iframe state, so `autoOpen` is threaded to it as a prop; a fire-once effect defers the open one microtask past the synchronous effect body (satisfying `react-hooks/set-state-in-effect`, matching App.tsx's connect effect). `resetAppChannels` memoized so the effect's deps don't churn. Tests: InspectorView (tab-switch + pre-select + appArgs-over-defaults merge + non-app openApp ignored), AppsScreen (autoOpen fires once with seeded values; no-selection stays idle). README documents the params. Coverage gate green. Part of the #1579 decomposition (Wave 4). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
|
@claude review |
|
Claude finished @cliffhall's task in 2m 7s —— View job Review: deep-link
|
DeepLink.autoOpen is a non-optional boolean, so the `?? false` was dead once openApp was truthy. Collapse to Boolean(deepLink?.openApp && deepLink.autoOpen) — still false when there's no deep link, still gated on openApp so a malformed autoOpen-without-openApp link can't fire. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
|
Thanks — simplified the redundant @claude review |
|
Claude finished @cliffhall's task in 46s —— View job Re-review:
|
|
Superseded by the Wave 4 rollup #1676, which contains this change (reviewed to LGTM here) merged base→tip. Closing in favor of the rollup. |
Closes #1577
Summary
Extends the deep link to land on a rendered MCP App with one navigate + one click (or zero clicks with
autoOpen):&openApp=<toolName>— once connected and the tool appears in the app list, InspectorView switches to the Apps tab and pre-selects it.&appArgs=<base64url(JSON)>— pre-fills the tool form; values are merged overcollectSchemaDefaults()so required-with-default fields don't disable "Open App".&autoOpen=<token>— token-gated auto-click of "Open App".Adaptation notes (differs from PR #1510 reference)
InspectorViewand drivesonActiveTabChange("Apps")+onAppsUiChange(seed selection + merged form values) +onSelectApp, guarded bydeepLinkOpenAppRefto fire once.running/iframe state, soautoOpenis threaded to it as a prop. Its fire-once effect defers the open one microtask past the synchronous effect body — satisfyingreact-hooks/set-state-in-effectthe same way App.tsx's connect effect does.resetAppChannelsis memoized so the effect deps don't churn.Tests
appArgsmerged over schema defaults into the pre-filled form; a non-appopenAppis ignored (no tab switch).autoOpenfires once with the seeded values and mounts the renderer;autoOpenwith no selection stays idle.Coverage gate green (
npm run test:coverage, EXIT 0;AppsScreen.tsx97.7/96.3/100/100).Part of the #1579 decomposition (Wave 4). Per AGENTS.md the
Closesline won't auto-fire onv2/main; the issue is closed and its board card moved on the Wave 4 rollup merge.🤖 Generated with Claude Code