fix(spatial-office#12): show agent name labels only on hover

Per design-critique-1 Issue 3 (P1), agent name labels were always
visible and stacked into unreadable text when agents were near
each other. Now matches Stardew Valley convention: name shows
on hover only.

Single conditional change. The hover tooltip (Html overlay with
status + current task) is unchanged.
This commit is contained in:
Scott Scoble 2026-06-01 21:49:59 -07:00
parent 62f9afc011
commit f632f816a4

View file

@ -132,22 +132,24 @@ export default function AgentSprite({ agent, hovered, onHover }) {
/>
</mesh>
{/* Agent name label */}
<Text
position={
targetPos
? [targetPos[0], 0.7, targetPos[2]]
: [0, 0.7, 0]
}
fontSize={0.15}
color={agent.activity === 'offline' ? '#888888' : '#ffffff'}
anchorX="center"
anchorY="middle"
outlineWidth={0.01}
outlineColor="#000000"
>
{agent.name}
</Text>
{/* Agent name label — hover only (per design-critique-1 Issue 3, P1) */}
{hovered && (
<Text
position={
targetPos
? [targetPos[0], 0.7, targetPos[2]]
: [0, 0.7, 0]
}
fontSize={0.15}
color={agent.activity === 'offline' ? '#888888' : '#ffffff'}
anchorX="center"
anchorY="middle"
outlineWidth={0.01}
outlineColor="#000000"
>
{agent.name}
</Text>
)}
{/* Hover tooltip */}
{hovered && (