Skip to content

[LWDM] fix(settings): list hidden native coins in accounts settings - #20350

Open
mcayuelas-ledger wants to merge 1 commit into
developfrom
fix/settings-hidden-assets-not-listed
Open

[LWDM] fix(settings): list hidden native coins in accounts settings#20350
mcayuelas-ledger wants to merge 1 commit into
developfrom
fix/settings-hidden-assets-not-listed

Conversation

@mcayuelas-ledger

@mcayuelas-ledger mcayuelas-ledger commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • Settings > Accounts > Hidden tokens: hidden native coins (e.g. Bitcoin) now appear and can be unhidden, alongside hidden tokens.
    • Robustness of the hidden list when one token id fails to resolve via CAL (the rest of the list is preserved).
    • Ledger Wallet Mobile equivalent screen (Settings > Accounts) rendering of the same list.

📝 Description

Assets hidden from the asset detail page (options menu) are stored in settings.blacklistedTokenIds using the plain currency.id. Since hiding is enabled for any asset type, that id can be a native coin (e.g. bitcoin) as well as a token (e.g. ethereum/erc20/usdt).

The Settings > Accounts > "Hidden tokens" list resolved every stored id exclusively through the CAL token lookup (findTokenById), so native coin ids resolved to undefined and were silently dropped: the row showed a count and chevron (driven by blacklistedTokenIds.length) but expanded to an empty dropdown. Worse, the lookups ran inside a single Promise.all, so one failing/rejected CAL lookup discarded the entire list, hiding genuinely hidden tokens too.

loadBlacklistedTokenSections now resolves each id as a native coin from the crypto registry first (no network call), falling back to the CAL token lookup only for unresolved ids, with each lookup isolated via .catch(() => undefined). Native coins are grouped under their own currency header; tokens under their parent. The desktop and mobile hidden-lists were widened from TokenCurrency to CryptoOrTokenCurrency accordingly, and the settings description was updated to mention hiding an asset from its detail page.

Screen.Recording.2026-08-03.at.16.52.08.mov

❓ 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)

Copilot AI review requested due to automatic review settings August 3, 2026 14:59
@live-github-bot live-github-bot Bot added desktop Has changes in LLD mobile Has changes in LLM common Has changes in live-common translations Translation files have been touched labels Aug 3, 2026
@live-github-bot live-github-bot Bot changed the title fix(settings): list hidden native coins in accounts settings [LWDM] fix(settings): list hidden native coins in accounts settings Aug 3, 2026
@mcayuelas-ledger
mcayuelas-ledger marked this pull request as ready for review August 3, 2026 15:00
@mcayuelas-ledger
mcayuelas-ledger requested a review from a team as a code owner August 3, 2026 15:00
LucasWerey
LucasWerey previously approved these changes Aug 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the “Hidden tokens” settings list so it correctly surfaces hidden native coins (stored as plain currency.id) alongside hidden tokens, and makes token resolution more robust by preventing a single failing CAL lookup from discarding the whole list. The change is implemented in live-common and propagated to both Desktop and Mobile settings screens, with updated tests and copy.

Changes:

  • Update loadBlacklistedTokenSections to resolve native coins from the crypto registry first, then fall back to CAL token lookup with per-id failure isolation.
  • Widen Desktop/Mobile settings UI types from TokenCurrency to CryptoOrTokenCurrency and render the expanded list accordingly.
  • Update Desktop settings description copy + add/adjust unit tests; add a changeset.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
libs/ledger-live-common/src/account/helpers.ts Resolve hidden ids as native coins first, then tokens via CAL with isolated error handling; group into parent sections.
libs/ledger-live-common/src/account/helpers.test.ts Update assertions for assets and add coverage for native coin resolution + isolated CAL failures.
apps/ledger-live-mobile/src/screens/Settings/Accounts/index.tsx Widen list item type to CryptoOrTokenCurrency and map assets to SectionList rows.
apps/ledger-live-desktop/static/i18n/en/app.json Update the settings description to mention hiding from asset detail page options menu.
apps/ledger-live-desktop/src/renderer/screens/settings/sections/Accounts/BlacklistedTokens.tsx Widen list rendering from tokens-only to CryptoOrTokenCurrency items.
apps/ledger-live-desktop/src/renderer/screens/settings/sections/Accounts/BlacklistedTokens.test.tsx Update copy expectation and add coverage for rendering a hidden native coin without CAL calls.
.changeset/wild-donkeys-hunt.md Changeset describing the fix and impacted packages.

Comment on lines 5513 to 5516
"title": "Hidden tokens",
"desc": "You can hide tokens by going to the parent account then right-clicking on the token and selecting 'Hide token'.",
"desc": "You can hide an asset from its detail page using the options menu, or hide a token by going to the parent account then right-clicking on the token and selecting 'Hide token'.",
"count": "1 token",
"count_other": "{{count}} tokens"
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Web Tools Build Status

