feat(shell): push project switches to embedded apps over the live bridge - #14
Merged
Conversation
Selecting a project in the shell switcher must reach an embedded project-scoped app (Projects) without tearing down its iframe. - bridge.ts: add setProject() — updates the live bridge identity and re-sends welcome at the NEGOTIATED protocol version (mirrors setTheme). Recreating the bridge instead would send a proactive welcome at the un-negotiated host version, which a v1 app-broker silently drops. - IframeHost.tsx: stop tearing down the bridge on project change (removed `project` from the creation deps); push it live via a setProject effect. - context.tsx: register Projects as a first-party iframe built-in app. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Lets the shell's project switcher reach an embedded project-scoped app (Projects) live, and registers Projects as a built-in iframe app.
Why
Project switches recreated the bridge, whose proactive
welcomegoes out at the un-negotiated host protocol version (v2) and a v1 app-broker silently drops it — so the embedded app never learned the new project.Changes
bridge.ts: newsetProject()updates the live bridge identity and re-sendswelcomeat the negotiated protocol version (mirrorssetTheme).IframeHost.tsx: removedprojectfrom the bridge-creation deps (no more teardown on switch); push it live via asetProjecteffect.context.tsx: register Projects as afirst-partyiframebuilt-in.Depends on
BridgeIdentity.project+subscribeBrokeredIdentity(needs publish before this works in prod).Verification
Playwright-verified: No-project ↔ My-Workspace switching updates the embedded iframe without reloading it (same iframe element throughout).
🤖 Generated with Claude Code