채팅: 가리기 삭제, 100줄이 찬 뒤에도 맨 아래 고정(+새 메시지 수), 이름 줄과 말풍선으로 이름·내용 구분

- 공통 ChatMessage(이름 줄 + 말풍선, 내 말은 오른쪽, 이어 말하면 이름 한 번) — 방 채팅·마피아·라이어 게임, 그림 맞히기 이름 표시
- useStickToBottom: 개수 대신 목록 내용 변화를 보고 맨 아래 유지, 위로 올려 읽는 중엔 그대로, 보내면 다시 맨 아래
- 휴대폰 채팅 버튼의 새 메시지 수도 100줄 뒤에 0이 되던 문제(마지막 본 id 기준으로)
- e2e/chat.e2e.ts: PC 대기실·게임 옆 칸·휴대폰 시트

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-13 03:48:56 +09:00
parent 115969515c
commit 65c56d3ae7
11 changed files with 370 additions and 60 deletions

View File

@@ -10,6 +10,7 @@
--primary-press: #1d4fd0;
--primary-text: #ffffff;
--primary-soft: #dbe7ff;
--chat-name-l: 36%;
--success: #15803d;
--success-soft: #dcfce7;
--warning: #b45309;
@@ -39,6 +40,7 @@
--primary-press: #4a7de0;
--primary-text: #0b1020;
--primary-soft: #1e2a44;
--chat-name-l: 72%;
--success: #4ade80;
--success-soft: #133222;
--warning: #fbbf24;
@@ -64,6 +66,7 @@
--primary-press: #4a7de0;
--primary-text: #0b1020;
--primary-soft: #1e2a44;
--chat-name-l: 72%;
--success: #4ade80;
--success-soft: #133222;
--warning: #fbbf24;
@@ -881,12 +884,54 @@ button.header-user {
.game-side .chat-list {
max-height: none;
}
/* One message: a small coloured name line above a bubble (components/ChatMessage.tsx). Mine sit on the right. */
.chat-line {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 2px;
font-size: 0.95rem;
line-height: 1.4;
max-width: 100%;
}
.chat-line strong {
margin-right: 6px;
.chat-line.cont {
margin-top: -3px;
}
.chat-name:not(.sr-only) {
font-size: 0.8rem;
font-weight: 800;
padding-left: 4px;
color: hsl(var(--name-h, 212) 70% var(--chat-name-l));
}
.chat-text {
background: var(--surface-2);
color: var(--text);
border-radius: 4px 14px 14px 14px;
padding: 5px 11px;
max-width: min(100%, 34em);
overflow-wrap: anywhere;
white-space: pre-wrap;
}
.chat-line.cont .chat-text {
border-top-left-radius: 14px;
}
.chat-line.mine {
align-items: flex-end;
}
.chat-line.mine .chat-text {
background: var(--primary-soft);
border-radius: 14px 4px 14px 14px;
}
.chat-line.mine.cont .chat-text {
border-top-right-radius: 14px;
}
/* Notices (no sender): centred, quiet, no bubble. */
.chat-line.sys {
align-items: center;
align-self: stretch;
text-align: center;
font-size: 0.85rem;
color: var(--text-sub);
}
/* One line of quick reactions; the rest scrolls sideways instead of stacking rows. */
.emote-row {