Make the dashboard's two lists of unusual days agree
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
- 25/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- nextjs, react, typescript
- Ambito
- frontend
Direzione di ricerca
Read the two sources side by side: src/lib/dashboard/what-changed.ts (recentAnomalies, re-detected under filter and mutes) and src/lib/data/anomalies.ts:101-123 (getRecentAnomalies, stored events for the whole workspace), then the rendering at src/components/dashboard/alerts-summary.tsx:83-117. Nothing can start until Eddie picks one of the four options on this issue and #289 has merged, so the first step is a comment asking for the decision, not code. Done means one list of unusual days on the dashboard, with e2e/anomaly-detection.spec.ts and e2e/dashboard.spec.ts updated, including an axe scan.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Once #289 merges, the dashboard shows unusual spend and usage in two places from two sources, and they can disagree with no explanation on screen. Decide which one the dashboard keeps, and make the other agree or step aside.
Found in the Fable review of #289 (round 1, at 0e39408), review comment.
Evidence
- "What changed" at the top (#270,
src/lib/dashboard/what-changed.ts,recentAnomalies): anomalies found again withfindAnomaliesfrom the trend rows the page reads, under the dashboard filter, with today's mutes and the daily summary job's connections (revoked ones left out). - "Unusual spend and usage" inside the alerts summary (
src/components/dashboard/alerts-summary.tsx:83-117,UnusualDays): the storeddevmacro.anomaly_detectedevents fromgetRecentAnomalies(src/lib/data/anomalies.ts:101-123), for the whole workspace, as written on the day. - They disagree when: a metric is muted after its event was written (the top drops it, the alerts list keeps it); the dashboard is filtered (the top follows the filter, the alerts list does not); the rows lack 14 days of history but an event exists (the top shows nothing, as
e2e/anomaly-detection.spec.tsseeds). A reader who sees "1 unusual spend or usage event" below and nothing at the top, or the reverse, cannot tell why.
Options
| Option | Pros | Cons | Effort | Impact |
|---|---|---|---|---|
| Leave both as they are (status quo) | No work. Each list is correct for its own source. | The two lists disagree in the cases above with no words saying why. | XS | Any dashboard reader after a mute or with a filter on sees two different answers to "what was unusual"; no data is at risk and it lasts as long as the mute or filter. |
Alerts summary keeps its count and timeline link, drops its list (UnusualDays loses the newest items) |
One list on the page, the top one. The count still points at the stored events on the timeline. | The count can still differ from the number of sentences at the top. getRecentAnomalies keeps its count read and drops its list read. |
S | Readers get one list; the count's wording would need to say it is the stored events for the whole workspace. |
| Alerts summary reads the same re-detected set as "What changed" | Both agree by construction. | The alerts box then follows the dashboard filter, unlike the rest of AlertsSummary, which is workspace wide (getUnacknowledgedSummary). |
S | Readers get the same answer twice; the alerts box changes meaning under a filter. |
| Remove the unusual list from the alerts summary entirely | Simplest page. | Loses the stored events' count on the dashboard; the timeline link moves elsewhere or goes. | XS | Readers who used the alerts box for unusual days lose that path. |
Files each option touches:
| Option | Files |
|---|---|
| Status quo | none |
| Count and link only | src/components/dashboard/alerts-summary.tsx, src/lib/data/anomalies.ts, e2e/anomaly-detection.spec.ts |
| Same re-detected set | src/components/dashboard/alerts-summary.tsx, src/app/w/[workspace]/dashboard/page.tsx, src/lib/data/anomalies.ts, e2e/anomaly-detection.spec.ts |
| Remove the list | src/components/dashboard/alerts-summary.tsx, src/lib/data/anomalies.ts, e2e/anomaly-detection.spec.ts |
Recommendation: count and link only. The deciding argument is that the top already lists the days in words, so a second list adds disagreement and nothing else, while the count keeps the way to the stored events. Second choice: the status quo with a sentence under the alerts count saying it covers the whole workspace as recorded.
Acceptance criteria
- Eddie has picked an option on this issue.
- The dashboard no longer shows two lists of unusual days that can disagree without words saying why.
-
e2e/anomaly-detection.spec.tsande2e/dashboard.spec.tscover the chosen behavior, with an axe scan.
Decisions needed
Which option above. Blocked on #289 merging first.
Model: anthropic/claude-opus-5-5 | Reasoning effort: unknown
- Lingua principale
- TypeScript
- Stelle
- 1
- Fork
- 1
- Merge medio
- 6h 56m
- PR unite (30g)
- 136
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di eddiejaoude/StackDash
-
area: docs documentation priority: P3 size: S
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
eddiejaoude/StackDash#462 ·
I maintainer di solito rispondono entro 1 giorno
-
area: web bug priority: P3 size: XS
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
eddiejaoude/StackDash#432 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area: database bug priority: P3 size: S
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eddiejaoude/StackDash#419 ·
I maintainer di solito rispondono entro 1 giorno
-
area: docs bug priority: P2 size: XS
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
eddiejaoude/StackDash#418 ·
I maintainer di solito rispondono entro 1 giorno
-
accessibility area: timeline bug priority: P3 size: XS
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
eddiejaoude/StackDash#389 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di eddiejaoude/StackDash
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
open-webui/tether#52 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
voidzero-dev/void#835 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AykutSarac/jsoncrack.com#616 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
melgarafael/DeskcommCRM#4679 ·
I maintainer di solito rispondono entro 1 giorno