Implement the 011-quick-hp-input feature that adds an inline damage/heal numeric input per combatant row with mode toggle, keyboard workflow, and visual distinction

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-03-05 22:43:26 +01:00
parent 1c40bf7889
commit a0d85a07e3
10 changed files with 644 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import type { CombatantId } from "@initiative/domain";
import { X } from "lucide-react";
import { useCallback, useRef, useState } from "react";
import { cn } from "../lib/utils";
import { QuickHpInput } from "./quick-hp-input";
import { Button } from "./ui/button";
import { Input } from "./ui/input";
@@ -228,6 +229,9 @@ export function CombatantRow({
<span className="text-sm tabular-nums text-muted-foreground">/</span>
)}
<MaxHpInput maxHp={maxHp} onCommit={(v) => onSetHp(id, v)} />
{maxHp !== undefined && (
<QuickHpInput combatantId={id} onAdjustHp={onAdjustHp} />
)}
</div>
{/* Actions */}