fedimint / ui

MIT License
23 stars 35 forks source link

Qr scanners and codes for passing around guardian links / verification codes. #435

Open Kodylow opened 1 month ago

Kodylow commented 1 month ago

We had a workshop at BTC prague where a bunch of people tried running the guardian setup on their phones and passing around the codes was a total pain. This adds qr scanning and qr codes for all the inputs/fields that need to get passed around between the guardians.

Summary by CodeRabbit

coderabbitai[bot] commented 1 week ago
Walkthrough ## Walkthrough This update introduces significant enhancements to the `guardian-ui` application, including QR code generation and scanning capabilities. It adds new modal components for displaying and scanning QR codes, integrates QR functionalities into existing features, and improves overall usability with new icons and state management. Dependencies and utility functions are also updated to support these features. ## Changes | File Path | Change Summary | |-----------|----------------| | `.../guardian-ui/package.json` | Added `qr-scanner` package. | | `.../InviteCode.tsx` | Changed QR code size import source. | | `.../QrModal.tsx`, `.../QrScannerModal.tsx`, `.../Scanner.tsx` | Added components for QR code display and scanning. | | `.../ConnectGuardians.tsx`, `.../BasicSettingsForm.tsx` | Integrated QR code features into existing components. | | `.../ConfirmFollowersConnected.tsx`, `.../VerifyGuardians.tsx` | Added new components for follower confirmation with QR code scanning. | | `.../languages/en.json` | Added new translation key for QR scanning. | | `.../utils/index.ts` | Added `QR_CODE_SIZE` constant and updated `bftHonest` function. | | `flake.nix` | Updated `fedimint` URL to a specific revision. | | `scripts/mprocs-nix.sh` | Modified `FM_TEST_DIR` export for better robustness. |

Recent review details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between 56c2425cfc1fdddb0bf41eb917cc01b459720f4a and fe221ca4eed73c1fbd3d594c62a9f7572f1bdc66.
Files ignored due to path filters (3) * `apps/guardian-ui/src/assets/svgs/scan.svg` is excluded by `!**/*.svg` * `flake.lock` is excluded by `!**/*.lock` * `yarn.lock` is excluded by `!**/yarn.lock`, `!**/*.lock`
Files selected for processing (13) * apps/guardian-ui/package.json (1 hunks) * apps/guardian-ui/src/components/dashboard/admin/InviteCode.tsx (1 hunks) * apps/guardian-ui/src/components/setup/qr/QrModal.tsx (1 hunks) * apps/guardian-ui/src/components/setup/qr/QrScannerModal.tsx (1 hunks) * apps/guardian-ui/src/components/setup/qr/Scanner.tsx (1 hunks) * apps/guardian-ui/src/components/setup/screens/connectGuardians/ConnectGuardians.tsx (5 hunks) * apps/guardian-ui/src/components/setup/screens/setConfiguration/BasicSettingsForm.tsx (4 hunks) * apps/guardian-ui/src/components/setup/screens/verifyGuardians/ConfirmFollowersConnected.tsx (1 hunks) * apps/guardian-ui/src/components/setup/screens/verifyGuardians/VerifyGuardians.tsx (7 hunks) * apps/guardian-ui/src/languages/en.json (1 hunks) * apps/guardian-ui/src/utils/index.ts (1 hunks) * flake.nix (1 hunks) * scripts/mprocs-nix.sh (1 hunks)
Files skipped from review due to trivial changes (1) * apps/guardian-ui/src/utils/index.ts
Files skipped from review as they are similar to previous changes (9) * apps/guardian-ui/package.json * apps/guardian-ui/src/components/dashboard/admin/InviteCode.tsx * apps/guardian-ui/src/components/setup/qr/QrModal.tsx * apps/guardian-ui/src/components/setup/qr/QrScannerModal.tsx * apps/guardian-ui/src/components/setup/qr/Scanner.tsx * apps/guardian-ui/src/components/setup/screens/connectGuardians/ConnectGuardians.tsx * apps/guardian-ui/src/components/setup/screens/setConfiguration/BasicSettingsForm.tsx * apps/guardian-ui/src/components/setup/screens/verifyGuardians/ConfirmFollowersConnected.tsx * apps/guardian-ui/src/components/setup/screens/verifyGuardians/VerifyGuardians.tsx
Additional context used
Shellcheck
scripts/mprocs-nix.sh
[warning] 12-12: Declare and assign separately to avoid masking return values. (SC2155)
Additional comments not posted (2)
flake.nix (1)
`6-6`: **LGTM!** The URL for the `fedimint` dependency has been updated to include a specific revision for a backported fix.
apps/guardian-ui/src/languages/en.json (1)
`271-271`: **LGTM!** The new translation key `"scanning-guardian": "Scan QR for {{guardian}}"` follows the existing format and appears correct.
---
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
Kodylow commented 1 week ago

Note: getting this annoying play() error being called during state change error that I can't pin down, it still works it just throws the runtime error when you open the QRScanner and you click out of it and it works.

@IroncladDev @alexlwn123 wizards plz help

IroncladDev commented 1 week ago

I'll take a look in a bit. I have a bunch of high-priority tickets on my sprint board right now.