Share the set charts between the console and the guest site #35

Merged
forgejo-admin merged 1 commit from feature/shared-set-charts into main 2026-09-28 06:18:09 +00:00

Problem

The upcoming guest site at /live needs the same set charts as the console. Right now those charts live inside SetStats, next to the console's tRPC calls, so nothing else can reuse them. Separately, a play whose track is unrated on a dimension was silently dropped from that trend, which shifted every later point left.

Solution

  • app/shared/chartData.ts holds pure helpers: setTrends, categoryCounts and runs. TREND_DIMS moves here from the router.
  • app/shared/SetCharts.tsx is a pure lasertag component that takes plain props. SetStats renders it, and the set view's taller charts become a tall prop.
  • setStats in the router builds its trends and counts with the shared helpers. Unrated plays stay as null, so the line breaks there and the averages still ignore them.
  • bun run check now also lints app/**/*.module.css.

This is Slice 2 of projects/2026-09-27-dj-online-companion/plan.md.

Testing

  • bun test: 109 pass. That includes the new chartData tests and a router test showing an unrated play charts as a gap.
  • bun run check: tsc is clean, and lasertag reports no dead CSS.
  • Manual: open /retro on a past set and confirm the charts look as they did before.

🤖 Generated with Claude Code

## Problem The upcoming guest site at `/live` needs the same set charts as the console. Right now those charts live inside `SetStats`, next to the console's tRPC calls, so nothing else can reuse them. Separately, a play whose track is unrated on a dimension was silently dropped from that trend, which shifted every later point left. ## Solution - `app/shared/chartData.ts` holds pure helpers: `setTrends`, `categoryCounts` and `runs`. `TREND_DIMS` moves here from the router. - `app/shared/SetCharts.tsx` is a pure lasertag component that takes plain props. `SetStats` renders it, and the set view's taller charts become a `tall` prop. - `setStats` in the router builds its trends and counts with the shared helpers. Unrated plays stay as `null`, so the line breaks there and the averages still ignore them. - `bun run check` now also lints `app/**/*.module.css`. This is Slice 2 of `projects/2026-09-27-dj-online-companion/plan.md`. ## Testing - `bun test`: 109 pass. That includes the new `chartData` tests and a router test showing an unrated play charts as a gap. - `bun run check`: `tsc` is clean, and lasertag reports no dead CSS. - Manual: open `/retro` on a past set and confirm the charts look as they did before. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Unrated plays now chart as gaps instead of being dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
forgejo-admin deleted branch feature/shared-set-charts 2026-09-28 06:18:09 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
celilo/tango-dj!35
No description provided.