dice-core
2026-03-02
Centralize physics constants, extract D4 overlay, and address code review P1/P2 findings
45 files · 3,429+ · 2,135-
Physics constant centralization
3 files changed
defaults.tsCentralized all physics constants (restitution, friction, mass, gravity) into the config layerpre-simulate.tsUpdated to reference centralized physics constants instead of inline valuesspawn-configs.tsRefactored spawn logic to use centralized config
- Centralized all physics constants into the config defaults module, eliminating scattered inline values across simulation and component code
decouple
architectural
2 files
defaults.tspre-simulate.ts
Component architecture improvements
8 files changed
die-visuals.tsxRenamed from .ts to .tsx, extracted D4 overlay component, expanded with glow and material utilitiesDiceScene.tsxFixed promise leak, improved effect dependency managementDiceArena.tsxRefined state machine transitions and error handlingDiceRoller.tsxImproved prop forwarding and lifecycle managementDie.tsxSimplified die component with extracted visualsPlaybackDie.tsxSimplified playback componentChamber.tsxRefined chamber with centralized physics constantsErrorBoundary.tsxImproved error boundary with better state management
- Extracted D4 overlay into its own component within die-visuals.tsx and simplified Die/PlaybackDie by delegating visual concerns
streamline
architectural
3 files
die-visuals.tsxDie.tsxPlaybackDie.tsx
- Fixed a promise leak in DiceScene where pre-simulation results could be applied after abort
harden
behavioral
1 file
DiceScene.tsx
Dice notation parser consolidation
3 files changed
notation-parser.test.tsConsolidated all notation parser tests into a single comprehensive suite (952+ lines)modifiers.test.tsNew modifier test suite (308 lines)modifiers.tsNew modifiers module for roll modifications
- Consolidated scattered notation parser tests into a single comprehensive suite and added a dedicated modifiers module with full test coverage
streamline
behavioral
2 files
notation-parser.test.tsmodifiers.ts
Seeded RNG improvements
1 file changed
seeded-rng.tsImproved RNG with better seed handling and edge case protection
- Hardened the seeded RNG with improved seed handling and edge case protections
harden
behavioral
1 file
seeded-rng.ts
CI and testing
6 files changed
ci.ymlAdded CI workflow for automated linting, testing, and buildingDiceScene.test.tsxExpanded DiceScene tests (345+ lines)DiceArena.test.tsxExpanded DiceArena testsErrorBoundary.test.tsxNew ErrorBoundary test suiterapier-init.test.tsNew Rapier initialization testspre-simulate-worker.test.tsNew pre-simulate worker tests
- Added CI workflow and significantly expanded test coverage with new suites for DiceScene, ErrorBoundary, Rapier init, and pre-simulate worker
qualify
behavioral
2 files
ci.ymlDiceScene.test.tsx
Type system refinement
3 files changed
config.tsRefined config types with better optional handling and documentationdice.tsAdded new dice type definitionsindex.tsUpdated public API surface