Files
SubMiner/docs/architecture/stats-trends-data-flow.md
sudacode f2b3af17d7 docs: update docs, add backlog tasks and change notes
Update configuration, immersion tracking, and mining workflow docs.
Add backlog tasks for upcoming work items and change notes for recent
features and fixes.
2026-03-17 20:12:42 -07:00

938 B

Stats Trends Data Flow

read_when: touching stats trend charts, changing stats API payloads, or debugging dashboard performance

Summary

Trend charts now consume one chart-oriented backend payload from /api/stats/trends/dashboard.

Why

  • remove repeated client-side dataset rebuilding in TrendsTab
  • collapse multiple network round-trips into one request
  • keep heavy chart shaping close to tracker/query logic

Data Sources

  • rollup-backed:
    • activity charts
    • cumulative watch/cards/words/sessions trends
    • per-anime watch/cards/words/episodes series
  • session-metric-backed:
    • lookup trends
    • lookup rate trends
    • watch-time by day-of-week/hour
  • vocabulary-backed:
    • new-words trend

Contract

The stats UI should treat the trends payload as chart-ready data. Presentation-only work in the client is fine, but rebuilding the main trend datasets from raw sessions should stay out of the render path.