From 96b37d4bdd7dcb41c7a02a08e3f14db2d6ceb8f8 Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 13 Mar 2026 11:52:09 +0100 Subject: [PATCH] Color player character names instead of left border Player characters now show their chosen color on their name text rather than as a left border glow. Left border is reserved for active row (accent) and concentration (purple). Co-Authored-By: Claude Opus 4.6 --- apps/web/src/components/combatant-row.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/web/src/components/combatant-row.tsx b/apps/web/src/components/combatant-row.tsx index f86fbe6..dad30bb 100644 --- a/apps/web/src/components/combatant-row.tsx +++ b/apps/web/src/components/combatant-row.tsx @@ -49,11 +49,13 @@ function EditableName({ combatantId, onRename, onShowStatBlock, + color, }: { name: string; combatantId: CombatantId; onRename: (id: CombatantId, newName: string) => void; onShowStatBlock?: () => void; + color?: string; }) { const [editing, setEditing] = useState(false); const [draft, setDraft] = useState(name); @@ -143,6 +145,7 @@ function EditableName({ onTouchCancel={cancelLongPress} onTouchMove={cancelLongPress} className="truncate text-left text-sm text-foreground cursor-text hover:text-hover-neutral transition-colors" + style={color ? { color } : undefined} > {name} @@ -482,10 +485,9 @@ export function CombatantRow({ } }, [combatant.isConcentrating]); - const pcColor = - combatant.color && !isActive && !combatant.isConcentrating - ? PLAYER_COLOR_HEX[combatant.color as keyof typeof PLAYER_COLOR_HEX] - : undefined; + const pcColor = combatant.color + ? PLAYER_COLOR_HEX[combatant.color as keyof typeof PLAYER_COLOR_HEX] + : undefined; return ( /* biome-ignore lint/a11y/noStaticElementInteractions: role="button" is set conditionally when onShowStatBlock exists */ @@ -499,7 +501,6 @@ export function CombatantRow({ isPulsing && "animate-concentration-pulse", onShowStatBlock && "cursor-pointer", )} - style={pcColor ? { borderLeftColor: pcColor } : undefined} onClick={onShowStatBlock} onKeyDown={ onShowStatBlock ? activateOnKeyDown(onShowStatBlock) : undefined @@ -566,6 +567,7 @@ export function CombatantRow({ combatantId={id} onRename={onRename} onShowStatBlock={onShowStatBlock} + color={pcColor} />