You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request adds a new "Reset stocks" feature to the developer mock-accounts tooling in Ledger Live Desktop. This allows developers to easily remove all stock token sub-accounts from their portfolio without affecting other holdings. The implementation includes UI changes, supporting logic, and related tests.
Feature: Reset stocks button in developer tooling
Added a "Reset stocks" button to the mock-accounts developer section, enabling removal of all stock token sub-accounts while preserving other accounts. The button is conditionally enabled and provides user feedback if no stock accounts are present.
Supporting logic and utilities
Implemented countStockTokenAccounts and removeStockAccounts utility functions to count and remove stock token accounts, respectively, ensuring accurate state updates and handling edge cases (such as empty portfolios).
Added unit tests for countStockTokenAccounts to verify correct behavior.
❓ Context
🧐 Checklist for the PR Reviewers
The code aligns with the requirements described in the linked JIRA or GitHub issue.
The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
There are no undocumented trade-offs, technical debt, or maintainability issues.
The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
Any new dependencies have been justified and documented.
Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a “Reset stocks” action to Ledger Live Desktop’s developer mock-accounts tooling, intended to remove stock token sub-accounts from the portfolio while keeping other holdings intact.
Changes:
Added new i18n strings for “Reset stocks” and associated confirmation/empty-state alerts.
Introduced utilities to count and remove stock token accounts, and wired a new reset button into the developer settings UI.
Added a unit test for stock token account counting, plus a changeset for the desktop app.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
File
Description
apps/ledger-live-desktop/static/i18n/en/app.json
Adds UI strings for the new reset-stocks action and alerts.
Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✅ Checklist
npx changesetwas attached.📝 Description
This pull request adds a new "Reset stocks" feature to the developer mock-accounts tooling in Ledger Live Desktop. This allows developers to easily remove all stock token sub-accounts from their portfolio without affecting other holdings. The implementation includes UI changes, supporting logic, and related tests.
Feature: Reset stocks button in developer tooling
Supporting logic and utilities
countStockTokenAccountsandremoveStockAccountsutility functions to count and remove stock token accounts, respectively, ensuring accurate state updates and handling edge cases (such as empty portfolios).countStockTokenAccountsto verify correct behavior.❓ Context
🧐 Checklist for the PR Reviewers