Skip to content

Sort virtual coins by value asc - #457

Merged
bordalix merged 1 commit into
masterfrom
sort-vcoins
Mar 23, 2026
Merged

bordalix merged 1 commit into
masterfrom
sort-vcoins

Conversation

@pietro909

@pietro909 pietro909 commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Virtual coins are now sorted by ascending value when displayed, ensuring consistent organization of assets.

@coderabbitai

coderabbitai Bot commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f4ff5657-a622-434b-b07f-df5b85f7a1e8

📥 Commits

Reviewing files that changed from the base of the PR and between 8914b19 and 402bf39.

📒 Files selected for processing (1)
  • src/screens/Settings/Vtxos.tsx

Walkthrough

The component now sorts virtual coins (vtxos) fetched from svcWallet.getVtxos() by ascending value before storing them in state, rather than storing the unsorted data directly. Error handling and control flow remain unchanged.

Changes

Cohort / File(s) Summary
Vtxos Data Sorting
src/screens/Settings/Vtxos.tsx
Added sorting of fetched vtxos by ascending value before state update. Data is copied and ordered via setAllVtxos(ordered) instead of storing unsorted vtxosData directly.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 'Sort virtual coins by value asc' directly and accurately describes the main change: implementing ascending value sorting for virtual coins in the Vtxos component.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sort-vcoins
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying wallet-bitcoin with  Cloudflare Pages  Cloudflare Pages

Latest commit: 402bf39
Status: ✅  Deploy successful!
Preview URL: https://eb0b94f6.wallet-bitcoin.pages.dev
Branch Preview URL: https://sort-vcoins.wallet-bitcoin.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying wallet-mutinynet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 402bf39
Status: ✅  Deploy successful!
Preview URL: https://22d31942.arkade-wallet.pages.dev
Branch Preview URL: https://sort-vcoins.arkade-wallet.pages.dev

View logs

@pietro909
pietro909 requested review from bordalix and tiero March 20, 2026 15:07
@ghost

ghost commented Mar 20, 2026

Copy link
Copy Markdown

🔍 Arkana PR Review

Overall: ✅ Clean and straightforward

Small, focused change — sorts VTXOs by ascending value in the settings view.

Review Notes

  1. Correctness: a.value - b.value is fine for numeric sorting. Since VTXO values are satoshi amounts (positive integers), there are no floating-point precision issues.

  2. Immutability: Good use of spread ([...vtxosData]) to avoid mutating the original array before passing it to state.

  3. Minor consideration: This sorts at fetch time only. If VTXOs are updated elsewhere (e.g., via polling), the sort order is preserved since setAllVtxos is only called here. No issue currently.

  4. UX note: Ascending order (smallest first) is a reasonable default for a settings/debug view. Users typically want to see dust and small VTXOs first when inspecting.

No security concerns. No protocol impact. LGTM. 👍

@bordalix
bordalix merged commit 67d4512 into master Mar 23, 2026
5 checks passed
@pietro909
pietro909 deleted the sort-vcoins branch March 23, 2026 10:15
TaprootFreak pushed a commit to TaprootFreak/wallet that referenced this pull request Mar 27, 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.

2 participants