PC 창을 줄였을 때(720~1099px)도 채팅: 옆 채팅 칸이 없는 폭이면 방 막대에 💬 채팅 버튼(전에는 휴대폰 폭에서만 보여 이 구간엔 채팅이 아예 없었음). 넓은 폭에선 버튼과 시트를 숨김. chat.e2e.ts에 900/760px 확인 추가

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-14 09:32:16 +09:00
parent 92aebb6a19
commit e0139f412e
2 changed files with 24 additions and 7 deletions

View File

@@ -95,6 +95,8 @@ function Room({ code, me }: { code: string; me: PublicUser }) {
const [ui, setUi] = useState<GameUI | null>(null);
const [leaveAsk, setLeaveAsk] = useState(false);
const [chatOpen, setChatOpen] = useState(false);
// Under 1100px there is no chat column (Lobby/GameView), so the bar carries a 💬 button — phones and narrowed PC windows alike.
const wide = useWide();
// 설정 opens as a popup over the room: going to /me would unmount the room and detach from it.
const [settingsOpen, setSettingsOpen] = useState(false);
const closeSettings = useCallback(() => setSettingsOpen(false), []);
@@ -213,11 +215,7 @@ function Room({ code, me }: { code: string; me: PublicUser }) {
className="btn btn-ghost btn-sm rb-btn"
/>
<span style={{ flex: 1 }} />
{!roomChatClosed && (
<span className="phone-only">
<ChatButton onOpen={() => setChatOpen(true)} />
</span>
)}
{!roomChatClosed && !wide && <ChatButton onOpen={() => setChatOpen(true)} />}
<VolumeControl className="btn btn-ghost btn-sm rb-btn" label />
<button className="btn btn-ghost btn-sm rb-btn" onClick={() => setRulesOpen(true)} aria-haspopup="dialog" aria-label="규칙 보기">
<span className="rb-ico">📖</span>
@@ -240,7 +238,7 @@ function Room({ code, me }: { code: string; me: PublicUser }) {
)}
{room.status === 'finished' && result && game && !backInLobby && <ResultPanel room={room} me={me} players={players} onLeave={doLeave} onAgain={toLobby} />}
<EmoteBubbles room={room} />
{chatOpen && !roomChatClosed && (
{chatOpen && !roomChatClosed && !wide && (
<Sheet onClose={() => setChatOpen(false)} label="채팅">
<ChatPanel room={room} me={me} />
<button className="btn btn-secondary btn-block" onClick={() => setChatOpen(false)}>