Combat UI Pattern A - Split-Panel Implementation
This skill guides implementation of the Split-Panel Combat UI, transforming the vertical theater mode into a horizontal confrontation layout.
Architecture Overview
┌───────────────────────────────────────────────────┐
│ TURN INDICATOR │ PHASE PIPELINE │ MODIFIERS │ ← PhaseHeader
├──────────────────┴───────┬───────────┴────────────┤
│ │ │
│ PLAYER PANEL │ ENEMY PANEL │ ← ConfrontationZone
│ (CharacterPanel) │ (CharacterPanel) │
│ │ │
├──────────────────────────┴────────────────────────┤
│ QUICK ACTIONS (SIDE/TOGGLE) │ MAIN ACTIONS │ ← ActionDock
└───────────────────────────────┴───────────────────┘
Component Hierarchy & File Structure
→ See references/architecture.md for the full component tree and the src/components/combat/ file layout.
Implementation Workflow
Step 1: Identify Target Component
Ask user which component to implement:
- CombatLayout - Start here for new implementation
- PhaseHeader - Top status bar
- ConfrontationZone - Battle area with both panels
- CharacterPanel - Individual character display
- VSDivider - Center emblem and effects
- ActionDock - Bottom skill bar
- QuickActionCard - Compact skill card variant
- MainActionCard - Large skill card variant
Step 2: Load Component Reference
Based on selection, load the appropriate reference:
- Layout/Structure: See layout-specs.md
- Component Props: See component-interfaces.md
- Styling Guide: See styling-tokens.md
- Animation Specs: See animations.md
Step 3: Generate Component Code
Follow the component template pattern → copy from templates/component-template.tsx.
Step 4: Wire to Combat.tsx
After component creation:
- Export from
components/combat/index.ts - Import in
Combat.tsx - Replace corresponding section
- Pass required props from existing state
Quick Implementation Commands
→ See templates/scaffolding.md for the mkdir/touch scaffolding commands and the barrel export template.
Props Mapping from Existing Code
→ See references/props-mapping.md for App.tsx→Combat.tsx props and the Combat.tsx→new-component prop wiring.
Migration Strategy
Phase 1: Layout Foundation
- Create
CombatLayout.tsxwith CSS Grid - Create placeholder components
- Add feature flag in Combat.tsx
Phase 2: Component Extraction
- Implement
CharacterPanel(extract from PlayerHUD + CinematicViewscreen) - Implement
ActionDock(extract from skill grids) - Implement
PhaseHeader(extract from inline indicators)
Phase 3: Visual Polish
- Add
VSDividerwith effects - Implement animations
- Adjust floating text positions
Phase 4: Cleanup
- Remove old theater mode code
- Remove feature flag
- Update tests
Reference Files
- layout-specs.md - CSS Grid structure, responsive breakpoints
- component-interfaces.md - TypeScript interfaces for all components
- styling-tokens.md - Colors, spacing, typography tokens
- animations.md - Animation keyframes and transitions
Output Format
Generate TypeScript React components with:
- TypeScript interface for props
- Tailwind CSS for styling (matching existing codebase)
- Responsive classes (mobile fallback to vertical)
- Memoization where appropriate (React.memo for cards)
- Accessibility attributes (aria-labels, roles)
Existing Code References
→ See references/props-mapping.md (Existing Code References table) for which existing file to extract each new component from.