From ebf82fd105e2d22905b7c14e6b87d6f330322c41 Mon Sep 17 00:00:00 2001 From: EJClaw Date: Sun, 11 Oct 2026 01:29:43 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=9C=20=ED=8C=90=20=EB=8D=94:=20=ED=88=AC?= =?UTF-8?q?=ED=91=9C=20=EB=8C=80=EC=8B=A0=20=EA=B7=B8=20=EB=B0=A9=20?= =?UTF-8?q?=EB=8C=80=EA=B8=B0=EC=8B=A4=EB=A1=9C=20=EB=8F=8C=EC=95=84?= =?UTF-8?q?=EA=B0=80=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - κ²°κ³Ό μ°½ [πŸ” ν•œ 판 더] β†’ λˆ„λ₯Έ μ‚¬λžŒλ§Œ λŒ€κΈ°μ‹€ ν™”λ©΄μœΌλ‘œ(νƒ­λ§ˆλ‹€ sessionStorage둜 κΈ°μ–΅, μƒˆλ‘œκ³ μΉ¨ν•΄λ„ μœ μ§€) - 앉은 μ‚¬λžŒ(λ°©μž₯ μ œμ™Έ)은 λŒμ•„μ˜€λ©΄μ„œ μ€€λΉ„ μ™„λ£Œ, λ°©μž₯이 [κ²Œμž„ μ‹œμž‘] - ν•œ λͺ…이 μ•ˆ λˆ„λ₯΄λ©΄ κ²°κ³Ό μ°½μ—μ„œ 계속 κΈ°λ‹€λ¦¬λ˜ 문제 ν•΄κ²° - e2e(omokΒ·tutorial) 흐름, docs/03Β·06Β·07 κ°±μ‹  Co-Authored-By: Claude Opus 5.5 --- apps/web/src/pages/RoomPage.tsx | 29 ++++++++++++++++++----------- docs/03-realtime-protocol.md | 2 +- docs/06-lobby-rooms.md | 2 +- docs/07-ui-ux.md | 4 ++-- e2e/omok.e2e.ts | 8 ++++++-- e2e/tutorial.e2e.ts | 4 +++- 6 files changed, 31 insertions(+), 18 deletions(-) diff --git a/apps/web/src/pages/RoomPage.tsx b/apps/web/src/pages/RoomPage.tsx index f4aa55c..d639281 100644 --- a/apps/web/src/pages/RoomPage.tsx +++ b/apps/web/src/pages/RoomPage.tsx @@ -91,6 +91,9 @@ function Room({ code, me }: { code: string; me: PublicUser }) { const [ui, setUi] = useState(null); const [leaveAsk, setLeaveAsk] = useState(false); const [chatOpen, setChatOpen] = useState(false); + // [ν•œ 판 더] takes me back to this room's lobby after game N (kept per tab so a reload stays there). + const lobbyKey = `bg:lobby:${code}`; + const [lobbyAfter, setLobbyAfter] = useState(() => Number(sessionStorage.getItem(lobbyKey)) || null); const gameId = room?.gameId; useEffect(() => { @@ -144,7 +147,15 @@ function Room({ code, me }: { code: string; me: PublicUser }) { } const g = { nameKo: gameName(room.gameId) }; - const inGame = room.status === 'playing' || room.status === 'paused' || (room.status === 'finished' && !!game); + const backInLobby = room.status === 'finished' && lobbyAfter === room.gameNo; + const inGame = room.status === 'playing' || room.status === 'paused' || (room.status === 'finished' && !!game && !backInLobby); + const toLobby = () => { + sessionStorage.setItem(lobbyKey, String(room.gameNo)); + setLobbyAfter(room.gameNo); + // Seated people come back ready, so the host sees who wants another game. + const seat = room.seats.find((s) => s?.user.id === me.id); + if (seat && room.hostId !== me.id && !seat.ready) socket.send({ t: 'ready', ready: true }); + }; // Games with their own chat channels (λ§ˆν”Όμ•„) close the room chat while playing (the server refuses it too). const roomChatClosed = !!ui.ownChat && (room.status === 'playing' || room.status === 'paused'); const doLeave = () => { @@ -225,7 +236,7 @@ function Room({ code, me }: { code: string; me: PublicUser }) { ) : ( )} - {room.status === 'finished' && result && game && } + {room.status === 'finished' && result && game && !backInLobby && } {chatOpen && !roomChatClosed && ( setChatOpen(false)} label="μ±„νŒ…"> @@ -628,15 +639,12 @@ function GameView({ room, ui, me, players, pending, slow }: { room: RoomView; ui ); } -function ResultPanel({ room, me, players, onLeave }: { room: RoomView; me: PublicUser; players: Record; onLeave: () => void }) { +function ResultPanel({ room, me, players, onLeave, onAgain }: { room: RoomView; me: PublicUser; players: Record; onLeave: () => void; onAgain: () => void }) { const result = useRoom((s) => s.result)!; const [hidden, setHidden] = useState(false); const played = useRef(false); const seatedAll = room.seats.filter(Boolean).map((s) => s!.user.id); - const amSeated = seatedAll.includes(me.id); - // Computer players always agree to a rematch. const seated = seatedAll.filter((u) => !isBotId(u)); - const voted = room.rematchVotes.includes(me.id); // Solo games (e.g. μš”νŠΈ λ‹€μ΄μŠ€) have one ranked player: neither a draw nor a win. const solo = result.ranking.flat().length === 1; const allFirst = !solo && result.ranking.length === 1; @@ -678,11 +686,10 @@ function ResultPanel({ room, me, players, onLeave }: { room: RoomView; me: Publi )), )} - {amSeated && ( - - )} + {/* Back to this room's lobby: seats, computers and settings can change before the host starts again. */} + {/* One primary action (ν•œ 판 더); the rest share one quieter row. */}