Skip to content

feat(ui): engineer QR code expiration and staleness visualization #14

Description

@0dillon

Summary

SEP-0007 payment URIs embed an exchange rate that is only cryptographically valid for a narrow window (e.g., 5 minutes). Currently, the QR code remains on screen indefinitely, leading customers to scan expired codes and triggering confusing payment failures on the backend.

We must implement a highly visible, real-time expiration visualizer. This involves a shrinking progress bar anchored below the QR code. Once the TTL (Time To Live) expires, the QR code must be aggressively hidden and replaced with an overlay prompting the merchant to 'Tap to Refresh Rate'. The StalenessIndicator component must also be refactored to eliminate hydration mismatch errors.

Acceptance Criteria

  • Build a deterministic countdown timer synchronized with the rate TTL.
  • Implement a shrinking progress bar component to visualize remaining time.
  • Replace the QR code with a refresh overlay exactly when the timer hits zero.
  • Fix all server/client hydration errors related to Date.now() calculations.

Tech Stack

Next.js 14, React, Tailwind CSS.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions