-
Notifications
You must be signed in to change notification settings - Fork 13
Show success message after settle on coin control #157
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
Conversation
WalkthroughAdded success feedback to the Vtxos settings: imported Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Vtxos as Settings/Vtxos Component
participant Svc as settleVtxos()
User->>Vtxos: Click "Settle VTXOs"
Vtxos->>Svc: invoke settleVtxos()
Svc-->>Vtxos: resolve (success)
rect rgba(200,255,200,0.2)
Vtxos->>Vtxos: set success = true (showSuccess)
Vtxos-->>User: render green WarningBox ("Coins renewed successfully")
end
Note over Vtxos: effect clears success after 5s (cleanup on unmount)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)src/screens/Settings/Vtxos.tsx (2)
🔇 Additional comments (2)
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-bitcoin-v8 with
|
| Latest commit: |
98ebcb2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f3e807dc.wallet-v8.pages.dev |
| Branch Preview URL: | https://show-success-settle.wallet-v8.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: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/screens/Settings/Vtxos.tsx (1)
75-85: Reset success state when an error occurs.The
successstate is not cleared in the error handler. If a previous successful settle occurred, both the success message and error message will be displayed simultaneously, creating a confusing user experience.Apply this diff to reset the success state:
const handleRollover = async () => { try { + setSuccess(false) setRollingover(true) await settleVtxos(svcWallet) setRollingover(false) showSuccess() } catch (err) { setError(extractError(err)) + setSuccess(false) setRollingover(false) } }
🧹 Nitpick comments (1)
src/screens/Settings/Vtxos.tsx (1)
34-34: Thedurationstate appears unrelated to the PR objectives.The
durationstate is used for the Reminder component (line 182) and market hour calculations, which seems separate from the success message feature. Consider clarifying why this state was added in this PR, or move it to a separate commit for better separation of concerns.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/screens/Settings/Vtxos.tsx(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/screens/Settings/Vtxos.tsx (2)
src/lib/asp.ts (1)
settleVtxos(150-152)src/components/Warning.tsx (1)
WarningBox(12-38)
🔇 Additional comments (1)
src/screens/Settings/Vtxos.tsx (1)
23-23: LGTM! Success feedback implementation is well-structured.The addition of the
WarningBoximport,successstate, and conditional rendering provides clear user feedback after a successful settle operation. The approach aligns with the PR objectives.Also applies to: 41-41, 80-80, 128-128
|
utACK for me |
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: João Bordalo <bordalix@users.noreply.github.com>
Deploying wallet-signet with
|
| Latest commit: |
98ebcb2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a3a98150.wallet-23u.pages.dev |
| Branch Preview URL: | https://show-success-settle.wallet-23u.pages.dev |
Deploying wallet-mutinynet with
|
| Latest commit: |
98ebcb2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c2c85f6b.arkade-wallet.pages.dev |
| Branch Preview URL: | https://show-success-settle.arkade-wallet.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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/screens/Settings/Vtxos.tsx(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/screens/Settings/Vtxos.tsx (2)
src/lib/asp.ts (1)
settleVtxos(150-152)src/components/Warning.tsx (1)
WarningBox(12-38)
🪛 Biome (2.1.2)
src/screens/Settings/Vtxos.tsx
[error] 74-74: This hook is being called conditionally, but all hooks must be called in the exact same order in every component render.
Hooks should not be called after an early return.
For React to preserve state between calls, hooks needs to be called unconditionally and always in the same order.
See https://reactjs.org/docs/hooks-rules.html#only-call-hooks-at-the-top-level
(lint/correctness/useHookAtTopLevel)
Message stays for 5 seconds
Preview:
Screen.Recording.2025-10-13.at.16.29.10.mov
@tiero please review
Summary by CodeRabbit