Skip to content

fix(tangle-cloud): sync wallet to iframe on handshake + iframe fills its host#3242

Merged
tangletools merged 1 commit into
developfrom
fix/iframe-wallet-handshake-sync
May 25, 2026
Merged

fix(tangle-cloud): sync wallet to iframe on handshake + iframe fills its host#3242
tangletools merged 1 commit into
developfrom
fix/iframe-wallet-handshake-sync

Conversation

@drewstone
Copy link
Copy Markdown
Contributor

Two embed bugs surfaced by the LLM Inference blueprint app.

1. Iframe stuck at "no-wallet" (no handoff)

The parent broadcasts accountChanged / chainChanged / serviceContext only from mount effects, which fire before the iframe has loaded and attached its message listener. The handshake handler acked but didn't replay state, so a late-handshaking iframe received the ack (and the SDK's client stops its handshake retry on ack) yet never got the account → permanent no-wallet.

Now the handshake handler replays the current wallet + chain + service context from a live syncRef right after acking. This is the parent-side mirror of the client's handshake-retry hardening.

2. Iframe left dead space / page scrolled

The frame had a hard minHeight: 720px and no height: 100%, so on a tall viewport it sat short inside its calc(100vh-108px) container (gap below), and the page's pb-10 added more — making the parent scroll.

  • Frame now fills its host: height: 100%, rounded (12px), no min-height floor.
  • Host container gets a small padding gutter (p-2 md:p-3) + overflow-hidden, so the rounded iframe reads as a contained surface filling most of the parent.
  • Layout reclaims the page's bottom padding (-mb-10) so the parent doesn't scroll — only the app inside the iframe scrolls.

Shared by all iframe blueprint apps (AI Trading, AI Agent Sandbox, LLM Inference).

Test plan

  • tsc --noEmit -p tsconfig.app.json clean; full pre-push (lint/test/build) passed
  • Visual: embed an iframe blueprint in Tangle Cloud — wallet shows connected; frame fills the area with a small rounded gutter; no parent scroll

…its host

Two embed bugs surfaced by the LLM Inference app:

- Wallet never reached the iframe (stuck "no-wallet"). The parent broadcast
  accountChanged/chainChanged/serviceContext only from mount effects, which
  fire before the iframe has loaded and attached its listener. The handshake
  handler acked but didn't replay state, so a late-handshaking iframe got the
  ack (and stopped retrying) yet never the account. Now the handshake handler
  replays the current wallet + chain + service context from a live ref.

- The iframe left dead space and made the page scroll. It had a hard
  minHeight: 720px and no height:100%, so on tall viewports it sat short
  inside its container; the page's bottom padding added more. The frame now
  fills its host (height:100%, rounded), the host gets a small padding gutter
  + overflow-hidden, and the layout reclaims the page bottom padding so the
  parent doesn't scroll — only the app inside the iframe does.
@drewstone drewstone requested a review from AtelyPham as a code owner May 25, 2026 19:31
Copy link
Copy Markdown
Contributor

@tangletools tangletools left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handshake-replay is the correct parent-side mirror of the client retry; iframe fill + no-parent-scroll matches the shared layout. typecheck + pre-push green. Approving.

@tangletools tangletools merged commit 1dad90d into develop May 25, 2026
7 checks passed
@tangletools tangletools deleted the fix/iframe-wallet-handshake-sync branch May 25, 2026 19:31
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