-
Notifications
You must be signed in to change notification settings - Fork 13
Keep tab open #195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep tab open #195
Conversation
WalkthroughReplaces react-qr-reader with qr-scanner, adds a ScannerQr implementation with camera checks and error handling, corrects JSX Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ScannerComponent as Scanner
participant QrScannerLib as QrScanner
participant VideoElement as Video
User->>ScannerComponent: Open scanner (QR mode)
ScannerComponent->>QrScannerLib: QrScanner.hasCamera()
alt camera available
QrScannerLib-->>ScannerComponent: true
ScannerComponent->>VideoElement: render video element
ScannerComponent->>QrScannerLib: new QrScanner(video, onDecode)
QrScannerLib->>QrScannerLib: start()
QrScannerLib->>ScannerComponent: onDecode(result)
ScannerComponent->>User: call onData(result)
ScannerComponent->>QrScannerLib: stop()/destroy()
else no camera
QrScannerLib-->>ScannerComponent: false
ScannerComponent->>User: call onError(cameraUnavailable)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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. Comment |
Deploying wallet-signet with
|
| Latest commit: |
92e55c0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bb8722d4.wallet-23u.pages.dev |
| Branch Preview URL: | https://keep-tab-open.wallet-23u.pages.dev |
Deploying wallet-mutinynet with
|
| Latest commit: |
92e55c0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4c48d556.arkade-wallet.pages.dev |
| Branch Preview URL: | https://keep-tab-open.arkade-wallet.pages.dev |
Deploying wallet-bitcoin with
|
| Latest commit: |
92e55c0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://70a58b34.wallet-bitcoin.pages.dev |
| Branch Preview URL: | https://keep-tab-open.wallet-bitcoin.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/screens/Wallet/Receive/QrCode.tsx (1)
128-128: Improve message text and use consistent styling.The warning message has minor text quality issues and should use the
Textcomponent for consistency with the rest of the codebase.Apply this diff to improve the message:
- {invoice ? <p>for Lightning keep this tab open</p> : null} + {invoice ? <Text centered>For Lightning payments, keep this tab open</Text> : null}src/components/Scanner.tsx (1)
62-62: Consider reducing maxScansPerSecond for better performance.Setting
maxScansPerSecond: 1000is excessive and may unnecessarily consume CPU resources. QR codes are typically scanned within 1-5 attempts per second.Apply this diff to use a more reasonable value:
{ - maxScansPerSecond: 1000, + maxScansPerSecond: 5, highlightScanRegion: true, onDecodeError: () => {}, },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
package.json(1 hunks)src/components/ButtonsOnBottom.tsx(1 hunks)src/components/Header.tsx(1 hunks)src/components/Scanner.tsx(3 hunks)src/screens/Settings/Vtxos.tsx(1 hunks)src/screens/Wallet/Receive/QrCode.tsx(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/components/Scanner.tsx (6)
src/lib/error.ts (1)
extractError(1-10)src/components/Content.tsx (1)
Content(9-16)src/components/Padded.tsx (1)
Padded(7-14)src/components/Error.tsx (1)
ErrorMessage(10-21)src/components/ButtonsOnBottom.tsx (1)
ButtonsOnBottom(10-26)src/components/Button.tsx (1)
Button(20-62)
🔇 Additional comments (6)
src/components/ButtonsOnBottom.tsx (1)
19-19: LGTM: Correct JSX attribute fix.The change from
classtoclassNameproperly aligns with React/JSX conventions.src/screens/Settings/Vtxos.tsx (1)
162-162: LGTM: Correct JSX attribute fix.The change from
classtoclassNameproperly aligns with React/JSX conventions.src/components/Header.tsx (1)
45-45: LGTM: Correct JSX attribute fix.The change from
classtoclassNameproperly aligns with React/JSX conventions.src/components/Scanner.tsx (2)
12-16: LGTM: Well-defined video styling.The videoStyle constant is properly defined and provides consistent styling for the video element.
27-38: LGTM: Clean scanner implementation switching.The implementation switching logic between qrscanner and mills is well-structured and allows users to switch between scanner implementations.
package.json (1)
26-26: No issues found—qr-scanner is current and has no security vulnerabilities.The latest version of qr-scanner is 1.4.2, which matches the version specified in package.json. No security vulnerabilities were reported for this package. The dependency is in good standing and no updates are necessary.
Signed-off-by: Marco Argentieri <3596602+tiero@users.noreply.github.com>
Warn users to keep tab open if receiving in lightning
@tiero please review
Closes #193
Summary by CodeRabbit
New Features
Bug Fixes