화면 정리: 한눈에 들어오게 (홈 게임 타일·종류 탭, 방 안 상단 막대 한 줄, 대기실·결과·설정 간소화)

"한 화면에 정보가 너무 많아 한눈에 들어오지 않는다" 피드백. NN/g 점진적 공개, 토스 "한 화면 한 가지",
BGA 화면 지침, Hick의 법칙을 참고해 docs/07 §1에 원칙 8번으로 정리하고 화면에 적용했다.

- 홈·게임 목록: 게임 카드를 아이콘·이름·"2명 · 5~15분" 타일로 줄이고(설명·난이도는 게임 소개에만),
  휴대폰 3열. [전체][판·주사위][카드·패][여럿이 파티] 탭. 휴대폰 홈 세로 길이 약 1/4.
  휴대폰에서 [방 만들기]는 한 줄, [코드로 참여]·[컴퓨터와 연습]은 나란히.
- 방 안: 사이트 상단 메뉴를 숨기고 방 막대 한 줄만(--site-h 변수, 방 안에서는 0).
- 대기실: 초대 카드는 빈자리가 있을 때만, 버튼은 [링크 복사][공유하기/초대글 복사] 두 개
  (QR은 빈자리 칸 "+ 빈자리 · 📷 QR로 초대"). PC 대기실의 규칙 전문 카드와 "바꾸면 바로 적용돼요" 제거.
  게스트 경고는 시작 버튼 아래 한 줄로.
- 채팅 빠른 반응은 한 줄(넘치면 옆으로).
- 결과 창: 진한 버튼은 [한 판 더] 하나, [판 보기][▶ 다시 보기]는 한 줄.
- 설정(/me): 항목 이름과 선택지를 한 줄에.
- E2E: 다시 보기 링크 이름, 컴퓨터 상대의 "게임 중 홈으로"는 앱 안 이동으로.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-09 00:16:10 +09:00
parent 19c163f4d2
commit b81b4f60be
15 changed files with 225 additions and 70 deletions

View File

@@ -12,7 +12,7 @@ import { toast } from '../store/toast';
function Seg<T extends string>({ value, options, onChange, label }: { value: T; options: [T, string][]; onChange: (v: T) => void; label: string }) {
return (
<div className="stack" style={{ gap: 6 }}>
<div className="setting-row">
<strong>{label}</strong>
<div className="segmented" role="group" aria-label={label}>
{options.map(([k, l]) => (
@@ -62,7 +62,7 @@ export default function MePage() {
<Seg
label="돌·카드 놓기"
value={settings.tapConfirm ? 'on' : 'off'}
options={[['on', '두 번 눌러 확정(실수 방지)'], ['off', '한 번에 놓기']]}
options={[['on', '두 번 눌러 놓기'], ['off', '한 번에 놓기']]}
onChange={(v) => updateSettings({ tapConfirm: v === 'on' })}
/>
</section>

View File

@@ -105,6 +105,11 @@ function Room({ code, me }: { code: string; me: PublicUser }) {
}, [room]);
useTurnTitle(ui, game?.view, me.id);
// Inside a room the room bar replaces the site header, so the board gets that height back.
useEffect(() => {
document.documentElement.classList.add('in-room');
return () => document.documentElement.classList.remove('in-room');
}, []);
if (status === 'replaced') {
return (
@@ -291,19 +296,17 @@ function Lobby({ room, ui, me }: { room: RoomView; ui: GameUI; me: PublicUser })
const firstEmpty = room.seats.findIndex((s) => s === null);
const wide = useWide();
const invite = (
// Only while a seat is empty: once everyone is in, the room bar's link button is enough.
const invite = firstEmpty >= 0 && (
<section className="card stack" style={{ textAlign: 'center' }} aria-label="초대하기">
<p className="muted">친구에게 이 코드를 알려 주세요</p>
<p style={{ fontSize: '3.2rem', fontWeight: 800, lineHeight: 1.1 }}>
<CodeLabel code={room.code} />
</p>
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(140px, 1fr))', gap: 8 }}>
<CopyButton text={room.code} label="🔢 코드 복사" />
{/* QR lives on the empty seat button ("+ 빈자리 · QR로 초대"), so this row stays two buttons. */}
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }}>
<CopyButton text={url} label="🔗 링크 복사" />
<ShareButton title={`${gName} 같이 해요`} text={shareText} url={url} />
<button className="btn btn-secondary" onClick={() => setQr(true)}>
📷 QR 보기
</button>
</div>
</section>
);
@@ -349,7 +352,7 @@ function Lobby({ room, ui, me }: { room: RoomView; ui: GameUI; me: PublicUser })
) : (
<div key={i} className="row" style={{ gap: 8, flexWrap: 'nowrap' }}>
<button className="card row" style={{ flex: 1, border: '2px dashed var(--border)', boxShadow: 'none', cursor: 'pointer', minHeight: 76, justifyContent: 'center', color: 'var(--text-sub)' }} onClick={() => (mySeat < 0 ? socket.send({ t: 'seat', seat: i }) : setQr(true))}>
{mySeat < 0 ? '+ 여기 앉기' : '+ 빈자리 · 친구 초대하기'}
{mySeat < 0 ? '+ 여기 앉기' : '+ 빈자리 · 📷 QR로 초대'}
</button>
{canAddBot && i === firstEmpty && (
<button className="btn btn-secondary" style={{ minHeight: 76 }} onClick={() => socket.send({ t: 'addBot', seat: i })}>
@@ -392,7 +395,6 @@ function Lobby({ room, ui, me }: { room: RoomView; ui: GameUI; me: PublicUser })
)}
</div>
{practice && <p className="small">🤖 연습 게임이에요. 기록에는 남지 않아요.</p>}
{me.kind === 'guest' && !practice && <GuestWarning />}
{room.lockedOptions.length > 0 && <p className="muted small">🔒 일부 규칙은 관리자가 정해 두어서 바꿀 수 없어요.</p>}
<GameNotice gameId={room.gameId} />
{isHost && wide && <SettingsForm room={room} ui={ui} inline />}
@@ -430,17 +432,12 @@ function Lobby({ room, ui, me }: { room: RoomView; ui: GameUI; me: PublicUser })
<div className="stack" style={{ gap: 20 }}>
{invite}
{wide ? settingsCard : seats}
{wide && (
<section className="card stack">
<h2>규칙 요약</h2>
<ui.Rules options={room.options} />
</section>
)}
{!wide && settingsCard}
</div>
<div className="stack" style={{ gap: 16, position: wide ? 'sticky' : undefined, top: 140 }}>
<div className="stack" style={{ gap: 16, position: wide ? 'sticky' : undefined, top: 76 }}>
{wide && seats}
{action}
{me.kind === 'guest' && !practice && <GuestWarning short />}
{wide && <ChatPanel room={room} me={me} />}
</div>
</div>
@@ -527,7 +524,6 @@ function SettingsForm({ room, ui, inline, onDone }: { room: RoomView; ui: GameUI
return (
<div className="stack" style={{ gap: 14 }}>
{room.lockedOptions.length > 0 && <p className="muted small">🔒 관리자가 고정한 규칙은 바꿔도 저장되지 않아요.</p>}
<p className="muted small">바꾸면 바로 적용돼요.</p>
<ui.Options value={options} onChange={changeOptions} />
<hr style={{ border: 0, borderTop: '1px solid var(--border)', width: '100%' }} />
<div style={{ display: 'grid', gridTemplateColumns: inline ? 'repeat(2, minmax(0, 1fr))' : '1fr', gap: 12 }}>
@@ -675,14 +671,17 @@ function ResultPanel({ room, me, players, onLeave }: { room: RoomView; me: Publi
{voted ? `다른 사람을 기다리는 중… (${room.rematchVotes.length}/${seated.length})` : `🔁 한 판 더 (${room.rematchVotes.length}/${seated.length})`}
</button>
)}
<button className="btn btn-secondary btn-block" onClick={() => setHidden(true)}>
판 다시 보기
</button>
{room.lastGamePk && result.ranking.some((g) => g.includes(me.id)) && (
<Link className="btn btn-secondary btn-block" to={`/replay/${room.lastGamePk}`}>
▶ 처음부터 다시 보기
</Link>
)}
{/* One primary action (한 판 더); the rest share one quieter row. */}
<div className="row" style={{ gap: 8, flexWrap: 'nowrap' }}>
<button className="btn btn-secondary" style={{ flex: 1 }} onClick={() => setHidden(true)}>
판 보기
</button>
{room.lastGamePk && result.ranking.some((g) => g.includes(me.id)) && (
<Link className="btn btn-secondary" style={{ flex: 1 }} to={`/replay/${room.lastGamePk}`}>
▶ 다시 보기
</Link>
)}
</div>
<button className="btn btn-ghost btn-block" onClick={onLeave}>
방 나가기
</button>