fix(dashboard): sum a one-day metric over the month in the monthly trend
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 75/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- nextjs, playwright, postgresql, react, supabase, typescript
- Área
- analytics, data-visualization, databases
Línea de trabajo
Read src/lib/dashboard/trends.ts and the monthly read in supabase/migrations/20261201200000_backfilled_past_days.sql, then check how usage_snapshot_monthly_latest_rows preserves the single read. Start with the dashboard trend unit tests and cover both a complete month and a missing day; if changing SQL, add pgTAP coverage. Done when daily metrics show a full-month sum or unavailable for incomplete data, and the dashboard monthly trend Playwright spec passes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Context
Found by the Fable pre-production review on 2026-12-02 (main at cedc1914; every line reference below re-checked on main at cde5aa3b). Source: product triage report, new issue 7 (re-checked after #750 and #752 merged: still present).
A metric whose period is one day (PostHog daily signups, posthog.signups.daily, src/lib/adapters/posthog/index.ts:103; the per-day GitHub and DigitalOcean readings and new stars per day named in the report) is not a running total, so the monthly trend plots its rows as they are: "Each account contributes its latest row in a bucket" and "A series with no running total plots its rows as they are" (src/lib/dashboard/trends.ts:9-11, :17). The monthly read returns the last stored day of each month for such a series (usage_snapshot_monthly_latest, supabase/migrations/20261201200000_backfilled_past_days.sql:113-135, picking grouped.last_day), now read once per request through usage_snapshot_monthly_latest_rows (supabase/migrations/20261202130000_usage_snapshot_monthly_latest_rows.sql:40, #750).
Impact: low. The monthly view of a daily metric shows the month's last day as if it were the month, so a month with 300 signups can plot as 4.
Plan
- Classify a one-day-period series in the monthly read: sum its days within the month, and mark the month unavailable when a day is missing (never a partial sum, as
trends.ts:9-11requires). - Do it in the SQL read or in
trends.ts, whichever keeps the single read from #750; say which on the pull request.
Acceptance criteria
- A one-day metric's monthly value is the sum of its days, or unavailable when a day is missing.
- Unit tests cover both; pgTAP if the SQL changes.
- Playwright e2e: the dashboard monthly trend spec still passes.
Files and areas
src/lib/dashboard/trends.ts, possibly a migration replacing usage_snapshot_monthly_latest, tests.
Non-goals: running totals and finished months (#732, #752), the monthly comparison decision (#371).
Verification
npm run typecheck, npm run lint, npx vitest run src/lib/dashboard, npm run test:db.
Branch: <issue-number>-monthly-sum-daily-metric
Model: anthropic/claude-opus-5-5 | Reasoning effort: unknown
- Lenguaje dominante
- TypeScript
- Estrellas
- 13
- Forks
- 2
- Merge medio
- 5 h 20 min
- PR fusionados (30 d)
- 287
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de eddiejaoude/StackDash
-
area: integrations documentation priority: P2 size: XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
eddiejaoude/StackDash#798 ·
Los mantenedores suelen responder en 1 día
-
area: ops documentation priority: P3 size: XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
eddiejaoude/StackDash#796 ·
Los mantenedores suelen responder en 1 día
-
area: docs documentation impact: low priority: P3 size: XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
eddiejaoude/StackDash#790 ·
Los mantenedores suelen responder en 1 día
-
area: ops bug impact: low priority: P3 size: XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
eddiejaoude/StackDash#785 ·
Los mantenedores suelen responder en 1 día
-
area: connections enhancement impact: low priority: P3 size: XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
eddiejaoude/StackDash#768 ·
Los mantenedores suelen responder en 1 día
Todos los issues de eddiejaoude/StackDash
Issues similares
-
bot:ai-assisted component:midnight-js status:untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
midnightntwrk/midnight-js#1790 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
area:vscode bug has repro platform:macos platform:vscode regression
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDAbiertocheck:passed streams:add
Dificultad 1/5 Menos de una hora Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
effort/l priority/p1 risk/high triage/core
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
iflytek/skillhub#1188 · 1 comentario ·
Los mantenedores suelen responder en 1 día