From 064af16f95677158d3ce5d18f4284f037cffbeed Mon Sep 17 00:00:00 2001 From: Lukas Date: Sat, 11 Apr 2026 13:06:31 +0200 Subject: [PATCH] Fix persistent damage tag ordering and differentiate condition icons - Render persistent damage tags before the "+" button, not after - Use insertion order for conditions on the row instead of definition order - Differentiate Undetected condition (EyeClosed/slate) from Invisible (Ghost/violet) - Use purple for void persistent damage to distinguish from violet conditions Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/web/src/components/combatant-row.tsx | 17 ++++++++++------- apps/web/src/components/condition-styles.ts | 3 +++ apps/web/src/components/condition-tags.tsx | 4 ++++ .../src/__tests__/toggle-condition.test.ts | 13 +++++++------ packages/domain/src/conditions.ts | 4 ++-- packages/domain/src/persistent-damage.ts | 2 +- packages/domain/src/toggle-condition.ts | 14 ++------------ 7 files changed, 29 insertions(+), 28 deletions(-) diff --git a/apps/web/src/components/combatant-row.tsx b/apps/web/src/components/combatant-row.tsx index f297add..220a956 100644 --- a/apps/web/src/components/combatant-row.tsx +++ b/apps/web/src/components/combatant-row.tsx @@ -618,14 +618,17 @@ export function CombatantRow({ onRemove={(conditionId) => toggleCondition(id, conditionId)} onDecrement={(conditionId) => decrementCondition(id, conditionId)} onOpenPicker={() => setPickerOpen((prev) => !prev)} - /> + > + {isPf2e && ( + + removePersistentDamage(id, damageType) + } + /> + )} + - {isPf2e && ( - removePersistentDamage(id, damageType)} - /> - )} {!!pickerOpen && ( = { EarOff, Eclipse, Eye, + EyeClosed, EyeOff, Flame, FlaskConical, @@ -92,6 +94,7 @@ export const CONDITION_COLOR_CLASSES: Record = { pink: "text-pink-400", amber: "text-amber-400", orange: "text-orange-400", + purple: "text-purple-400", gray: "text-gray-400", violet: "text-violet-400", yellow: "text-yellow-400", diff --git a/apps/web/src/components/condition-tags.tsx b/apps/web/src/components/condition-tags.tsx index ce9c67f..9440f72 100644 --- a/apps/web/src/components/condition-tags.tsx +++ b/apps/web/src/components/condition-tags.tsx @@ -5,6 +5,7 @@ import { getConditionDescription, } from "@initiative/domain"; import { Plus } from "lucide-react"; +import type { ReactNode } from "react"; import { useRulesEditionContext } from "../contexts/rules-edition-context.js"; import { cn } from "../lib/utils.js"; import { @@ -18,6 +19,7 @@ interface ConditionTagsProps { onRemove: (conditionId: ConditionId) => void; onDecrement: (conditionId: ConditionId) => void; onOpenPicker: () => void; + children?: ReactNode; } export function ConditionTags({ @@ -25,6 +27,7 @@ export function ConditionTags({ onRemove, onDecrement, onOpenPicker, + children, }: Readonly) { const { edition } = useRulesEditionContext(); return ( @@ -69,6 +72,7 @@ export function ConditionTags({ ); })} + {children}