fix: hide hover avatar for current user's own player

Only show hover avatars for remote players (opponents), not the current
user's own player. This prevents the distracting behavior where users
would see a floating avatar following their own mouse cursor.

The filter now checks:
- playerMetadata[playerId].userId !== viewerId (remote player check)
- playerId === state.currentPlayer (only show for active turn)

This maintains the "presence" feature for opponents while keeping the
current user's view clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock
2025-10-10 12:44:48 -05:00
parent 4125d8eb41
commit dba42b5925

View File

@@ -401,9 +401,13 @@ export function MemoryGrid() {
{state.playerHovers &&
Object.entries(state.playerHovers)
.filter(([playerId]) => {
// Only show avatar for the CURRENT player whose turn it is
// Don't show for other players (they're waiting for their turn)
return playerId === state.currentPlayer;
// Only show hover avatars for REMOTE players (not the current user's own players)
// This provides "presence" for opponents without cluttering your own view
const playerMetadata = state.playerMetadata?.[playerId];
const isRemotePlayer = playerMetadata?.userId !== viewerId;
// Also ensure it's the current player's turn (so we only show active hovers)
const isCurrentPlayer = playerId === state.currentPlayer;
return isRemotePlayer && isCurrentPlayer;
})
.map(([playerId, cardId]) => {
const playerInfo = getPlayerHoverInfo(playerId);