[LWD] feat(desktop): hide operations list in portfolio when ff on#15612
[LWD] feat(desktop): hide operations list in portfolio when ff on#15612mcayuelas-ledger wants to merge 1 commit intodevelopfrom
Conversation
9704d70 to
58c6ab4
Compare
Web Tools Build Status
|
There was a problem hiding this comment.
Pull request overview
Adds a Wallet 4.0 feature-flag-driven switch in the Desktop MVVM Portfolio to hide the legacy Operations list when the corresponding FF param is enabled (LIVE-26176).
Changes:
- Exposes
shouldDisplayOperationsListfromuseWalletFeaturesConfig("desktop")through the Portfolio ViewModel. - Updates
PortfolioViewto conditionally renderOperationsListbased on that flag, and adjusts container padding. - Adds a changeset for the release.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| apps/ledger-live-desktop/src/mvvm/features/Portfolio/hooks/usePortfolioViewModel.ts | Surfaces the wallet feature config boolean into the Portfolio MVVM ViewModel result. |
| apps/ledger-live-desktop/src/mvvm/features/Portfolio/PortfolioView.tsx | Uses the new flag to hide/show the Operations list (and tweaks layout padding). |
| .changeset/thick-bananas-talk.md | Declares package version bumps for the release. |
| const shouldDisplayAddAccountCta = totalAccounts === 0 && isWallet40Enabled; | ||
| const shouldDisplayOperationsListCondition = !shouldDisplayOperationsList && totalOperations > 0; | ||
|
|
There was a problem hiding this comment.
shouldDisplayOperationsList is named like a positive flag, but the render condition is inverted (!shouldDisplayOperationsList). This makes the code easy to misread and increases the chance of future regressions. Consider renaming the local boolean to something like shouldRenderLegacyOperationsList (or invert earlier in the ViewModel and expose a prop with the correct semantics).
There was a problem hiding this comment.
I was going to say something similar. This reads really strangely currently.
If it makes sense, shouldRenderLegacyOperationsList is a good suggestion, IMO
| shouldDisplayGraphRework, | ||
| shouldDisplayQuickActionCtas, | ||
| shouldDisplayAssetSection, | ||
| shouldDisplayOperationsList, |
There was a problem hiding this comment.
shouldDisplayOperationsList is destructured without a default. In non-ViewModel usages (notably tests that spread defaultProps), this can be undefined, which currently behaves as false and unintentionally renders the operations list. Consider providing a default (shouldDisplayOperationsList = false) to keep behavior deterministic when the prop is omitted.
| shouldDisplayOperationsList, | |
| shouldDisplayOperationsList = false, |
|
|
||
| {totalOperations > 0 && ( | ||
| {shouldDisplayOperationsListCondition && ( | ||
| <OperationsList |
There was a problem hiding this comment.
The PR introduces new behavior (hiding the OperationsList based on a wallet feature flag), but there’s no corresponding automated coverage in the existing Portfolio integration test suite. Please add an assertion that OperationsList is not rendered when the flag is enabled, and is rendered when disabled, to prevent regressions.
| <OperationsList | |
| <OperationsList | |
| data-testid="portfolio-operations-list" |
.changeset/thick-bananas-talk.md
Outdated
| @@ -0,0 +1,6 @@ | |||
| --- | |||
| "ledger-live-desktop": minor | |||
| "@ledgerhq/live-common": minor | |||
There was a problem hiding this comment.
This changeset bumps @ledgerhq/live-common, but this PR doesn’t appear to modify any files under libs/ledger-live-common. If live-common isn’t actually changed, remove it from the changeset to avoid an unnecessary release/version bump.
| "@ledgerhq/live-common": minor |
|
58c6ab4 to
0e60848
Compare
LL782
left a comment
There was a problem hiding this comment.
Happy to approve as I don't want to slow things down but PortfolioView.tsx:29 reads really strangely atm
| const shouldDisplayAddAccountCta = totalAccounts === 0 && isWallet40Enabled; | ||
| const shouldDisplayOperationsListCondition = !shouldDisplayOperationsList && totalOperations > 0; | ||
|
|
There was a problem hiding this comment.
I was going to say something similar. This reads really strangely currently.
If it makes sense, shouldRenderLegacyOperationsList is a good suggestion, IMO
0e60848 to
709b5a7
Compare
| shouldDisplayGraphRework, | ||
| shouldDisplayQuickActionCtas, | ||
| shouldDisplayAssetSection, | ||
| shouldDisplayOperationsList, | ||
| isWallet40Enabled, | ||
| accounts, | ||
| filterOperations, | ||
| t, | ||
| isClearCacheBannerVisible, | ||
| }: PortfolioViewModelResult) { |
There was a problem hiding this comment.
PortfolioView now requires shouldDisplayOperationsList via PortfolioViewModelResult. This breaks the existing direct PortfolioView renders in __integrations__/Portfolio.integration.test.tsx (defaultProps doesn’t include this field) and will cause TypeScript errors in CI. Either update those test props to include shouldDisplayOperationsList, or decouple PortfolioView’s prop type from the ViewModel result (e.g., define a dedicated PortfolioViewProps with a default for this flag).
709b5a7 to
90aa124
Compare
90aa124 to
afe72a7
Compare
|



✅ Checklist
npx changesetwas attached.📝 Description
Hide Operations List in Portfolio when FF in ON
❓ Context
🧐 Checklist for the PR Reviewers