Skip to content

feat(theme): vote-leader auto-accent extension - #2

Merged
IceboxDev merged 2 commits into
masterfrom
batch/theme-auto-accent
Sep 4, 2026
Merged

feat(theme): vote-leader auto-accent extension#2
IceboxDev merged 2 commits into
masterfrom
batch/theme-auto-accent

Conversation

@IceboxDev

@IceboxDev IceboxDev commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Adds the night-sync theme extension for the personalization batch: packages/web/src/lib/theme/extensions/vote-leader.ts (+ colocated tests). Default export { key: "vote-leader", useAccentOverride }, where the hook signature is useAccentOverride(active: boolean = true): string | null — the engine calls it unconditionally on every provider render as useAccentOverride(config.accentMode === "night-sync"), so rules-of-hooks hold in every mode while the fetch only fires when night-sync is actually on.

useAccentOverride(active) returns the accentHex of the nearest locked night (today or later) whose night vote has a leader (topGameSlug), resolved through the game registry, else null. It shares qk.calendarLocks() + fetchCalendarLocks with existing consumers (5-minute staleTime restated), and the query is enabled: !!user && active — logged-out users and non-night-sync accent modes never hit the API. Deliberately reads only the night vote — the purchase-poll tally is hidden from non-admin clients.

Dead code until the theme engine (batch/theme-engine) lands its extension discovery (import.meta.glob("./extensions/*.ts{,x}"), excluding *.test.* per coordinator); seeded-QueryClient hook tests + typecheck are the acceptance.

🤖 Generated with Claude Code

https://claude.ai/code/session_011r16ejkf3HB6tyZfTeA3Eb

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
board-games-server Ready Ready Preview Sep 3, 2026 11:56pm UTC

Request Review

@IceboxDev
IceboxDev merged commit 1d55d59 into master Sep 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant