Skip to content

qr code display for shares and group#12

Merged
AustinKelsay merged 1 commit intostagingfrom
feature/group-qr-code-display
Jan 2, 2026
Merged

qr code display for shares and group#12
AustinKelsay merged 1 commit intostagingfrom
feature/group-qr-code-display

Conversation

@AustinKelsay
Copy link
Copy Markdown
Member

@AustinKelsay AustinKelsay commented Jan 2, 2026

Summary by CodeRabbit

  • New Features

    • Credentials and group summaries can be shown as QR codes for easy sharing.
    • Interactive QR toggle (press Q) to show/hide QR codes when viewing results; raw-mode users see a prompt to finish with Enter.
  • Dependencies

    • Added qrcode library to enable terminal QR generation.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 2, 2026

📝 Walkthrough

Walkthrough

This PR adds terminal QR generation and display: new QRCodeDisplay and CredentialDisplay components, threads a showQR prop through keyset flows, adds keyboard toggles for QR visibility, and adds the qrcode dependency and its types.

Changes

Cohort / File(s) Summary
Package Configuration
package.json
Added runtime dependency qrcode (^1.5.4) and dev dependency @types/qrcode (^1.5.6).
New UI Components
src/components/ui/QRCodeDisplay.tsx, src/components/ui/CredentialDisplay.tsx
New QRCodeDisplay (async terminal QR generation, loading/error states) and CredentialDisplay (labeled credential rendering with optional QR).
Keyset UI Updates
src/components/keyset/KeysetCreate.tsx, src/components/keyset/KeysetLoad.tsx, src/components/keyset/ShareSaver.tsx
Threaded showQR prop; added qrVisible state and keyboard handlers (toggle 'q'/'Q' in raw mode); replaced direct credential text with CredentialDisplay; added QR hint text and finish prompt in raw/raw-mode flows.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant KeysetLoad
    participant ShareSaver
    participant CredentialDisplay
    participant QRCodeDisplay

    rect rgb(240,248,255)
    User->>KeysetLoad: Start keyset flow (flags include show-qr?)
    KeysetLoad->>KeysetLoad: init qrVisible from flags
    KeysetLoad->>ShareSaver: render with showQR prop
    end

    rect rgb(245,255,250)
    ShareSaver->>ShareSaver: init qrVisible from prop
    ShareSaver->>CredentialDisplay: render credential (showQR=false)
    CredentialDisplay->>User: display label + value
    end

    rect rgb(255,250,240)
    User->>ShareSaver: press 'q'/'Q'
    ShareSaver->>ShareSaver: toggle qrVisible
    ShareSaver->>CredentialDisplay: re-render (showQR=true)
    CredentialDisplay->>QRCodeDisplay: request QR for value
    QRCodeDisplay->>QRCodeDisplay: async qrcode.toString(...)
    QRCodeDisplay->>User: display terminal QR (or error/loading)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nibble bytes and weave a code,
A tiny QR in terminal mode—
Press Q to show, press Q to hide,
Hop, scan, and carry credentials wide. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'qr code display for shares and group' directly describes the main feature added in the PR: QR code display functionality for share and group credentials across multiple components.
✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@AustinKelsay
Copy link
Copy Markdown
Member Author

@CodeRabbit full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 2, 2026

✅ Actions performed

Full review triggered.

@AustinKelsay
Copy link
Copy Markdown
Member Author

@CodeRabbit full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 2, 2026

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/components/ui/QRCodeDisplay.tsx (1)

41-41: Consider using unknown instead of any for better type safety.

The catch block uses any for the error type. While functional, using unknown provides better type safety and is the recommended TypeScript practice.

🔎 Proposed refactor
-      } catch (err: any) {
+      } catch (err: unknown) {
         if (!canceled) {
-          setError(err?.message ?? 'Failed to generate QR code');
+          setError(err instanceof Error ? err.message : 'Failed to generate QR code');
           setQrString(null);
         }
       }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3564c2e and 294a6f2.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • package.json
  • src/components/keyset/KeysetCreate.tsx
  • src/components/keyset/KeysetLoad.tsx
  • src/components/keyset/ShareSaver.tsx
  • src/components/ui/CredentialDisplay.tsx
  • src/components/ui/QRCodeDisplay.tsx
