Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/red-baboons-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
---

hide Operations List in Portfolio when FF is on for new TX History
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ export const PortfolioView = memo(function PortfolioView({
shouldDisplayGraphRework,
shouldDisplayQuickActionCtas,
shouldDisplayAssetSection,
shouldDisplayOperationsList,
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.

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.

Suggested change
shouldDisplayOperationsList,
shouldDisplayOperationsList = false,

Copilot uses AI. Check for mistakes.
isWallet40Enabled,
accounts,
filterOperations,
t,
isClearCacheBannerVisible,
}: PortfolioViewModelResult) {
Comment on lines 26 to 35
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.

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

Copilot uses AI. Check for mistakes.
const shouldDisplayAddAccountCta = totalAccounts === 0 && isWallet40Enabled;
const shouldRenderLegacyOperationsList = !shouldDisplayOperationsList && totalOperations > 0;

return (
<>
Expand All @@ -48,7 +50,7 @@ export const PortfolioView = memo(function PortfolioView({
/>
<div id="portfolio-container" data-testid="portfolio-container" className="flex flex-col">
{/* Main content area */}
<div className="flex flex-1 flex-col gap-32">
<div className="flex flex-1 flex-col gap-32 pb-32">
<div className="flex flex-col gap-24">
<PageHeader title={t("portfolio.title")} />
{shouldDisplayGraphRework && <Balance />}
Expand All @@ -67,7 +69,7 @@ export const PortfolioView = memo(function PortfolioView({
{shouldDisplayAddAccountCta && <AddAccount />}
{shouldDisplayAssetSection && <CryptoAddressesBanner />}

{totalOperations > 0 && (
{shouldRenderLegacyOperationsList && (
<OperationsList
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 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.

Suggested change
<OperationsList
<OperationsList
data-testid="portfolio-operations-list"

Copilot uses AI. Check for mistakes.
accounts={accounts}
title={t("dashboard.recentActivity")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ describe("PortfolioView", () => {
shouldDisplayGraphRework: true,
shouldDisplayQuickActionCtas: true,
shouldDisplayAssetSection: true,
shouldDisplayOperationsList: true,
isClearCacheBannerVisible: false,
filterOperations: () => true,
accounts: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface PortfolioViewModelResult {
readonly shouldDisplayGraphRework: boolean;
readonly shouldDisplayQuickActionCtas: boolean;
readonly shouldDisplayAssetSection: boolean;
readonly shouldDisplayOperationsList: boolean;
readonly isWallet40Enabled: boolean;
readonly filterOperations: (operation: Operation, account: AccountLike) => boolean;
readonly accounts: AccountLike[];
Expand All @@ -35,6 +36,7 @@ export const usePortfolioViewModel = (): PortfolioViewModelResult => {
shouldDisplayGraphRework,
shouldDisplayQuickActionCtas,
shouldDisplayAssetSection,
shouldDisplayOperationsList,
isEnabled: isWallet40Enabled,
} = useWalletFeaturesConfig("desktop");
const { t } = useTranslation();
Expand Down Expand Up @@ -79,6 +81,7 @@ export const usePortfolioViewModel = (): PortfolioViewModelResult => {
shouldDisplayGraphRework,
shouldDisplayQuickActionCtas,
shouldDisplayAssetSection,
shouldDisplayOperationsList,
isWallet40Enabled,
filterOperations,
accounts,
Expand Down
Loading