Skip to content

[LWD] fix(lwd): include testnets in global search results (LIVE-33220)#18959

Open
LucasWerey wants to merge 3 commits into
developfrom
bugfix/live-33220-lwd-globalsearch-testnets
Open

[LWD] fix(lwd): include testnets in global search results (LIVE-33220)#18959
LucasWerey wants to merge 3 commits into
developfrom
bugfix/live-33220-lwd-globalsearch-testnets

Conversation

@LucasWerey

@LucasWerey LucasWerey commented Jun 24, 2026

Copy link
Copy Markdown
Member

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests. Unit test asserting useAssetsData is queried with includeTestNetworks driven by MANAGER_DEV_MODE.
  • Impact of the changes:
    • Global Search (Wallet 4.0, desktop). QA should verify that with developer mode enabled, testnet assets now appear in Global Search results, and that with developer mode disabled the results are unchanged (mainnets only).

📝 Description

Desktop port of the LWM fix (#18931 / LIVE-33199). Global Search did not surface testnets because useAssetSearchResultsViewModel called the DADA useAssetsData hook without the includeTestNetworks / isStaging parameters, so the backend returned mainnets only.

This PR adds the same logic the Receive flow already uses (useReceiveNetworkLedgerIds):

  • includeTestNetworks from useEnv("MANAGER_DEV_MODE") → testnets surface only in developer mode.
  • isStaging derived from the lldModularDrawer feature flag's backendEnvironment param, keeping the DADA environment consistent with the rest of the app.

❓ Context

Copilot AI review requested due to automatic review settings June 24, 2026 16:34
@LucasWerey LucasWerey requested a review from a team as a code owner June 24, 2026 16:34
@live-github-bot live-github-bot Bot added the desktop Has changes in LLD label Jun 24, 2026
@live-github-bot live-github-bot Bot changed the title fix(lwd): include testnets in global search results (LIVE-33220) [LWD] fix(lwd): include testnets in global search results (LIVE-33220) Jun 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Web Tools Build Status

Build Status Deployment
Web Tools Build ⏭️ Skipped
Native Storybook Build ⏭️ Skipped
React Storybook Build ⏭️ Skipped

@github-actions

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: bugfix/live-33220-lwd-globalsearch-testnets
  • Device: nanoSP or stax

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 updates the Ledger Wallet Desktop (Wallet 4.0) Global Search assets query so DADA can return testnet assets when developer mode is enabled, matching the Receive flow behavior and keeping the backend environment (prod vs staging) consistent with the lldModularDrawer feature flag.

Changes:

  • Pass includeTestNetworks (from MANAGER_DEV_MODE) into useAssetsData for Global Search results.
  • Pass isStaging (from lldModularDrawer.params.backendEnvironment) into useAssetsData to align DADA environment selection.
  • Add a unit test suite and a changeset for the desktop patch release.

Reviewed changes

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

File Description
apps/ledger-live-desktop/src/mvvm/features/SearchAssets/hooks/useAssetSearchResultsViewModel.ts Threads includeTestNetworks + isStaging into the DADA useAssetsData query for Global Search.
apps/ledger-live-desktop/src/mvvm/features/SearchAssets/hooks/tests/useAssetSearchResultsViewModel.test.ts Adds unit tests asserting the query opts into testnets based on MANAGER_DEV_MODE (and should cover staging).
.changeset/lwd-globalsearch-testnets.md Declares a desktop patch changeset for the Global Search testnet/staging query update.

@github-actions

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.6 MB -
desktop-preloader 7.1 KB -
desktop-renderer 81.2 MB -
desktop-webviewDappPreloader 36.9 KB -
desktop-webviewPreloader 0 B -
desktop-workers 36.8 KB -
mobile 258.7 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.6 MB - -
📄 JavaScript 2.4 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 81.2 MB - -
📄 JavaScript 28.9 MB - -
🎨 CSS 172.6 KB - -
🌐 HTML 1.8 KB - -
📁 Other Assets 52.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 0 B - -
📄 JavaScript 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 258.7 MB - -
📄 JavaScript 108.7 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 150.0 MB - -

Generated by Rsdoctor GitHub Action

@LucasWerey LucasWerey marked this pull request as draft June 24, 2026 17:10
@sonarqubecloud

Copy link
Copy Markdown

@LucasWerey LucasWerey marked this pull request as ready for review June 24, 2026 17:29
Copilot AI review requested due to automatic review settings June 24, 2026 17:29

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

Comments suppressed due to low confidence (1)

apps/ledger-live-desktop/src/mvvm/features/SearchAssets/utils/mapAssetsDataToMarketCurrencies.ts:33

  • The deactivated-currency filtering only excludes meta-assets when all network currencies are deactivated, but the selected ledgerId can still end up pointing to a deactivated network when a meta-asset spans both deactivated and active networks (because selectCurrencyForMetaId may prefer a CryptoCurrency from the deactivated network). This can make Global Search surface an item whose returned ledgerIds are unusable even though an active network exists.

Consider selecting the ledgerId from an active (non-deactivated) network whenever the preferred currency resolves to a deactivated network, and fall back to the first active network entry when no currency resolves.

    const currency = selectCurrencyForMetaId(id, data);
    const ledgerId = currency?.id ?? Object.values(meta.assetsIds)[0];
    if (!ledgerId) return [];
    const market = currency ? markets[currency.id] : undefined;

Comment on lines +89 to +95
it("hides a result whose only network currency flag is off", () => {
mockedAssets.mockReturnValue(buildSearchData("robinhood_testnet"));

const { result } = renderHook(() => useAssetSearchResultsViewModel({ search: "amd" }));

expect(result.current.data).toHaveLength(0);
});
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