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> </mesh>
{/* Agent name label */} {/* Agent name label — hover only (per design-critique-1 Issue 3, P1) */}
<Text {hovered && (
position={ <Text
targetPos position={
? [targetPos[0], 0.7, targetPos[2]] targetPos
: [0, 0.7, 0] ? [targetPos[0], 0.7, targetPos[2]]
} : [0, 0.7, 0]
fontSize={0.15} }
color={agent.activity === 'offline' ? '#888888' : '#ffffff'} fontSize={0.15}
anchorX="center" color={agent.activity === 'offline' ? '#888888' : '#ffffff'}
anchorY="middle" anchorX="center"
outlineWidth={0.01} anchorY="middle"
outlineColor="#000000" outlineWidth={0.01}
> outlineColor="#000000"
{agent.name} >
</Text> {agent.name}
</Text>
)}
{/* Hover tooltip */} {/* Hover tooltip */}
{hovered && ( {hovered && (