From 31d4c0019bb535d6cfe9abb9e7979393095ee7f4 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 4 Aug 2026 16:57:53 +0200 Subject: [PATCH] Improve usability by collapsing breakdowns --- .../portfolio-summary.component.html | 34 ++++++++++++++++--- .../portfolio-summary.component.scss | 17 ++++++++++ .../portfolio-summary.component.ts | 25 +++++++++++++- 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.html b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.html index e4ff1ba93..5e5205582 100644 --- a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.html +++ b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.html @@ -164,7 +164,20 @@
-
+
+ @if (hasHoldingsBreakdown) { + + + + } Holdings @if ( !hasImpersonationId && @@ -192,7 +205,7 @@ />
- @if (isLoading || summary?.emergencyFund?.assets > 0) { + @if (hasHoldingsBreakdown && isHoldingsExpanded) {
Investments
@@ -223,7 +236,20 @@
}
-
+
+ @if (hasCashBreakdown) { + + + + } Cash @if ( !hasImpersonationId && @@ -251,7 +277,7 @@ />
- @if (isLoading || summary?.emergencyFund?.cash > 0) { + @if (hasCashBreakdown && isCashExpanded) {
Buying Power
diff --git a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.scss b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.scss index 6feaa22d1..0b8156f95 100644 --- a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.scss +++ b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.scss @@ -1,6 +1,23 @@ :host { display: block; + .caret-container { + align-items: center; + display: inline-flex; + justify-content: center; + margin-left: -1rem; + width: 1rem; + + .caret { + font-size: 0.7rem; + transition: transform 150ms ease-in-out; + + &.caret-expanded { + transform: rotate(90deg); + } + } + } + .indent-1 { margin-left: 1rem; } diff --git a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts index eaf71210f..0213948ec 100644 --- a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts +++ b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts @@ -18,6 +18,7 @@ import { IonIcon } from '@ionic/angular/standalone'; import { formatDistanceToNow } from 'date-fns'; import { addIcons } from 'ionicons'; import { + caretForwardOutline, ellipsisHorizontalCircleOutline, informationCircleOutline } from 'ionicons/icons'; @@ -47,13 +48,19 @@ export class GfPortfolioSummaryComponent implements OnChanges { 'BUY_AND_SELL_ACTIVITIES_TOOLTIP' ); + protected isCashExpanded = false; + protected isHoldingsExpanded = false; protected precision = 2; protected timeInMarket: string | undefined; private readonly notificationService = inject(NotificationService); public constructor() { - addIcons({ ellipsisHorizontalCircleOutline, informationCircleOutline }); + addIcons({ + caretForwardOutline, + ellipsisHorizontalCircleOutline, + informationCircleOutline + }); } protected get cashPercentage() { @@ -77,6 +84,14 @@ export class GfPortfolioSummaryComponent implements OnChanges { : 0; } + protected get hasCashBreakdown() { + return this.isLoading || this.summary?.emergencyFund?.cash > 0; + } + + protected get hasHoldingsBreakdown() { + return this.isLoading || this.summary?.emergencyFund?.assets > 0; + } + protected get holdingsInBaseCurrency() { if ( !isNumber(this.summary?.totalAssetsInBaseCurrency) || @@ -145,4 +160,12 @@ export class GfPortfolioSummaryComponent implements OnChanges { title: $localize`Please set the amount of your emergency fund.` }); } + + protected onToggleCash() { + this.isCashExpanded = !this.isCashExpanded; + } + + protected onToggleHoldings() { + this.isHoldingsExpanded = !this.isHoldingsExpanded; + } }