라이어 게임: "입력 중…" 표시를 오른쪽 상태 줄에서 토론 채팅 칸 안(입력칸 바로 위)으로

- GameUI.typingInChat: 게임 채팅 칸이 입력 중 표시를 맡고, 상태 줄은 컴퓨터 "생각 중"만 보인다
- BotActivity: only='thinking', hide(설명 차례인 컴퓨터는 채팅이 아니라 설명을 치는 중이라 빼기)
- e2e: 토론 중 입력하면 다른 사람 화면의 토론 채팅 칸 안에만 "입력 중"이 보이는지 확인

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-18 01:25:13 +09:00
parent fcc79f05bc
commit 03e0e8ed84
5 changed files with 23 additions and 5 deletions

View File

@@ -3,14 +3,15 @@ import { useRoom } from '../net/socket';
/**
* What the computers are doing right now (docs/06 §12.1): "🤖 컴퓨터 1 생각 중…", "💬 컴퓨터 2 입력 중…", and people
* typing ("💬 고양이 입력 중…", `ch`: the room chat or the game's own public chat).
* typing ("💬 고양이 입력 중…", `ch`: the room chat or the game's own public chat). `hide`: ids left out (라이어 게임:
* the computer typing its description is not typing in the chat).
* Not announced to screen readers: the chat line or the move that follows is.
*/
export function BotActivity({ room, only, ch }: { room: RoomView; only?: 'typing'; ch?: 'room' | 'game' }) {
export function BotActivity({ room, only, ch, hide }: { room: RoomView; only?: 'typing' | 'thinking'; ch?: 'room' | 'game'; hide?: string[] }) {
const typing = useRoom((s) => s.typing);
const me = useRoom((s) => s.me?.id);
const entries = Object.entries(room.botActivity ?? {}).filter(([, a]) => !only || a === only);
const people = ch ? Object.entries(typing).filter(([id, t]) => t.ch === ch && id !== me) : [];
const entries = Object.entries(room.botActivity ?? {}).filter(([id, a]) => (!only || a === only) && !hide?.includes(id));
const people = ch && only !== 'thinking' ? Object.entries(typing).filter(([id, t]) => t.ch === ch && id !== me && !hide?.includes(id)) : [];
if (!entries.length && !people.length) return null;
const name = (id: string, fallback: string) =>
room.seats.find((s) => s?.user.id === id)?.user.nickname ?? room.spectators.find((u) => u.id === id)?.nickname ?? fallback;