fix(dashboard): link to the year in review only when included accounts have data
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- next.js, playwright, react, supabase, typescript
- Domain
- backend-api-design, database, testing
Research direction
Start with src/lib/data/year-review.ts and compare hasYearData with the included-account filtering in src/lib/public-metrics/supabase-store.ts; then read the year-review section of docs/architecture/public-metrics.md. Update the dashboard link rule, document it, and cover excluded-account and include-it-again behavior in e2e/year-in-review.spec.ts. Done means only rows the year page counts make the link appear, with both database reads measured and their plans and times recorded in the pull request.
Written by the indexing model from the issue text.
Description
Context
PR #718 (issue #704) shows the dashboard's year in review link once the workspace stores an activity event or usage snapshot dated in that year: hasYearData in src/lib/data/year-review.ts reads activity_events and usage_snapshots by workspace_id and date only. The year page counts something narrower. computeYearReview reads through createSupabaseMetricStore(supabase, workspaceId, null), which takes only the workspace's included accounts (src/lib/public-metrics/supabase-store.ts:57, .eq("included", true)), and its providers figure is "distinct providers with an included account connected before asOf" (src/lib/public-metrics/yearly.ts:104). When that is 0 the page says "No provider was connected in " (src/app/w/[workspace]/year/[year]/page.tsx:104).
So a workspace whose only data this year sits on excluded accounts gets the link, and the link opens a page that says nothing was connected. StackDash's own events (provider null, no account, such as stackdash.daily_summary, which enqueue_daily_summaries queues for every workspace with a connection that is not revoked) count toward the link too, and the year page does not count them either.
Found by the Fable review of PR #718 (round 1, review body), and kept out of that PR because #704 settles the link's rule in one sentence.
Reproduced on 02951a17 (branch 704-hide-year-review-without-data), Chromium, 1366 by 900, local Supabase, synthetic e2e workspace: one active GitHub connection whose only account is excluded (included = false) and one github.push event on it an hour ago.
The dashboard offers the link:
The link opens a year page that says no provider was connected:
Plan
- Decide the rule: the link shows once the year page would count something, meaning an event or snapshot of an included account dated in the year. StackDash's own events, which have no account, do not count.
- Change
hasYearDatato read only included accounts' rows. Either join throughexternal_accounts(included = true), or read the included account ids first (ascreateSupabaseMetricStoredoes, bounded byACCOUNTS_LIMIT) and filterexternal_account_idwithin. - Measure both reads with
explain (analyze, buffers)as a member at about a million events, for a workspace with no included rows in the year and for one with rows, and record the plans and times in the function's comment. The current reads useactivity_events_workspace_timeline_idxandusage_snapshots_workspace_date_idx(measured in PR #718). Keep each read on an index range scan. - Update the year in review section of
docs/architecture/public-metrics.mdto state the narrower rule.
Acceptance criteria
- A workspace whose only rows in the year belong to excluded accounts shows no year in review link on the dashboard.
- A workspace with only StackDash's own events in the year (no account) shows no link.
- Including the account brings the link back, and it opens a year page that counts that account.
- Both reads are measured as a member at about a million events, and the plans and times are quoted in the pull request.
- Playwright:
e2e/year-in-review.spec.tscovers the excluded account case and the include-it-again case.
Files and areas
src/lib/data/year-review.ts(hasYearData)src/app/w/[workspace]/dashboard/page.tsx(YearReviewLink, only if its inputs change)docs/architecture/public-metrics.mde2e/year-in-review.spec.ts
Non-goals: the year page and its "No provider was connected" state, the command palette's Year in review entry, latestCardYear, and where the link sits in the header.
Verification
npm run typecheck,npm run lint,npm test: pass.safe-e2e.sh <worktree> <port> e2e/year-in-review.spec.ts e2e/dashboard.spec.ts: pass.- The plans from step 3, quoted in the pull request.
Branch: <issue-number>-<slug>, cut from main once PR #718 has merged.
Closes with a Closes #<issue-number> footer on the commit or pull request.
Model: anthropic/claude-opus-5-5 | Reasoning effort: not reported by the harness
- Dominant language
- TypeScript
- Stars
- 13
- Forks
- 2
- Avg merge
- 5h 20m
- Merged PRs (30d)
- 287
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eddiejaoude/StackDash
-
area: integrations documentation priority: P2 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eddiejaoude/StackDash#798 ·
Maintainers usually reply within 1 day
-
area: ops documentation priority: P3 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
eddiejaoude/StackDash#796 ·
Maintainers usually reply within 1 day
-
area: docs documentation impact: low priority: P3 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
eddiejaoude/StackDash#790 ·
Maintainers usually reply within 1 day
-
area: ops bug impact: low priority: P3 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
eddiejaoude/StackDash#785 ·
Maintainers usually reply within 1 day
-
area: connections enhancement impact: low priority: P3 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
eddiejaoude/StackDash#768 ·
Maintainers usually reply within 1 day
All issues in eddiejaoude/StackDash
Similar issues
-
bot:ai-assisted component:midnight-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
midnightntwrk/midnight-js#1790 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area:vscode bug has repro platform:macos platform:vscode regression
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
effort/l priority/p1 risk/high triage/core
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
iflytek/skillhub#1188 · 1 comment ·
Maintainers usually reply within 1 day