🧰 Additional context used
📓 Path-based instructions (6)
src/**/*.tsx

📄 CodeRabbit inference engine (CLAUDE.md)

Use Ink components (, , etc.) for terminal UI and do not use HTML elements

Files:

  • src/components/keyset/KeysetLoad.tsx
  • src/components/ui/QRCodeDisplay.tsx
  • src/components/keyset/ShareSaver.tsx
  • src/components/keyset/KeysetCreate.tsx
  • src/components/ui/CredentialDisplay.tsx
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

All import specifiers must include .js extensions (TypeScript ESM requirement) even though source files are .ts/.tsx

Files:

  • src/components/keyset/KeysetLoad.tsx
  • src/components/ui/QRCodeDisplay.tsx
  • src/components/keyset/ShareSaver.tsx
  • src/components/keyset/KeysetCreate.tsx
  • src/components/ui/CredentialDisplay.tsx
src/components/**

📄 CodeRabbit inference engine (CLAUDE.md)

All UI components should live under src/components/

Files:

  • src/components/keyset/KeysetLoad.tsx
  • src/components/ui/QRCodeDisplay.tsx
  • src/components/keyset/ShareSaver.tsx
  • src/components/keyset/KeysetCreate.tsx
  • src/components/ui/CredentialDisplay.tsx
src/components/**/*.tsx

📄 CodeRabbit inference engine (CLAUDE.md)

When adding a new command, implement it as a component under src/components/

Store reusable UI components under src/components/

Files:

  • src/components/keyset/KeysetLoad.tsx
  • src/components/ui/QRCodeDisplay.tsx
  • src/components/keyset/ShareSaver.tsx
  • src/components/keyset/KeysetCreate.tsx
  • src/components/ui/CredentialDisplay.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use TypeScript with ESM, 2-space indentation, single quotes, and trailing commas
Order imports from shallow-to-deep
Use camelCase for utility function and variable names
Use SCREAMING_SNAKE_CASE for constants

Files:

  • src/components/keyset/KeysetLoad.tsx
  • src/components/ui/QRCodeDisplay.tsx
  • src/components/keyset/ShareSaver.tsx
  • src/components/keyset/KeysetCreate.tsx
  • src/components/ui/CredentialDisplay.tsx
src/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Name React components using PascalCase

Files:

  • src/components/keyset/KeysetLoad.tsx
  • src/components/ui/QRCodeDisplay.tsx
  • src/components/keyset/ShareSaver.tsx
  • src/components/keyset/KeysetCreate.tsx
  • src/components/ui/CredentialDisplay.tsx
🧠 Learnings (5)
📚 Learning: 2025-10-08T16:24:14.475Z
Learnt from: CR
Repo: FROSTR-ORG/igloo-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-08T16:24:14.475Z
Learning: Applies to src/keyset/**/*.ts : Document non-obvious flows with concise comments, especially around key lifecycle management

Applied to files:

  • src/components/keyset/KeysetLoad.tsx
  • src/components/keyset/KeysetCreate.tsx
📚 Learning: 2025-10-08T16:24:14.475Z
Learnt from: CR
Repo: FROSTR-ORG/igloo-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-08T16:24:14.475Z
Learning: Applies to src/keyset/**/*.ts : Keep key exchange and credential helpers under src/keyset/

Applied to files:

  • src/components/keyset/KeysetLoad.tsx
  • src/components/keyset/ShareSaver.tsx
📚 Learning: 2025-10-03T23:45:30.161Z
Learnt from: CR
Repo: FROSTR-ORG/igloo-cli PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-10-03T23:45:30.161Z
Learning: Applies to src/**/*.tsx : Use Ink components (<Box>, <Text>, etc.) for terminal UI and do not use HTML elements

Applied to files:

  • src/components/keyset/KeysetLoad.tsx
  • src/components/ui/QRCodeDisplay.tsx
  • src/components/keyset/ShareSaver.tsx
  • src/components/ui/CredentialDisplay.tsx
📚 Learning: 2025-10-08T16:24:14.475Z
Learnt from: CR
Repo: FROSTR-ORG/igloo-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-08T16:24:14.475Z
Learning: Applies to src/cli.tsx : Keep the CLI entrypoint in src/cli.tsx and use it to bootstrap Ink rendering

