채팅 소리(스타크래프트 같은 "띠릭"): 새 채팅 줄마다(내가 보낸 줄도) 맑은 두 음이 올라가는 짧은 소리. 크기는 게임 소리 기준(0.15)의 90%로 소리 크기 설정을 그대로 따르고, 소리 끄기면 안 남. 몰려 온 줄은 한 번만. 방에 (다시) 들어올 때 서버가 다시 보내는 지난 채팅은 replay 표시로 조용히. 마피아·라이어 게임 안 채팅도 같은 소리. feedback.test.ts, room.test.ts, chat.e2e.ts에 확인 추가

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-14 09:42:31 +09:00
parent e0139f412e
commit b7d5b3ad75
10 changed files with 212 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ import { TOPIC_IDS, TOPIC_KO } from '@bg/games/liar/topics';
import type { PublicUser } from '@bg/shared/lite';
import { Avatar } from '../../components/ui';
import { useServerNow } from '../../components/TurnTimer';
import { haptic, sfx, sounds, tone } from '../../lib/feedback';
import { haptic, sfx, sounds, tone, useChatSound } from '../../lib/feedback';
import { cssEsc, useBanner, type BannerTone } from '../card-fx';
import { ChatMessage, nameHue, sameRun } from '../../components/ChatMessage';
import { useStickToBottom } from '../../lib/useStickToBottom';
@@ -779,6 +779,8 @@ function useLiarFx(v: LiarView, me: string | null, players: Record<string, Publi
}
function LiarBoard({ view: v, me, players, act, pending }: BoardProps<LiarView>) {
// The room chat is closed while playing, so the 토론 chat lines play the chat sound.
useChatSound(v.chat.at(-1)?.n);
const ph = v.phase;
const my = v.my;
const [announce, setAnnounce] = useState('');

View File

@@ -11,7 +11,7 @@ import type { Channel, ChatView, MafiaOptions, MafiaView, PlayerView, PrivateRes
import type { PublicUser } from '@bg/shared/lite';
import { Avatar } from '../../components/ui';
import { useServerNow } from '../../components/TurnTimer';
import { haptic, noise, sfx, sounds, tone } from '../../lib/feedback';
import { haptic, noise, sfx, sounds, tone, useChatSound } from '../../lib/feedback';
import { useBanner, type BannerTone } from '../card-fx';
import { ChatMessage, sameRun } from '../../components/ChatMessage';
import { useStickToBottom } from '../../lib/useStickToBottom';
@@ -854,6 +854,8 @@ function useMafiaFx(v: MafiaView, players: Record<string, PublicUser>, showBanne
}
function MafiaBoard({ view: v, me, players, act, pending }: BoardProps<MafiaView>) {
// The room chat is closed while playing, so this game's own chat lines play the chat sound.
useChatSound(v.chat.at(-1)?.key);
const ph = v.phase;
const my = v.my;
const [announce, setAnnounce] = useState('');