Implement the 014-inline-hp-delta feature that replaces the damage/heal mode toggle with explicit action buttons and Enter-to-damage keyboard shortcut
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
42
specs/014-inline-hp-delta/data-model.md
Normal file
42
specs/014-inline-hp-delta/data-model.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Data Model: Inline HP Delta Input
|
||||
|
||||
## No data model changes
|
||||
|
||||
This feature does not modify any domain entities, events, or state transitions. The existing data model fully supports the new UI:
|
||||
|
||||
### Existing Entities (unchanged)
|
||||
|
||||
**Combatant**
|
||||
- `id`: CombatantId (branded string)
|
||||
- `name`: string
|
||||
- `initiative?`: number
|
||||
- `maxHp?`: number
|
||||
- `currentHp?`: number
|
||||
|
||||
**Encounter**
|
||||
- `combatants`: readonly Combatant[]
|
||||
- `activeIndex`: number
|
||||
- `roundNumber`: number
|
||||
|
||||
### Existing Domain Function (unchanged)
|
||||
|
||||
**adjustHp(encounter, combatantId, delta) -> AdjustHpSuccess | DomainError**
|
||||
- Negative delta = damage, positive delta = heal
|
||||
- Clamps result to [0, maxHp]
|
||||
- Emits `CurrentHpAdjusted` event
|
||||
|
||||
### Existing Domain Event (unchanged)
|
||||
|
||||
**CurrentHpAdjusted**
|
||||
- `combatantId`: CombatantId
|
||||
- `previousHp`: number
|
||||
- `newHp`: number
|
||||
- `delta`: number
|
||||
|
||||
### UI State Changes
|
||||
|
||||
The only state change is in the QuickHpInput component:
|
||||
- **Removed**: `mode: "damage" | "heal"` state variable
|
||||
- **Kept**: `value: string` state variable for the input field
|
||||
|
||||
The action (damage vs heal) is now determined at invocation time by which button/key triggered it, not by a stored mode.
|
||||
Reference in New Issue
Block a user