feat(login): clear the pairing QR once the phone scans it#402
Merged
Conversation
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.
Contributor
E2E Test Pass · ❌ FAILTag:
Sentry traces: view spans for this run |
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
playground loginnow 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
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.AllowanceAllocation).QrLogin.tsxremoved;LoginScreennow takes a pre-resolved address bundle + an explicitfreshlyPairedflag.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.format:check,lint:license,typecheckall green.Notes