Build Status Deployment
Web Tools Build ✅ Deployed https://web-tools-owfa0mrbn-ledger-hq-prd.vercel.app
Native Storybook Build ⏭️ Skipped
React Storybook Build ⏭️ Skipped

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 7 projects in monorepo, 7 projects with changes.

📊 Quick Summary
Project Total Size Change
desktop-main 2.3 MB -
desktop-preloader 7.1 KB -
desktop-renderer 80.7 MB -
desktop-webviewDappPreloader 36.9 KB -
desktop-webviewPreloader 200.0 B -
desktop-workers 36.8 KB -
mobile 261.6 MB -
📋 Detailed Reports (Click to expand)

📁 desktop-main

Path: rsdoctor/desktop-main/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.3 MB - -
📄 JavaScript 2.2 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 135.3 KB - -

📁 desktop-preloader

Path: rsdoctor/desktop-preloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 7.1 KB - -
📄 JavaScript 5.3 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 1.8 KB - -

📁 desktop-renderer

Path: rsdoctor/desktop-renderer/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 80.7 MB - -
📄 JavaScript 29.3 MB - -
🎨 CSS 183.2 KB - -
🌐 HTML 1.8 KB - -
📁 Other Assets 51.2 MB - -

📁 desktop-webviewDappPreloader

Path: rsdoctor/desktop-webviewDappPreloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 36.9 KB - -
📄 JavaScript 36.9 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 desktop-webviewPreloader

Path: rsdoctor/desktop-webviewPreloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 200.0 B - -
📄 JavaScript 200.0 B - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 desktop-workers

Path: rsdoctor/desktop-workers/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 36.8 KB - -
📄 JavaScript 36.8 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 mobile

Path: rsdoctor/mobile/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 261.6 MB - -
📄 JavaScript 110.5 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 151.1 MB - -

Generated by Rsdoctor GitHub Action

Copilot AI review requested due to automatic review settings August 3, 2026 15:12
@mcayuelas-ledger
mcayuelas-ledger force-pushed the fix/settings-hidden-assets-not-listed branch from 337811c to fe6a893 Compare August 3, 2026 15:12
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ E2E tests are required

Changes detected require e2e testing before merge (even before asking for any review).

🖥️ Desktop

-> Run Desktop E2E

  • Select "Run workflow"
  • Branch: fix/settings-hidden-assets-not-listed
  • Device: nanoSP or stax

📱 Mobile

-> Run Mobile E2E

  • Select "Run workflow"
  • Branch: fix/settings-hidden-assets-not-listed
  • Device: nanoX

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (2)

apps/ledger-live-desktop/static/i18n/en/app.json:5516

  • This section still labels the feature as “Hidden tokens” and uses “token(s)” in the count, but the PR now includes hidden native coins in the list (so the copy becomes inaccurate, e.g. Bitcoin would be counted as a token). Consider updating the title/count wording to be asset-based (and aligning other locales + affected tests accordingly).
        "title": "Hidden tokens",
        "desc": "You can hide an asset from its detail page using the options menu, or hide a token by going to the parent account then right-clicking on the token and selecting 'Hide token'.",
        "count": "1 token",
        "count_other": "{{count}} tokens"

.changeset/wild-donkeys-hunt.md:5

  • This PR changes the exported loadBlacklistedTokenSections API (return shape tokensassets, and the array can now include CryptoCurrency entries). That’s a breaking change for @ledgerhq/live-common, so the changeset should be major (or the code should preserve backward compatibility).
"@ledgerhq/live-common": minor
"ledger-live-desktop": minor
"live-mobile": minor

LucasWerey
LucasWerey previously approved these changes Aug 3, 2026
@mcayuelas-ledger
mcayuelas-ledger force-pushed the fix/settings-hidden-assets-not-listed branch from fe6a893 to 51bc3da Compare August 3, 2026 15:24
Copilot AI review requested due to automatic review settings August 3, 2026 15:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

libs/ledger-live-common/src/account/helpers.ts:29

  • The doc comment says token lookups are isolated so one failure keeps the rest of the list, but the implementation only isolates Promise rejections via .catch(() => undefined). A synchronous throw from findTokenById will still reject the whole Promise.all and discard the list. Either update the comment to specify it only covers rejected lookups, or wrap the lookup in a try/catch to truly isolate all failures.
 * Load blacklisted (hidden) assets and organize them into sections by parent currency.
 * Hidden ids can be native coins (grouped under themselves) as well as tokens (grouped
 * under their parent). Token lookups are isolated so one failure keeps the rest of the list.

libs/ledger-live-common/src/account/helpers.ts:55

  • Grouping sections by s.parentCurrency === parentCurrency relies on referential equality of CryptoCurrency objects. Since @domain/entity-currency-crypto accessors are explicitly intended to become selectors over a dynamic slice (where referential stability may not be guaranteed), grouping by id is safer and makes the intent clearer.
    const index = sections.findIndex(s => s.parentCurrency === parentCurrency);

@@ -0,0 +1,7 @@
---
"@ledgerhq/live-common": minor
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
7.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Has changes in live-common desktop Has changes in LLD mobile Has changes in LLM translations Translation files have been touched

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants