Skip to content

perf(dashboard): accelerate homepage loading and restore US charts - #172

Merged
TNT-Likely merged 2 commits into
mainfrom
fix/dashboard-loading
Oct 3, 2026
Merged

TNT-Likely merged 2 commits into
mainfrom
fix/dashboard-loading

Conversation

@TNT-Likely

Copy link
Copy Markdown
Owner

Background

Opening the existing homepage could leave useful data waiting for the slowest scan or quote request. The scan also fetched technical summaries that the homepage never displayed, and the benchmark waited for attribution. Synchronous index quote I/O blocked unrelated requests on the API event loop.

US stock detail charts could be empty because the configuration adapter excluded Tencent whenever another US K-line provider was enabled. In the current environment Stooq fails while Tencent returns valid data.

Changes

  • Publish homepage sections independently, start saved briefs and performance requests immediately, and display benchmark results without waiting for attribution. Guard older refresh results and keep AI curation tied to the complete candidate snapshot without repeating it for unchanged data.
  • Load only the visible discovery tab, fetch watchlist metadata when personalization needs it, and reuse the homepage portfolio summary. Keep tab caches and ignore outdated responses. Download stock detail and sharing code when opened.
  • Let the homepage opt out of unused scan K-line summaries. Preserve technical data by default for existing callers and always include it for AI scans; separate the light/full scan caches.
  • Move index quote I/O into a worker thread, fetch portfolio quotes across markets concurrently, and request exchange rates only for markets actually held.
  • Honor the configured US K-line provider priority and fallback chain. Display the stock detail miniature candles independently of technical-summary availability.

Validation

  • .venv/bin/python -m pytest tests -q: 954 passed, 3 skipped.
  • .venv/bin/python -m pytest packages/marketdata/tests -q: 188 passed.
  • pnpm --dir frontend exec vitest run: 208 passed across 54 files.
  • Re-ran the 5 affected frontend loading/chart tests after final cleanup: all passed.
  • pnpm --dir frontend check:ui, check:i18n, check:market-colors, and build: passed.
  • git diff --check: passed.
  • Real component browser checks at 1440 px and 390 px in light/dark themes: homepage, US miniature/full charts, scrolling, Escape dismissal, and sharing dialogs. Checked focus restoration for all three sharing dialogs.
  • Three controlled browser comparisons against the original main-branch components, with identical endpoint delays: portfolio data appeared at approximately 2.51 s before / 0.11 s after; benchmark at 6.02 s before / 0.91 s after. Default discovery-tab startup made 18 requests before / 14 after. These are fixture measurements relative to page mount, not production latency guarantees.
  • Live read-only provider checks through the API handlers: LI and AAPL returned 60 daily candles in approximately 0.29 s / 0.15 s; LI returned 120 daily, 25 weekly, and 7 monthly candles for a 120-day request, plus a valid technical summary.

Boundaries and risks

The homepage layout and feature set remain unchanged. No provider settings, trading schedules, or database schema are modified. Historical performance still needs provider K-lines, but no longer holds back other sections. Provider availability and latency depend on the deployment network; enabled sources retain their existing fallback behavior.

Local frontend validation used the bundled Node 24.19 runtime (the repository pins 24.14); existing engine, Browserslist, and large-chunk warnings were non-fatal.

Follow-up

None required for this change.

@TNT-Likely
TNT-Likely merged commit 985f6a2 into main Oct 3, 2026
1 check passed
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.

1 participant