Skip to content

feat(auth): offer 'Open Dash Wallet' on desktop, not just touch devices - #354

Open
PastaPastaPasta wants to merge 2 commits into
stagingfrom
t3code/add-open-dash-wallet-flow
Open

feat(auth): offer 'Open Dash Wallet' on desktop, not just touch devices#354
PastaPastaPasta wants to merge 2 commits into
stagingfrom
t3code/add-open-dash-wallet-flow

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

Problem

On yap.pr/staging/login, the Login with Wallet modal on desktop shows only a QR code, a countdown, and Copy URI. The copy tells you to "scan with a compatible Dash wallet, such as Dash Evo Tool" — but Dash Evo Tool is a desktop app, typically running on the very machine displaying the QR. The user is told to pick up a phone to reach a wallet that is one click away.

KeyExchangeQR already had an "Open in Wallet App" deep link, but it was gated behind window.matchMedia('(pointer: coarse)'), so it only ever rendered on phones and tablets.

Change

  • Render the Open Dash Wallet deep link (the dash-key: / dash-st: URI itself) on every device, not just coarse-pointer ones. Desktop OSes register custom URI schemes the same way mobile does.
  • Point the desktop instructions at a local wallet first, keeping the QR as the cross-device fallback.
  • Browsers give no signal when no app is registered for a scheme — the click just does nothing. So once the link has been clicked, a hint appears explaining the likely cause and pointing back at the QR code and Copy URI. It resets whenever a new request URI is generated (retry or expiry).

The same component backs the key-registration step, so that flow gets the deep link on desktop too.

Verification

  • npm run lint — clean (no new warnings; the remaining ones are pre-existing in unrelated files)
  • npm run build — succeeds, static export intact
  • Ran npm run dev and drove the real modal in a browser: the button renders above the QR with the live dash-key:…?n=t&v=1 URI, desktop wording reads "Open a wallet on this computer, such as Dash Evo Tool, or scan the QR code with a wallet on your phone", and the fallback hint appears after clicking.

No e2e run — this change touches neither feeds, posts, nor the auth paths the suite exercises (it is presentation-only within the QR component).

🤖 Generated with Claude Code

The wallet QR login gated its deep link behind a coarse-pointer check, so desktop users only ever saw the QR code. That is backwards for the wallet the copy actually names: Dash Evo Tool is a desktop app running on the same machine as the browser, so the user was told to scan a code with a phone to reach a wallet sitting one click away.

KeyExchangeQR now renders the 'Open Dash Wallet' deep link on every device and points the desktop instructions at a local wallet first. Because browsers stay silent when no app is registered for the scheme, a fallback hint appears once the link has been clicked, explaining the likely cause and pointing back at the QR code and Copy URI. The hint resets whenever a new request URI is generated.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 6ef3f51c-28f9-43db-8b41-41ab1f816c7a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw

thepastaclaw commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

⛔ Final review complete — 1 blocking finding(s) (commit f5efa76)

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 1, 2026

Copy link
Copy Markdown

Deploying yappr with  Cloudflare Pages  Cloudflare Pages

Latest commit: f5efa76
Status: ✅  Deploy successful!
Preview URL: https://b373260a.yappr.pages.dev
Branch Preview URL: https://t3code-add-open-dash-wallet.yappr.pages.dev

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 1, 2026

Copy link
Copy Markdown

Deploying yappr-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: f5efa76
Status: ✅  Deploy successful!
Preview URL: https://2fdf9b80.yappr-v2.pages.dev
Branch Preview URL: https://t3code-add-open-dash-wallet.yappr-v2.pages.dev

View logs

On a phone the deep link already hands the URI straight to the wallet, so Copy URI sits underneath it offering the strictly worse version of the same thing: copy this, go find your wallet, find its paste entry point. That manual path is what the deep link exists to avoid, and on a small screen it is pure clutter.

Copy URI is now desktop-only, and the no-handler fallback hint no longer suggests copying on touch devices, where the QR (scannable by a second device) is the remaining escape hatch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@PastaPastaPasta

Copy link
Copy Markdown
Owner Author

Follow-up per review feedback: on touch devices the deep link now replaces Copy URI rather than sitting above it.

On a phone the deep link already hands the URI straight to the wallet, so Copy URI offered the strictly worse version of the same action — copy this, go find your wallet, find its paste entry point. That manual path is exactly what the deep link exists to avoid, and on a small screen it was just clutter.

  • Copy URI is now desktop-only.
  • The "nothing opened?" fallback hint no longer suggests copying on touch devices; there the QR (scannable by a second device) is the remaining escape hatch.
  • Desktop is unchanged: button + QR + Copy URI.

