Replace prop drilling with React context providers. App.tsx shrinks
from 427 lines to ~80 lines of pure layout. Components consume shared
state directly via 7 context providers instead of threading 50+ props.
Key changes:
- 7 context providers wrapping existing hooks (encounter, bestiary,
player characters, side panel, theme, bulk import, initiative rolls)
- 2 coordinating hooks extracted from App.tsx (useInitiativeRolls,
useAutoStatBlock)
- All 9 affected components refactored from prop-based to context-based
- 6 test files updated to use providers or context mocks
- Prop count enforcement script (max 8 per component interface)
- Constitution principle II-A added (context-based state flow)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds aria-label attributes to HP placeholder and source delete buttons
for both accessibility and testability.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mark component props as Readonly<> across 15 component files and
simplify edit-player-character field access with optional chaining
and nullish coalescing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Source rows disappear immediately when cleared instead of waiting
for the IndexedDB operation to complete. Real state syncs after.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace raw <button> elements with Button variant="ghost" in stat-block
panel, toast, player modals. Add icon-sm size variant (h-6 w-6) for
compact contexts. Consolidate text button sizes into a single default
(h-8 px-3), removing the redundant sm variant. Add size prop to
ConfirmButton for consistent sizing.
Button now has three sizes: default (text), icon, icon-sm.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ConfirmButton now shows hover:text-hover-destructive in its default
state. Source manager delete buttons and Clear All get matching
destructive hover styling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>