feat(home): refresh the tokens and collectibles lists - #2937
Draft
CassioMG wants to merge 3 commits into
Draft
Conversation
BalanceRow is shared between the Home tokens list and the Swap destination picker's "Your tokens" section, so both surfaces pick up the new type scale, spacing, and fiat/delta styling from this single stylesheet pass. The native asset now renders "Stellar Lumens" instead of "XLM" (issued assets that happen to use the code XLM are unaffected via the existing !issuerKey guard). The negative-delta color changes from a muted gray to --sds-clr-red-09 so losses actually read as red, matching gains' green; the color is still resolved entirely through the positive/negative modifier classes composed from getPriceDeltaColor(), never hardcoded on &__delta itself. Updates the two Account.test.tsx sort-order assertions and three e2e specs (loadAccount, sendPayment) whose "XLM" text/hasText lookups on Home's BalanceRow-rendered rows no longer match now that the row reads "Stellar Lumens" - all other testid-based lookups (SwapTokenRow-XLM, account-assets-item, etc.) are unaffected since they key off the raw asset code, not the display text. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Replaces the SDS Notification + two stacked buttons with a centered badge, heading, body copy (inline "Learn more" link), and a single "Add XLM" action; Friendbot stays as a secondary action for non-mainnet. Moves NotFundedMessage out of the account View.Footer and into the Tokens pane of the MultiPaneSlider, carrying over the !hasError and !error.horizon guards verbatim so a Horizon outage still shows the Horizon notice instead of the empty state over a funded account. The "2 XLM" copy in the body text is a padded recommendation shown in the frame, not the 1 XLM protocol minimum - confirmed intentional with the project owner. New copy is hand-added to the en/pt locale files rather than run through `yarn build:extension:translations`, which is broken on master independent of this change (i18next-scanner-webpack needs `.default`; see extension/webpack.extension.js). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…y state Adds local collapse state to CollectionsList - a Set of collapsed collection addresses, so an empty set naturally means everything is expanded on mount (spec D5). No Redux slice, chrome.storage, or message types: this is intentionally React-local UI state that resets whenever Home unmounts. Each collection's header is now the toggle (name, count chip, chevron-up/down) and its own grid hides independently when collapsed; the Icon.Grid01 that used to sit before the collection name is removed to match the frame. Enriches the empty state with a badge, "No collectibles yet" (kept verbatim - asserted by two sites in AccountCollectibles.test.tsx), and a new "Collectibles you own will appear here." subtitle. Adds a Jest case for the collapse/expand toggle, reusing the existing "renders collectibles" mock (3 valid collections) - since that fixture isn't a single collection, the assertions check the grid count drops from 3 to 2 and back rather than a single grid's presence/absence. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
PR Preview build is ready: https://github.com/stellar/freighter/releases/tag/untagged-2a60662d94f702977b85 (SDF collaborators only — install instructions in the release description) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of the Home refresh project. This is the Home screen's list bodies; the chrome around them is #2936.
What changed
Per Figma frames
9567-17044,9569-38124,9569-37947,9569-38140:View.Footerinto the Tokens pane, rebuilt as a centred badge + heading + body + "Add XLM".#2887 "Parity/native asset display name" already does the XLM rename app-wide. It adds to
extension/src/helpers/transaction.ts:and consumes it across
AccountAssets,AssetTile,TokenList,AssetDetail, andSwapAmount.This PR arrived at the same rename independently and hardcodes the literal inline in
BalanceRow:It was kept self-contained deliberately — this PR has to match its frame, and making it depend on an unmerged branch that's been idle since early July would be worse. But whichever of the two merges second should collapse this inline conditional into
getDisplayNameFromCodeso the string lives in one place.Both PRs also edit
extension/e2e-tests/sendPayment.test.ts(this one 7+/4−, #2887 5+/5−) for the same reason: locators that targeted the native-asset row by its old"XLM"text.The rename had a wider blast radius than expected
Changing that one label broke 11 assertions across three test files that located rows by their visible text:
loadAccount.test.ts— 7 staletoContainText("XLM")assertions. These were missed on the first pass because of a bad grep exclusion, and only surfaced by actually running the suite. Worth remembering that grep is not a substitute for running the tests.sendPayment.test.ts— 2 locators (.filter({ hasText: "XLM" }),getByText("XLM").click()).views/__tests__/Account.test.tsx— 2 sort-order tests assertingtoHaveTextContent("XLM"). Not structural: the tests still verify sort order, only the expected substring changed.BalanceRowis shared with the Swap picker — intentionallyRestyling it in place means the Swap destination picker's "Your tokens" section inherits the new look. That's the point: one row style app-wide. Verified by screenshot on the final build — "Your tokens" matches Home exactly, and "Popular tokens" below it (a different component,
AssetListRow) is correctly unaffected.swap.test.ts(12 passed) andsendPayment.test.ts(37 passed) both green.BalanceRow__deltadeliberately has no colour in CSS — it composes withgetPriceDeltaColor(), and hardcoding would flatten gains and losses to one colour. There's a comment in the stylesheet saying so.Two inconsistencies flagged, not silently resolved
NotFundedMessagebadge icon — implemented asIcon.Link04per the plan's literal code, but the plan's own cited measurement doc saysCoins01. Followed the plan; worth 10 seconds of your judgement.AccountAssets/styles.scssended up with no functional change — the frame's spacing was already satisfied elsewhere. An explanatory comment was left rather than inventing unscoped CSS.Collapse state
Local React state tracking collapsed collection ids in a
Set, so "expanded by default" falls out of an empty set. Deliberately not persisted:chrome.storage.localis background-owned here, so persisting would drag a message handler and background changes into a styling PR.Merge note
extension/e2e-tests/loadAccount.test.tsis touched by four PRs in this batch: this one (35+/7−, XLM assertions), #2933 (39+/11−, rename navigation), #2931 (1+/1−, button label), #2935 (1+/1−, card copy). This PR and #2933 are the two large ones — expect a real conflict between them, and take both sets of changes.Also touches
views/Account/index.tsx, which #2936 edits in a different region. Trivial rebase for whichever is second.Verification
yarn test:ci— 1521/1572, exactly baseline +1 (the new collapse/expand test)yarn build:extension— cleanloadAccount9✓/2 skipped,swap12✓,sendPayment37✓/1 skipped,hideCollectible3✓,addCollectible1✓AccountCollectibles.test.tsxgained a collapse/expand case (fireEventadded to its imports)Known repo issue
yarn build:extension:translationsis broken onmaster(i18next-scanner-webpackneeds.default,extension/webpack.extension.js:3) and the pre-commit hook swallows the failure. New locale keys added by hand toenandpt.🤖 Generated with Claude Code