From f1f1f2ca27fe9679cd056917349268f790cbfbfc Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 28 Jul 2026 21:35:36 +0200 Subject: [PATCH] Task/improve portfolio summary (#7453) * Improve portfolio summary * Update changelog --- CHANGELOG.md | 1 + .../holding-detail-dialog.html | 2 +- .../portfolio-summary.component.html | 44 +++++++++++++------ .../portfolio-summary.component.ts | 10 +++++ .../analysis/analysis-page.component.ts | 2 +- 5 files changed, 44 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2faf9a643..2a812076b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Improved the portfolio summary tab on the home page - Upgraded `@openrouter/ai-sdk-provider` from version `2.9.1` to `3.0.0` - Upgraded `ai` from version `6.0.174` to `7.0.37` diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html index 0a8ee6dce..30222de65 100644 --- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html +++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html @@ -170,7 +170,7 @@ " [unit]="data.baseCurrency" [value]="investmentInBaseCurrencyWithCurrencyEffect" - >InvestmentInvested Capital @if ( 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 fd0ac9b72..e4ff1ba93 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 @@ -57,7 +57,7 @@

-
Investment
+
Invested Capital
- Cash + Holdings @if ( !hasImpersonationId && summary?.totalValueInBaseCurrency > 0 && @@ -175,7 +175,8 @@ class="d-lg-inline-block d-none ml-2 small text-muted" [isPercent]="true" [locale]="locale" - [value]="isLoading ? undefined : cashPercentage" + [precision]="0" + [value]="isLoading ? undefined : holdingsPercentage" /> }
@@ -187,13 +188,13 @@ [locale]="locale" [precision]="precision" [unit]="baseCurrency" - [value]="isLoading ? undefined : summary?.totalCashInBaseCurrency" + [value]="isLoading ? undefined : holdingsInBaseCurrency" />
- @if (isLoading || summary?.emergencyFund?.cash > 0) { + @if (isLoading || summary?.emergencyFund?.assets > 0) {
-
Buying Power
+
Investments
@@ -216,14 +217,14 @@ [locale]="locale" [precision]="precision" [unit]="baseCurrency" - [value]="isLoading ? undefined : summary?.emergencyFund?.cash" + [value]="isLoading ? undefined : summary?.emergencyFund?.assets" />
}
- Holdings + Cash @if ( !hasImpersonationId && summary?.totalValueInBaseCurrency > 0 && @@ -233,7 +234,8 @@ class="d-lg-inline-block d-none ml-2 small text-muted" [isPercent]="true" [locale]="locale" - [value]="isLoading ? undefined : holdingsPercentage" + [precision]="0" + [value]="isLoading ? undefined : cashPercentage" /> }
@@ -245,11 +247,25 @@ [locale]="locale" [precision]="precision" [unit]="baseCurrency" - [value]="isLoading ? undefined : holdingsInBaseCurrency" + [value]="isLoading ? undefined : summary?.totalCashInBaseCurrency" />
- @if (isLoading || summary?.emergencyFund?.assets > 0) { + @if (isLoading || summary?.emergencyFund?.cash > 0) { +
+
Buying Power
+
+ +
+
Emergency Fund
@@ -260,7 +276,7 @@ [locale]="locale" [precision]="precision" [unit]="baseCurrency" - [value]="isLoading ? undefined : summary?.emergencyFund?.assets" + [value]="isLoading ? undefined : summary?.emergencyFund?.cash" />
@@ -277,6 +293,7 @@ class="d-lg-inline-block d-none ml-2 small text-muted" [isPercent]="true" [locale]="locale" + [precision]="0" [value]="isLoading ? undefined : excludedFromAnalysisPercentage" /> } @@ -363,6 +380,7 @@ class="d-lg-inline-block d-none ml-2 small text-muted" [isPercent]="true" [locale]="locale" + [precision]="0" [value]="isLoading ? undefined : emergencyFundPercentage" /> } 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 1cd2ec93c..eaf71210f 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 @@ -98,6 +98,16 @@ export class GfPortfolioSummaryComponent implements OnChanges { : 0; } + protected get investmentsInBaseCurrency() { + if (!isNumber(this.holdingsInBaseCurrency)) { + return null; + } + + return ( + this.holdingsInBaseCurrency - (this.summary.emergencyFund?.assets ?? 0) + ); + } + public ngOnChanges() { if (this.summary) { if ( diff --git a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts index 990816193..c2d23dbc6 100644 --- a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts +++ b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts @@ -82,7 +82,7 @@ export class GfAnalysisPageComponent implements OnInit { protected hasImpersonationId: boolean; protected hasPermissionToReadAiPrompt: boolean; protected investments: InvestmentItem[]; - protected readonly investmentTimelineDataLabel = $localize`Investment`; + protected readonly investmentTimelineDataLabel = $localize`Invested Capital`; protected investmentsByGroup: InvestmentItem[]; protected isLoadingAnalysisPrompt: boolean; protected isLoadingBenchmarkComparator: boolean;