채팅 소리 기본 크기를 게임 소리의 80%로 올리고(60%는 너무 안 들린다는 의견), 관리자 사이트 설정에 "채팅 소리 크기"(게임 소리의 0~200%, 정수, 기본 80%)를 추가. 0%면 채팅 소리 없음. 각자의 소리 크기(0~100)는 그대로 곱해짐. 저장하면 /api/config와 방 정보(RoomView.chatSound)로 열린 방에도 바로 적용. 설정 화면에 저장 없이 그 값으로 울려 보는 "들어 보기" 버튼. feedback.test.ts·admin.test.ts·admin.e2e.ts에 확인 추가, docs/14-admin.md 표에 항목 추가

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-15 00:45:33 +09:00
parent 42e8d7650b
commit b61be627c9
14 changed files with 153 additions and 17 deletions

View File

@@ -67,7 +67,7 @@ export interface RoomPreview {
export const api = {
config: () =>
call<{ discord: boolean; catalog: (CatalogEntry & { notice?: string })[]; siteName: string; announcement: string; maintenance: boolean; gameSpeed?: number }>('GET', '/api/config'),
call<{ discord: boolean; catalog: (CatalogEntry & { notice?: string })[]; siteName: string; announcement: string; maintenance: boolean; gameSpeed?: number; chatSound?: number }>('GET', '/api/config'),
me: () => call<MeResponse>('GET', '/api/me'),
guest: (nickname: string) => call<{ me: PublicUser }>('POST', '/api/auth/guest', { nickname }),
updateMe: (patch: { nickname?: string; useAvatar?: boolean; settings?: Settings }) => call<{ me: PublicUser }>('PATCH', '/api/me', patch),

View File

@@ -7,6 +7,7 @@ import { PROTOCOL, type GameResultView, type PublicUser, type RoomView, type Ser
import { toast } from '../store/toast';
import { markOutdated, noteServerBuild } from '../lib/update';
import { setGameSpeed } from '../lib/motion';
import { setChatSound } from '../lib/feedback';
export type ConnStatus = 'idle' | 'connecting' | 'open' | 'reconnecting' | 'replaced' | 'offline';
@@ -285,6 +286,7 @@ class GameSocket {
case 'room':
if (m.seq >= st.roomSeq || m.room.code !== st.room?.code) {
if (m.room.gameSpeed !== undefined) setGameSpeed(m.room.gameSpeed);
if (m.room.chatSound !== undefined) setChatSound(m.room.chatSound);
useRoom.setState({ room: m.room, roomSeq: m.seq, joinError: null });
if (m.room.status === 'playing' && st.result) useRoom.setState({ result: null });
}