Skip to content

Top 3 ui#1124

Open
VibeNL wants to merge 7 commits into
masterfrom
fix/top-movers-filter-and-performance
Open

Top 3 ui#1124
VibeNL wants to merge 7 commits into
masterfrom
fix/top-movers-filter-and-performance

Conversation

@VibeNL

@VibeNL VibeNL commented May 29, 2026

Copy link
Copy Markdown
Owner

No description provided.

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

Adds support for the Top Movers page in the global filter UX and improves its data loading by replacing N per-symbol price-history queries with a single bulk query. Also aligns its filter-change detection with the snapshot/IsEqual pattern used by Accounts/Transactions/HoldingDetail.

Changes:

  • Switch TopMovers filter-change detection to FilterState.IsEqual against a snapshot copy, removing the bespoke HasFilterStateChanged().
  • Add /top-movers to date and account filter visibility in MainLayout.
  • Add new GetHoldingPriceHistoryBulkAsync to IHoldingsDataService/HoldingsDataService and consume it from TopMovers.PrepareRisersAndLosers.

Reviewed changes

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

File Description
PortfolioViewer/PortfolioViewer.WASM/Pages/TopMovers.razor.cs Adopt IsEqual filter comparison and use bulk price-history fetch.
PortfolioViewer/PortfolioViewer.WASM/Layout/MainLayout.razor.cs Show date/account filters on the Top Movers route.
PortfolioViewer/PortfolioViewer.WASM.Data/Services/IHoldingsDataService.cs Declare bulk price-history API.
PortfolioViewer/PortfolioViewer.WASM.Data/Services/HoldingsDataService.cs Implement bulk price-history query and per-symbol grouping.

Comment on lines +94 to +113
foreach (var holding in rawSnapShots)
{
if (holding.Symbol == null) continue;

var byDate = holding.Snapshots
.GroupBy(s => s.Date)
.Select(g =>
{
var totalQuantity = g.Sum(x => x.Quantity);
return new HoldingPriceHistoryPoint
{
Date = g.Key,
Price = g.Min(x => x.CurrentUnitPrice),
AveragePrice = totalQuantity == 0 ? 0 : g.Sum(y => y.AverageCostPrice * y.Quantity) / totalQuantity,
};
})
.ToList();

result[holding.Symbol] = byDate;
}
Comment on lines +80 to +84
Symbol = x.SymbolProfiles
.Where(sp => symbolList.Contains(sp.Symbol))
.OrderBy(sp => Datasource.GetPriority(sp.DataSource))
.Select(sp => sp.Symbol)
.FirstOrDefault(),
@sonarqubecloud

sonarqubecloud Bot commented Jun 4, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

Development container published

Install with:

docker pull vibenl/ghostfoliosidekick:pr-1124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants