Skip to content

Refactor: extract shared CSS, split reducer, clean up dead code - #24

Merged
lchoward merged 1 commit into
mainfrom
feature/fli-9-refactor
Feb 19, 2026
Merged

lchoward merged 1 commit into
mainfrom
feature/fli-9-refactor

Conversation

@lchoward

Copy link
Copy Markdown
Owner

Summary

  • Delete dead GameHistory component and unused react.svg asset
  • Extract duplicated CSS into shared.css (scoreboard styles, bust-chance colors, CPU badges, tiebreaker/cheater toggles)
  • Create reusable BustChanceBanner component replacing duplicate IIFE blocks in PlayRound and RoundEntry
  • Extract flattenHandWithCancelled utility into handUtils.js and createEmptyDealtCards into deckUtils.js
  • Split play-mode actions (~450 lines) into separate playModeReducer.js
  • Remove global SET_DIALOG action in favor of local useState in HomeScreen and GameScreen
  • Standardize NAVIGATE payload to { screen, editingRound?, playerId? } across all components
  • Remove unused getDealtCards/getDeckStatus helpers and reorganize test utils

Net result: -426 lines (1000 added, 1426 removed), with cleaner separation of concerns and less duplication.

Fixes FLI-9

Test plan

  • npm run build passes
  • All 140 tests pass (npx vitest run)
  • Lint shows only pre-existing warnings
  • Manual smoke test: Score Tracker mode — start game, enter round, verify scoreboard
  • Manual smoke test: Play Mode — start game, play round with cheater mode, verify bust-chance banner
  • Manual smoke test: tiebreaker banner appears when players tie at 200+
  • Manual smoke test: CPU players behave correctly

🤖 Generated with Claude Code

- Delete dead GameHistory component and unused react.svg asset
- Extract duplicated CSS into shared.css (scoreboard, bust colors, badges, banners)
- Create BustChanceBanner component replacing duplicate IIFE blocks
- Extract flattenHandWithCancelled utility into handUtils.js
- Add createEmptyDealtCards to deckUtils.js
- Split play-mode actions into separate playModeReducer.js (~450 lines)
- Remove global SET_DIALOG in favor of local useState in components
- Standardize NAVIGATE payload to { screen, editingRound?, playerId? }
- Remove unused getDealtCards/getDeckStatus helpers
- Move test-helpers.js to test-utils/helpers.js

Fixes FLI-9

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear

linear Bot commented Feb 19, 2026

Copy link
Copy Markdown

@lchoward
lchoward merged commit 68f0209 into main Feb 19, 2026
1 check passed
@lchoward
lchoward deleted the feature/fli-9-refactor branch February 19, 2026 09:16
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