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

- 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

@@ -16,6 +16,8 @@ import { cssEsc, useBanner, type BannerTone } from '../card-fx';
import { ChatMessage, nameHue, sameRun } from '../../components/ChatMessage';
import { useStickToBottom } from '../../lib/useStickToBottom';
import { keepFocus, useTypingSignal } from '../../lib/chat-input';
import { useRoom } from '../../net/socket';
import { BotActivity } from '../../components/BotActivity';
import type { BoardProps, GameUI, OptionsProps } from '../types';
import { helpNow } from './help';
import { quickStart } from './quick';
@@ -116,6 +118,7 @@ button.lg-tile { cursor: pointer; }
.lg-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--border); flex-wrap: nowrap; }
.lg-form .input { flex: 1; min-height: 44px; min-width: 0; }
.lg-actions .lg-form { padding: 0; border: 0; }
.lg-chat .bot-activity { padding: 4px 10px 0; }
.lg-why { padding: 8px 10px; border-top: 1px solid var(--border); font-size: .88rem; color: var(--text-sub); font-weight: 600; margin: 0; }
.lg-big { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-big .btn { flex: 1 1 auto; min-height: 52px; }
@@ -434,6 +437,8 @@ function ChatBox({ v, players, me, act }: { v: LiarView; players: Record<string,
].sort((a, b) => a.at - b.at || (a.k === b.k ? 0 : a.k === 'sys' ? -1 : 1));
const canWrite = !!v.my?.canChat;
const typing = useTypingSignal('game', canWrite);
// Who is typing sits right above the input, inside the chat (not on the status row: `typingInChat`).
const room = useRoom((s) => s.room);
const inputRef = useRef<HTMLInputElement>(null);
const why = !me || !v.my ? '관전 중에는 채팅을 쓸 수 없어요.' : (v.my.chatWhy ?? '');
return (
@@ -453,6 +458,7 @@ function ChatBox({ v, players, me, act }: { v: LiarView; players: Record<string,
),
)}
</div>
{room && <BotActivity room={room} only="typing" ch="game" hide={v.phase.kind === 'describe' && v.phase.speaker ? [v.phase.speaker] : undefined} />}
{canWrite ? (
<form
className="lg-form"
@@ -1051,6 +1057,7 @@ const ui: GameUI<LiarView, LiarOptions> = {
quickStart,
helpNow,
ownChat: true,
typingInChat: true,
};
export default ui;

View File

@@ -39,6 +39,8 @@ export interface GameUI<V = any, O = any> {
Rules: ComponentType<{ options?: O }>;
/** The board has its own chat channels; the room chat panel is hidden while the game runs (마피아). */
ownChat?: boolean;
/** The board's chat box shows who is typing in it ("입력 중…"); the status row then shows only the computers thinking (라이어 게임). */
typingInChat?: boolean;
/** 30초 규칙 요약: 3 cards shown the first time this device plays the game (docs/07 §5). */
quickStart?: QuickCard[];
/** [?] "지금 할 수 있는 것": the current situation in plain words for this viewer (docs/07 §5). */