Skip to content

fix: component improvements and missing exports#5

Merged
gfargo merged 1 commit into
mainfrom
fix/component-improvements
Mar 23, 2026
Merged

fix: component improvements and missing exports#5
gfargo merged 1 commit into
mainfrom
fix/component-improvements

Conversation

@gfargo

@gfargo gfargo commented Mar 23, 2026

Copy link
Copy Markdown
Owner

Summary

A batch of fixes and improvements across several components, contexts, and exports.

Changes

Bug fixes:

  • Deck component: Replaced React.CSSProperties style prop with Ink's BoxProps, removed @ts-ignore suppression
  • DeckContext: Each DeckProvider now creates its own EventManager and EffectManager instances instead of sharing module-level singletons — fixes event bleed between multiple providers
  • GameContext: Added dispatch to useMemo dependency array for consistency with DeckProvider

Missing exports:

  • UnicodeCard and UnicodeCardProps are now exported from the public API (src/index.tsx)

Feature:

  • CardStack now renders CustomCard components for non-standard cards instead of silently dropping them

Cleanup:

  • Deleted dead robotCard.test.bak file

Tests (10 new):

  • 8 new UnicodeCard tests: jokers (red/black/white), suit color verification, rounded={false}, face-down without dimmed, 10-value card
  • 2 new CardStack tests: custom-only stack, mixed standard + custom stack

Test results

165 tests passing, lint clean.

- Fix Deck component: replace React.CSSProperties with Ink BoxProps, remove @ts-ignore
- Fix DeckContext: create per-provider EventManager/EffectManager instances instead of shared singletons
- Fix GameContext: add dispatch to useMemo dependency array for consistency
- Export UnicodeCard and UnicodeCardProps from public API
- CardStack: support rendering custom cards alongside standard cards
- Delete dead robotCard.test.bak file
- Add 8 new UnicodeCard tests (jokers, suits, rounded, edge cases)
- Add 2 new CardStack tests (custom cards, mixed standard+custom)
@gfargo gfargo merged commit 90f7be3 into main Mar 23, 2026
2 checks passed
@gfargo gfargo deleted the fix/component-improvements branch March 23, 2026 18:38
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