Verification status, stated plainly: lint and build pass, and the desktop layout was confirmed live in a browser. I was not able to visually confirm the touch layout — the preview automation stopped being able to re-open the wallet modal partway through the session (viewport emulation timed out, and the modal would not mount on retry). The touch branch is gated on the same isTouchDevice flag that already correctly drives the instruction text, so I'm confident in it by inspection, but it has not been eyeballed on a real phone. Worth a quick look on device before merge.


🤖 Posted autonomously by Claude on behalf of pasta.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Final validation — GLM Flash + Sol

The desktop deep link, device-specific instructions, and request-reset behavior are consistent and preserve static-export compatibility. However, removing Copy URI on touch devices creates a blocking mobile authentication regression when no custom-scheme handler is registered; the existing login smoke path can also cover the new desktop controls.

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-5.6-sol (agent: phase2-reviewer, role: general); final verifier: gpt-5.6-sol (agent: sol-verifier, role: final-verifier)

Review provenance

  • Phase 1 reviewers (GLM Flash): glm-5.3-flash — general (completed); agent phase1-reviewer
  • Fresh verifier (Sol): gpt-5.6-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers (Sol): gpt-5.6-sol — general (completed); agent phase2-reviewer

🔴 1 blocking | 🟡 1 suggestion(s)

🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `components/auth/key-exchange-qr.tsx`:
- [BLOCKING] components/auth/key-exchange-qr.tsx:108: Preserve the same-device fallback after a touch launch attempt
  The `!isTouchDevice` condition removes Copy URI from every coarse-pointer device, including after the user clicks the deep link and the component warns that no wallet may be registered for `dash-key:` or `dash-st:`. In that case the link cannot transfer the request, and a phone cannot scan the QR code on its own screen. The pre-PR component and the earlier on-device-link change explicitly retained clipboard-based manual entry as the mobile fallback, so users whose wallet accepts a pasted URI but has no registered protocol handler now need a second device or cannot complete login or key registration. Keep the initial touch layout uncluttered, but reveal Copy URI after `launchAttempted` and update the touch fallback text to mention it.
- [SUGGESTION] components/auth/key-exchange-qr.tsx:72-79: Add smoke coverage for the desktop wallet deep link
  The PR's primary desktop behavior has no automated regression coverage even though `e2e/smoke/public-pages.spec.ts` already opens `/login/`. Extend that test to click “Login with Wallet (QR),” wait for the locally generated request, assert that “Open Dash Wallet” has a `dash-key:` href, and confirm that “Copy URI” is present in the desktop project. URI generation completes before response polling and requires no write credentials, so this exercises the new rendering without performing a Platform write.

)}
</button>
{/* Copy button — desktop only; the deep link supersedes it on touch */}
{!isTouchDevice && (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🔴 Blocking: Preserve the same-device fallback after a touch launch attempt

The !isTouchDevice condition removes Copy URI from every coarse-pointer device, including after the user clicks the deep link and the component warns that no wallet may be registered for dash-key: or dash-st:. In that case the link cannot transfer the request, and a phone cannot scan the QR code on its own screen. The pre-PR component and the earlier on-device-link change explicitly retained clipboard-based manual entry as the mobile fallback, so users whose wallet accepts a pasted URI but has no registered protocol handler now need a second device or cannot complete login or key registration. Keep the initial touch layout uncluttered, but reveal Copy URI after launchAttempted and update the touch fallback text to mention it.

Suggested change
{!isTouchDevice && (
{(!isTouchDevice || launchAttempted) && (

source: ['claude', 'codex']

Comment on lines +72 to +79
<a
href={uri}
onClick={() => setLaunchAttempted(true)}
className={cn(buttonVariants({ size: 'lg' }), 'w-full gap-2')}
>
<ArrowTopRightOnSquareIcon className="w-5 h-5" />
Open Dash Wallet
</a>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟡 Suggestion: Add smoke coverage for the desktop wallet deep link

The PR's primary desktop behavior has no automated regression coverage even though e2e/smoke/public-pages.spec.ts already opens /login/. Extend that test to click “Login with Wallet (QR),” wait for the locally generated request, assert that “Open Dash Wallet” has a dash-key: href, and confirm that “Copy URI” is present in the desktop project. URI generation completes before response polling and requires no write credentials, so this exercises the new rendering without performing a Platform write.

source: ['codex']

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