Skip to content

feat(tangle-cloud): honor iframe requestConnect — open the parent wallet modal#3251

Merged
tangletools merged 4 commits into
developfrom
feat/iframe-request-connect-bridge
May 26, 2026
Merged

feat(tangle-cloud): honor iframe requestConnect — open the parent wallet modal#3251
tangletools merged 4 commits into
developfrom
feat/iframe-request-connect-bridge

Conversation

@drewstone
Copy link
Copy Markdown
Contributor

Lets an embedded blueprint initiate a wallet connection without breaking the sandbox model — the missing piece behind "connect inside the iframe doesn't do anything."

A sandboxed iframe can't reach a wallet extension, so it delegates to the parent via the new tangle.app.requestConnect (SDK side merged in blueprint-ui #22, published 0.5.2). The bridge:

  • answers immediately if a wallet is already connected;
  • otherwise opens the parent's wallet-connect modal (new app-level WalletConnectModalContext mounting one EvmWalletModal) and resolves the request when an account appears — or rejects it if the user dismisses the modal, so the iframe never hangs on its timeout.

Gated read-tier in policy (allowReadAccount). Protocol + validator mirror the SDK.

This is what makes both tiers connect from inside the iframe:

  • thin-iframe (e.g. llm-inference): useTangleWallet().connect();
  • full-iframe wagmi apps (ai-trading, ai-agent-sandbox): their own "Connect" → eth_requestAccounts on the parent-bridge connector now drives this.

Test plan

  • tsc --noEmit clean; protocol + policy specs green (16); full pre-push (lint/test/build) passed
  • Visual: embed a blueprint while disconnected → its connect opens the cloud wallet modal → connecting flows the account into the iframe

drewstone added 4 commits May 25, 2026 15:41
The Header computed breadcrumbs but never rendered them. Show the trail
("Blueprints / Trading") in the nav left slot by default, with the leading
"Cloud" dropped and section roots (Blueprints/Operators/Instances) linking
back. Pages can still override via useTopNavSlot; the blueprint detail now
injects a matching "Blueprints / <name>" trail alongside its Create/Details
actions instead of a "← Catalog" link.
The sandbox Button variant left dark, italic text on its purple fill
(unreadable). Render the Create action as an explicit styled link: white
text on a solid accent fill, non-italic, sized to match the Details button.
…xt module

The context module intentionally exports its Provider alongside its hooks;
the react-refresh/only-export-components rule doesn't apply. Disable it at
the two hook exports so the project lints clean.
…let modal

An embedded blueprint (sandboxed, no wallet of its own) can now ask the dapp
to connect a wallet via tangle.app.requestConnect. The bridge:

- answers immediately if a wallet is already connected;
- otherwise opens the parent's wallet-connect modal (new app-level
  WalletConnectModalContext mounting one EvmWalletModal) and resolves the
  request when an account appears — or rejects it if the user dismisses the
  modal, so the iframe never hangs.

Gated read-tier in policy (allowReadAccount). Protocol + validator mirror the
SDK's tangle.app.requestConnect / connectResult. This is what lets BOTH the
thin-iframe apps (useTangleWallet().connect()) and full-iframe wagmi apps
(eth_requestAccounts via the parent-bridge connector) connect from inside the
iframe without breaking the sandbox model.
@drewstone drewstone requested a review from AtelyPham as a code owner May 26, 2026 16:49
@tangletools tangletools merged commit a094f73 into develop May 26, 2026
@tangletools tangletools deleted the feat/iframe-request-connect-bridge branch May 26, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants