Skip to content

[LWD] fix(text): 🐛 text showing wrong text when adding new token#15620

Open
qperrot wants to merge 1 commit intodevelopfrom
fix/algo-hedera-text
Open

[LWD] fix(text): 🐛 text showing wrong text when adding new token#15620
qperrot wants to merge 1 commit intodevelopfrom
fix/algo-hedera-text

Conversation

@qperrot
Copy link
Contributor

@qperrot qperrot commented Mar 20, 2026

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • ...

📝 Description

{{tokenList}} should be replaced by token name.
We were doing wrong check, account type must be TokenAccount and use account.token.parentCurrency.tokenTypes instead of account.currency.tokenTypes

BEFORE

algo_tokenList

AFTER

Screenshot 2026-03-20 at 15 07 10 Screenshot 2026-03-20 at 15 06 55

❓ Context

  • JIRA or GitHub link: LIVE-13872
  • ADR link (if any):

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

@qperrot qperrot marked this pull request as ready for review March 20, 2026 14:12
@qperrot qperrot requested a review from a team as a code owner March 20, 2026 14:12
Copilot AI review requested due to automatic review settings March 20, 2026 14:12
@live-github-bot live-github-bot bot added the desktop Has changes in LLD label Mar 20, 2026
@live-github-bot live-github-bot bot changed the title fix(text): 🐛 text showing wrong text when adding new token [LWD] fix(text): 🐛 text showing wrong text when adding new token Mar 20, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2026

Web Tools Build Status

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the account empty-state wording on desktop so token-related wording displays correctly when viewing/adding certain token accounts (notably Hedera/Algorand), instead of showing an unresolved {{tokenList}} placeholder.

Changes:

  • Adjust token type source in the empty-state token description to use the parent currency token types for TokenAccount.
  • Add a Changesets entry for the desktop package release notes/versioning.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
apps/ledger-live-desktop/src/renderer/screens/account/EmptyStateAccount.tsx Updates token-list rendering logic in the empty-state description for token accounts.
.changeset/curly-carpets-smile.md Adds a changeset documenting the fix for release/versioning.

Comment on lines 86 to +89
<Text ff="Inter|SemiBold" color="neutral.c100">
{account &&
account.type === "Account" &&
(account.currency.tokenTypes || []).join(", ")}
account.type === "TokenAccount" &&
(account.token.parentCurrency.tokenTypes || []).join(", ")}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

account.emptyState.descToken in en/app.json interpolates {{tokenList}}, but this <Trans> call still doesn't pass a values.tokenList. As a result, the UI can still render the literal {{tokenList}} (the original bug). Pass values={{ tokenList: ... }} to Trans (and consider passing the other interpolations too) rather than trying to inject the text via children only.

Copilot uses AI. Check for mistakes.
Comment on lines 87 to +89
{account &&
account.type === "Account" &&
(account.currency.tokenTypes || []).join(", ")}
account.type === "TokenAccount" &&
(account.token.parentCurrency.tokenTypes || []).join(", ")}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The hasTokens condition is based on mainAccount.subAccounts, but the token list is now only rendered when account.type === "TokenAccount". When the empty state is shown for a main Account that has token subaccounts, this will render no token list. Consider deriving token types from mainAccount.currency (or handling both Account and TokenAccount) so the wording is correct in both contexts.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

This changeset is describing a bug fix; using a patch bump is likely more appropriate than minor to avoid triggering a larger-than-needed version increment for desktop.

Suggested change
"ledger-live-desktop": minor
"ledger-live-desktop": patch

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings March 20, 2026 14:24
@qperrot qperrot force-pushed the fix/algo-hedera-text branch from 50f89b9 to 4f24c3a Compare March 20, 2026 14:25
@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2026

⚠️ 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/algo-hedera-text
  • Device: nanoSP or stax

📱 Mobile

-> Run Mobile E2E

  • Select "Run workflow"
  • Branch: fix/algo-hedera-text
  • Device: nanoX

Copy link
Contributor

Copilot AI left a comment

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 2 out of 2 changed files in this pull request and generated 1 comment.

Comment on lines 86 to 90
<Text ff="Inter|SemiBold" color="neutral.c100">
{account &&
account.type === "Account" &&
(account.currency.tokenTypes || []).join(", ")}
account.type === "TokenAccount" &&
(account.token.parentCurrency.tokenTypes || []).join(", ")}
{"tokens"}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

In the hasTokens branch, account can be a main Account (not a TokenAccount) when the empty state is rendered on a parent account. With the new account.type === "TokenAccount" guard, the token type list becomes empty and the UI will render only the trailing "tokens" label. Consider deriving token types from mainAccount.currency.tokenTypes (works for both Account and TokenAccount views because mainAccount is the parent) or handling both account types explicitly.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

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

Labels

desktop Has changes in LLD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants