채팅 소리 기본 크기를 게임 소리의 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

@@ -4,6 +4,7 @@ import type { CatalogEntry, PublicUser } from '@bg/shared/lite';
import { api, type Settings } from '../net/api';
import { socket } from '../net/socket';
import { setGameSpeed } from '../lib/motion';
import { setChatSound } from '../lib/feedback';
const LS_KEY = 'bg.settings';
@@ -76,7 +77,7 @@ export const useSession = create<SessionState>((set, get) => ({
hasDiscordAvatar: false,
async refresh() {
const [cfg, me] = await Promise.all([
api.config().catch(() => ({ discord: false, catalog: [] as CatalogEntry[], siteName: '같이 놀자 보드게임', announcement: '', maintenance: false, gameSpeed: 1 })),
api.config().catch(() => ({ discord: false, catalog: [] as CatalogEntry[], siteName: '같이 놀자 보드게임', announcement: '', maintenance: false, gameSpeed: 1, chatSound: undefined })),
api.me().catch(() => ({ me: null }) as Awaited<ReturnType<typeof api.me>>),
]);
const settings = { ...get().settings, ...withoutDeviceOnly(me.settings ?? {}) };
@@ -84,6 +85,7 @@ export const useSession = create<SessionState>((set, get) => ({
localStorage.setItem(LS_KEY, JSON.stringify(settings));
document.title = cfg.siteName;
setGameSpeed(cfg.gameSpeed);
setChatSound(cfg.chatSound);
set({
loaded: true,
me: me.me,