Docs sync + DRY/reuse refactors - #88
Conversation
- SETUP: /control -> /dashboard (route was renamed) - README + .env.example: add ALCHEMY_STATE_TOKEN (shared alchemy-state worker); fix rewards overlay size 1920x1080 -> 760x540; drop the retired per-overlay size-slider claims; document the rewards Mirror toggle - add a lean repo CLAUDE.md (build/deploy gotchas + reuse/design conventions) - remove UIUX-REVIEW-SETTINGS-NAV: all its findings shipped Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Dedupe the broadcaster (api router) and bot (server worker) token paths onto refreshAndPersistUserToken + tokenFresh + TOKEN_REFRESH_SKEW_MS in packages/api/twitch.ts. Each caller keeps its own persist shape and error mapping; the skew constant, refresh call, and expiry math are now shared. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the repeated #00aced/#5bc8f0/#0077c8 fallback literals with exported BRAND_DARK/ACCENT/LIGHT/STOPS in theme.ts, reused by the overlay + timer views and the theme editor. Also fixes the drifted 760x380 -> 760x540 doc comment in overlay-view. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- extract NumberStepper (minus / tabular-nums field / plus with clamp + step) and adopt it in subs-control and the goal-editor target stepper - delete card/dropdown-menu/skeleton (zero imports across the repo) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- OverlayShell wraps the fixed transparent frame + token-error hint for the three OBS overlay pages (the token+query stays inline — typing a wrapper around tRPC queryOptions costs more than it saves) - OVERLAY_SIZES: one home for each source's size string + preview aspect class, killing the 760x380/760x540 drift; used by overlays-tab and the previews - LIVE_POLL_MS: shared 3s cadence for the wheel + giveaway surfaces Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the two hand-rolled navigator.clipboard.writeText + toast calls with the shared hook (already used by the giveaway + overlays cards). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Twitch and bot panels shared the OAuth-callback effect, the tri-state status card + "Checking connection…" loader, and the ~40-line Disconnect confirm dialog. Extract ConnectionCard / CheckingConnection / DisconnectDialog + useOAuthCallback; each panel keeps its own (genuinely different) status body and inline connect(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 27 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (33)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Two things: (1) bring the docs back in line with the current codebase, and (2) act on a DRY/reuse audit — reuse existing
packages/uiprimitives andpackages/apihelpers instead of hand-rolled copies. No behaviour change intended.Docs sync
/control→/dashboard(the operator route was renamed; README was already updated, SETUP was not).packages/infra/.env.example: addALCHEMY_STATE_TOKEN(deploy state moved to the shared account-widealchemy-stateCloudflareStateStore); fix the rewards overlay size1920×1080→760×540; drop the retired per-overlay size-slider claims (overlays render at fixed native size now); document the rewards Mirror (?side=right) toggle.CLAUDE.md: lean pointer to README/SETUP + the non-obvious gotchas (Bun-segfaults-Alchemy →tsxdeploy; public-Worker vs Access-gated/api/trpcvs?t=overlay-token split;ALCHEMY_STATE_TOKEN) and a conventions section (use/frontend-design+/uiux-reviewfor UI work; reusepackages/ui/packages/apiover re-implementing).UIUX-REVIEW-SETTINGS-NAV-2026-07-04.md— every finding shipped (settings sidebarmd:max-h/overflow-y-auto, headerflex-wrap).Refactors (from a DRY/reuse audit)
twitchrefreshAndPersistUserToken+tokenFresh+TOKEN_REFRESH_SKEW_MSshared by the broadcaster (api router) and bot (server worker) token pathsthemeBRAND_DARK/ACCENT/LIGHT/STOPS, reused across overlay/timer views + theme editoruiNumberStepper(adopted insubs-control+goal-editor); deleted deadcard/dropdown-menu/skeleton(0 imports)OverlayShellwrapper for the 3 OBS pages;OVERLAY_SIZES(size + preview aspect in one place — this is what had drifted to760×380);LIVE_POLL_MSfor the wheel/giveaway 3s pollimport-exportcopy routed throughuseCopyToClipboard; sharedConnectionCard/CheckingConnection/DisconnectDialog+useOAuthCallbackfor the Twitch + bot panelsDeliberately scoped out
<button>→<Button>: the audit found these are mostly legitimately custom (color swatches, segmented tabs); converting them would be wrong.usePolledPublicquery hook: a shared hook around tRPC'squeryOptionsneedsany-laden generics; the token+query stays inline (3 lines/page). TheOverlayShellwrapper — the real dedup — is kept.connect()OAuth-redirect fn stays inline per panel (6 lines; a typed extraction costs more than it saves).Verification
bun run check-types✅bun run test✅ (153 pass)bun run check(eslint + prettier) ✅🤖 Generated with Claude Code