Skip to content

feat(login): clear the pairing QR once the phone scans it#402

Merged
UtkarshBhardwaj007 merged 1 commit into
mainfrom
feat/login-qr-disappears
Jun 16, 2026
Merged

feat(login): clear the pairing QR once the phone scans it#402
UtkarshBhardwaj007 merged 1 commit into
mainfrom
feat/login-qr-disappears

Conversation

@UtkarshBhardwaj007

Copy link
Copy Markdown
Member

What

playground login now clears the pairing QR from the terminal the moment the phone scans it and finishes signing in, leaving a clean logged-in summary.

Why

Previously the QR was either left on screen for the rest of setup, or — in an earlier attempt — rendered inside Ink's re-rendered region, which made the frame taller than the terminal. Ink then couldn't cursor back up to erase it and redrew the whole frame lower down, producing duplicated UI and lag.

How

  • The QR runs in a pre-Ink scan phase (qrScanPhase.ts): print the QR → await the scan + auth with a single in-place status line → erase the whole block with a cursor-up + clear-to-end sequence → then mount the (small) Ink result screen. Nothing tall ever enters Ink's re-rendered region, so duplication is impossible by construction.
  • The status line shows a friendly "syncing…" instead of the host's raw pending stage name (e.g. AllowanceAllocation).
  • Auth failures are captured and surfaced (with telemetry) rather than escaping as an unhandled rejection, and the QR is always erased even when login errors out.
  • QrLogin.tsx removed; LoginScreen now takes a pre-resolved address bundle + an explicit freshlyPaired flag.

Tests

  • qrScanPhase.test.ts (12 tests) covers the erase-sequence math, friendly status labels, pipe-safe (no ANSI off a TTY), the spinner timer being created and cleared (no event-loop leak), and that a mid-flight login rejection never throws and still erases the QR.
  • Full suite: 947 passing. format:check, lint:license, typecheck all green.

Notes

  • The erase assumes printed lines don't soft-wrap, which holds whenever the QR is wide enough to scan; on a terminal too narrow to show the QR (already unscannable) a few orphan rows may remain — benign, never the old duplication. Documented in code.
  • Dependency checks now run on the result screen rather than concurrently with the scan wait, keeping the QR screen minimal.

The QR now lives in a pre-Ink scan phase: it is printed, the phone
scan + auth is awaited with a single in-place status line, and the
whole block is erased with a cursor-up + clear-to-end sequence before
the result screen mounts. Nothing tall ever enters Ink's re-rendered
region, so the QR can no longer be stranded on screen or duplicate the
UI on shorter terminals.

The scan status line shows a friendly "syncing…" instead of the host's
raw pending stage name (e.g. "AllowanceAllocation"). Auth failures are
captured and surfaced rather than left as an unhandled rejection, and
the QR is always erased even when login errors out.

QrLogin is removed; LoginScreen now takes a pre-resolved address bundle
and an explicit freshlyPaired flag.
@UtkarshBhardwaj007 UtkarshBhardwaj007 merged commit cf00b8a into main Jun 16, 2026
16 of 20 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the feat/login-qr-disappears branch June 16, 2026 16:00
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

E2E Test Pass · ❌ FAIL

Tag: e2e-ci-pr · Branch: feat/login-qr-disappears · Commit: cb2f4d2 · Run logs

Cell Result Time
pr-mod ❌ FAIL 3m24s
pr-preflight ❌ FAIL 6m42s
pr-deploy-frontend ❌ FAIL 12m18s
pr-deploy-cdm ✅ PASS 4m24s
${{ matrix.cell }} ⏭️ SKIP -18m-13s
pr-deploy-foundry ✅ PASS 0m52s
pr-install ✅ PASS 1m37s
${{ matrix.cell }} ⏭️ SKIP -18m-15s
pr-login-session ✅ PASS 1m53s

Sentry traces: view spans for this run

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.

1 participant