Applied to files:

  • src/components/keyset/KeysetLoad.tsx
  • src/components/ui/QRCodeDisplay.tsx
  • package.json
📚 Learning: 2025-10-03T23:45:30.161Z
Learnt from: CR
Repo: FROSTR-ORG/igloo-cli PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-10-03T23:45:30.161Z
Learning: Applies to src/App.tsx : Extract flags from props in App.tsx and pass them to command components; add validation/defaults as needed

Applied to files:

  • src/components/keyset/KeysetLoad.tsx
  • src/components/keyset/KeysetCreate.tsx
🧬 Code graph analysis (3)
src/components/keyset/KeysetLoad.tsx (1)
src/components/ui/CredentialDisplay.tsx (1)
  • CredentialDisplay (13-31)
src/components/keyset/ShareSaver.tsx (1)
src/components/ui/CredentialDisplay.tsx (1)
  • CredentialDisplay (13-31)
src/components/ui/CredentialDisplay.tsx (1)
src/components/ui/QRCodeDisplay.tsx (1)
  • QRCodeDisplay (12-78)
🔇 Additional comments (12)
src/components/keyset/KeysetCreate.tsx (1)

133-133: LGTM!

The QR flag extraction and propagation to ShareSaver is clean and follows established patterns for flag handling in this codebase.

Also applies to: 499-499

src/components/ui/CredentialDisplay.tsx (1)

1-31: LGTM!

This component is well-structured and follows all coding guidelines:

  • Proper .js extensions on imports (ESM requirement)
  • Uses Ink components exclusively (no HTML)
  • TypeScript types are clean
  • PascalCase naming convention
  • Sensible default props
  • Clean conditional QR rendering
src/components/keyset/KeysetLoad.tsx (1)

2-2: LGTM!

The QR display integration is well-implemented:

  • Proper imports with .js extensions
  • Clean state management for QR visibility initialized from flags
  • Keyboard toggle (Q key) properly scoped to result phase with raw mode
  • Consistent use of CredentialDisplay for both share and group credentials
  • Helpful user guidance for QR toggle
  • Finish prompt appropriately conditioned on raw mode support

The implementation follows Ink patterns and integrates cleanly with existing automation and exit flows.

Also applies to: 6-6, 30-32, 147-151, 289-305, 336-352

src/components/keyset/ShareSaver.tsx (1)

2-2: LGTM!

The QR display integration in ShareSaver is well-executed:

  • Proper imports with .js extensions
  • Clean prop threading with sensible default (showQR = false)
  • State management initialized from props
  • Keyboard toggle (Q key) properly scoped to interactive mode
  • DRY principle applied to qrHint definition and reuse
  • Consistent use of CredentialDisplay across all credential blocks
  • Appropriate color coding (cyanBright for shares, magentaBright for group)
  • QR hint consistently rendered across all phases when prompting is enabled

The implementation integrates seamlessly with existing automation and prompting logic.

Also applies to: 18-18, 31-31, 48-48, 59-59, 92-100, 103-119, 125-132, 397-397, 410-410, 430-430

package.json (1)

37-37: No action needed. Both qrcode (1.5.4) and @types/qrcode (1.5.6) exist on npm and are free from known vulnerabilities. These are the latest available versions.

src/components/ui/QRCodeDisplay.tsx (7)

5-10: LGTM!

The type definition is clean, properly structured, and follows TypeScript naming conventions.


12-17: LGTM!

Component declaration follows React and project conventions. Default values are sensible for terminal QR code display.


18-19: LGTM!

State declarations are properly typed and follow naming conventions.


21-52: Well-implemented async effect with proper cleanup.

The useEffect implementation correctly handles asynchronous QR code generation with a cancellation pattern that prevents state updates after unmount. The early return guard and error handling are well-structured.


54-61: LGTM!

Error state rendering properly uses Ink components and provides clear feedback with appropriate styling.

Based on learnings: "Use Ink components (, , etc.) for terminal UI and do not use HTML elements"


63-70: LGTM!

Loading state rendering provides good user feedback and correctly uses Ink components.


72-77: LGTM!

Success state rendering is clean and consistent with the component's other rendering states.

@AustinKelsay AustinKelsay merged commit 4e732cc into staging Jan 2, 2026
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jan 5, 2026
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