Show a visible notice when a dashboard snapshot read is cut at the row cap

Aperta
#336 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
54/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
next.js, playwright, react, supabase, typescript
Ambito
data, frontend

Direzione di ricerca

Start in src/lib/supabase/paging.ts: readAllPages already stops at SNAPSHOT_MAX_ROWS, so the first question is how it can also report whether it was cut. Carry that complete value through loadSnapshots and loadMonthlySnapshots in src/lib/data/dashboard.ts and getHeadlineSnapshots in src/lib/data/headline.ts, then render one page-level notice following the withStaleNotice pattern from #267, naming the affected part and the first complete date. Done means boundary tests just under, at and over the cap for each read, plus one Playwright case with an accessibility scan.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: dashboard bug priority: P2 size: M

Summary

The dashboard's snapshot reads stop at SNAPSHOT_MAX_ROWS = 10_000 rows, newest first (readAllPages in src/lib/supabase/paging.ts), and when a read is cut the only signal is a dashboard.snapshots_truncated warning in the log (loadSnapshots and loadMonthlySnapshots in src/lib/data/dashboard.ts). The user sees missing history as unavailable values with no explanation.

Where each read is cut, from the review of PR #334 (#317):

Read Rows per account and metric Cut at about
Cards and daily trend: loadDashboardSnapshots (45 days, every daily row) 45 222 account and metric pairs
Headline strip: getHeadlineSnapshots in src/lib/data/headline.ts (money kinds and declared signup totals) days in the windows depends on the window
Monthly trend: loadMonthlySnapshots (one row per month since #317) 13 770 account and metric pairs

The cards' read is now the weakest: past about 222 pairs with a daily row each, the oldest days of the 45 day window are dropped, so an account that stopped reporting in that range falls out of the current values silently.

Scope

  • Carry complete from readAllPages up through these reads and show one visible notice on the dashboard when any of them was cut, saying which part (cards, headline, monthly trend) is incomplete and from which date the data is complete.
  • One notice for the page, following the stale notice pattern (withStaleNotice, #267), not one per card.

Acceptance criteria

  • A workspace past the cap of any of the three reads sees a visible notice naming the affected part and the date from which it is complete.
  • Happy-path and boundary tests: just under, at, and over the cap for each read.
  • Playwright covers the notice on one cut read, with an accessibility scan.

Source: Fable review round 1 of PR #334, comment https://github.com/eddiejaoude/DevMacro/pull/334#discussion_r4543797670.

Model: anthropic/claude-opus-5-5 | Reasoning effort: low

Lingua principale
TypeScript
Stelle
1
Fork
1
Merge medio
6h 56m
PR unite (30g)
136

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eddiejaoude/StackDash

Tutte le issue di eddiejaoude/StackDash

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.