- {room.lockedOptions.length > 0 &&
🔒 관리자가 고정한 규칙은 바꿔도 저장되지 않아요.
}
-
+ {!readOnly && room.lockedOptions.length > 0 &&
🔒 관리자가 고정한 규칙은 바꿔도 저장되지 않아요.
}
+ {readOnly ? (
+
+ {}} />
+
+ ) : (
+
+ )}
관전
- {seg(room.allowSpectators, (allowSpectators) => socket.send({ t: 'config', allowSpectators }), '허용', '안 됨')}
+ {readOnly ? {seg(room.allowSpectators, () => {}, '허용', '안 됨')} : seg(room.allowSpectators, (allowSpectators) => socket.send({ t: 'config', allowSpectators }), '허용', '안 됨')}
채팅
- {seg(room.chatEnabled, (chatEnabled) => socket.send({ t: 'config', chatEnabled }), '켜기', '끄기')}
+ {readOnly ? {seg(room.chatEnabled, () => {}, '켜기', '끄기')} : seg(room.chatEnabled, (chatEnabled) => socket.send({ t: 'config', chatEnabled }), '켜기', '끄기')}
{!inline && (
@@ -568,6 +578,32 @@ function SettingsForm({ room, ui, inline, onDone }: { room: RoomView; ui: GameUI
);
}
+/**
+ * Locks every control inside (each game's options form has its own buttons, selects and inputs), except
+ * disclosure toggles (`aria-expanded`, e.g. "▼ 자세한 설정") so hidden rules can still be opened and read.
+ * Re-locks whatever the form renders later (opening "자세한 설정" adds new controls).
+ */
+function ReadOnlyControls({ children }: { children: ReactNode }) {
+ const ref = useRef
(null);
+ useLayoutEffect(() => {
+ const root = ref.current!;
+ const lock = () => {
+ root.querySelectorAll('button:not([aria-expanded]), input, select, textarea').forEach((el) => {
+ if (!el.disabled) el.disabled = true;
+ });
+ };
+ lock();
+ const mo = new MutationObserver(lock);
+ mo.observe(root, { childList: true, subtree: true, attributes: true, attributeFilter: ['disabled'] });
+ return () => mo.disconnect();
+ }, []);
+ return (
+
+ {children}
+
+ );
+}
+
// ---------------------------------------------------------------- game
function GameView({ room, ui, me, players, pending, slow }: { room: RoomView; ui: GameUI; me: PublicUser; players: Record; pending: boolean; slow: boolean }) {
diff --git a/apps/web/src/styles/global.css b/apps/web/src/styles/global.css
index 35fd167..ecc02de 100644
--- a/apps/web/src/styles/global.css
+++ b/apps/web/src/styles/global.css
@@ -1370,6 +1370,17 @@ button.header-user {
gap: 6px;
}
+/* 참여자가 보는 게임 설정(보기 전용): 고른 값은 또렷하게, 나머지는 흐리게. 눌러도 안 바뀐다는 게 보이도록. */
+.options-view :disabled {
+ cursor: default;
+ color: inherit;
+ opacity: 0.5;
+}
+.options-view [aria-pressed='true']:disabled,
+.options-view :is(input, select, textarea):disabled {
+ opacity: 1;
+}
+
/* =====================================================================
PC 정리 (2026-10-09, "PC버전을 좀더"): 넓은 화면에서 한 줄 화면을 1,200px로 늘리지 않는다.
===================================================================== */
diff --git a/docs/06-lobby-rooms.md b/docs/06-lobby-rooms.md
index ead141b..0119bab 100644
--- a/docs/06-lobby-rooms.md
+++ b/docs/06-lobby-rooms.md
@@ -39,7 +39,7 @@
- 닉네임(자리, 관전자 목록, 결과 화면)을 누르면 기록 카드가 뜬다: 이 게임의 판·승·패·무·승률, 이 방 전적, 전체 게임 합계. 패 = 판 - 승 - 무(1등이 아니면 패). 컴퓨터는 누를 수 없다. `GET /api/users/:id/stats`(로그인 필요).
- 게스트에게는 [게임 시작]/[준비하기] 아래에 한 줄로 "⚠️ 게스트 기록은 하루 동안 안 들어오면 지워져요."를 보인다(연습 방 제외).
- 규칙 설명은 대기실에 펼쳐 두지 않는다. 방 막대의 [📖 규칙]으로 본다.
-3. **게임 설정 요약**: "오목 · 렌주룰 · 한 수 30초" + 방장에게만 [설정 바꾸기].
+3. **게임 설정**: 요약 "오목 · 렌주룰 · 한 수 30초" + 방장은 [설정 바꾸기], 나머지는 [설정 보기](PC는 카드 안에 바로 펼침). 참여자도 방장과 같은 설정 화면(자세한 설정 포함)을 보지만 모든 버튼이 잠겨 있어 바꿀 수 없다. "👑 설정은 방장만 바꿀 수 있어요" 안내. 방장이 바꾸면 바로 따라 바뀐다(2026-10-11). 서버도 방장 외 `config`를 거절한다.
4. **아래 고정 버튼**(엄지 닿는 곳):
- 방장: [게임 시작] — 최소 인원이 안 되면 비활성 + "1명 더 필요해요" 안내. 모두 준비가 아니어도 시작 가능하되 "준비 안 된 사람이 있어요. 시작할까요?" 확인.
- 나머지: [준비하기] / [준비 취소].
diff --git a/e2e/omok.e2e.ts b/e2e/omok.e2e.ts
index 41a9fe9..b7628a4 100644
--- a/e2e/omok.e2e.ts
+++ b/e2e/omok.e2e.ts
@@ -96,6 +96,21 @@ try {
await a.getByText('자유룰 · 15줄 · 시간 제한 없음').waitFor();
await b.getByText('자유룰 · 15줄 · 시간 제한 없음').waitFor();
await a.screenshot({ path: join(SHOTS, '1-lobby-pc.png') });
+ // B (not host) can open the same settings, read-only: the host's choices show, nothing can be pressed,
+ // and "자세한 설정" still opens so the hidden rules can be read too.
+ await b.getByText('설정은 방장만 바꿀 수 있어요').first().waitFor();
+ if (await b.getByRole('button', { name: '설정 바꾸기' }).count()) throw new Error('non-host sees 설정 바꾸기');
+ await b.getByRole('button', { name: '설정 보기' }).click();
+ const sheet = b.getByRole('dialog', { name: '게임 설정' });
+ const free = sheet.getByRole('button', { name: '자유룰' });
+ if ((await free.getAttribute('aria-pressed')) !== 'true' || !(await free.isDisabled())) throw new Error('read-only 자유룰 not shown as chosen + locked');
+ if (!(await sheet.getByRole('button', { name: '렌주룰' }).isDisabled())) throw new Error('non-host can press 렌주룰');
+ if (!(await sheet.getByRole('button', { name: '허용' }).isDisabled())) throw new Error('non-host can press 관전 허용');
+ await sheet.getByRole('button', { name: '▼ 자세한 설정' }).click();
+ if (!(await sheet.getByRole('button', { name: '19줄' }).isDisabled())) throw new Error('non-host can press 19줄 (자세한 설정)');
+ await b.screenshot({ path: join(SHOTS, '5b-lobby-phone-settings-view.png') });
+ await sheet.getByRole('button', { name: '닫기', exact: true }).click();
+ await b.getByText('자유룰 · 15줄 · 시간 제한 없음').waitFor();
await a.getByRole('button', { name: '▶ 게임 시작' }).click();
await a.getByRole('button', { name: '시작하기' }).click();
await a.getByText('내 차례예요').waitFor();