trends.stumason.dev
TypeScript
Pull Request Merged
PR #120 merged: feat(ux): phase 8 — per-prediction share view + pre-warm scheduler
Scope
Phase 8 of the UX overhaul (plan / audit / tokens / brief).
Two showpiece editorial features bolted on top of the foundational work: a screenshot-ready per-prediction share view, and scheduler pre-warm so the slow reports don't pay the 20s render cost on first visit after deploy.
What's in
/reports/predictions/{id}route +predictionShareCard()controller — 200 for resolved predictions; 404 for missing or unresolved.reports/prediction-share.tsx— share card composed of: top eyebrow, bigtext-displaystory title, two-column metric strip (PREDICTED / ACTUAL) using<MetricValue>, "we called this" line with<StatusBadge>and short rationale, sparkline ofscore_history, footer with predicted/resolved timestamps +<SmartLink>to source URL. Designed for 1200×800 screenshotting.<Sparkline>(new) — minimal recharts line, strokevar(--color-accent-brand), no axes/grid/tooltip. Accepts{t, score}or{t, s}data shape; "Not enough data" empty state when <2 points.routes/console.php— two staggeredreports:refreshentries (30 */4/35 */4) for AnthropicVsOpenAi + ClaudeCodeWars.- 4 new Pest cases for the controller (200/404/404 + schedule-list smoke).
Pragmatic notes
score_historyshape: brief said{t, s}butPredictionFactoryships{t, score}. Sparkline accepts either to be robust.- Route ordered before
/reports/{slug}for intent clarity (whereNumber('id') already disambiguates).
Test plan
-
npm run buildclean -
vendor/bin/pint --dirty --format agentclean -
php artisan test --compact— 192 pass + 4 new, 26 skipped, 2 pre-existing LinkedIn failures (unrelated) -
php artisan schedule:list | grep reports:refresh— both entries present
Merge order note
⚠️ #119 (token-utility fix) should ship first. Without that, none of Phases 1–7's visual work actually renders on prod, and Phase 8's share view will also no-op its text-strong / border-default / bg-panel-raised classes. Merge #119, let Coolify deploy, then merge this.
+364
additions
-1
deletions
7
files changed