Skip to content

Commit a4a610d

Browse files
johnebgoodclaude
andcommitted
Move action buttons back to right side of chat bubble
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 90451af commit a4a610d

1 file changed

Lines changed: 26 additions & 34 deletions

File tree

react-app/src/components/chat/ChatBubble.tsx

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -32,66 +32,58 @@ export function ChatBubble({ msg, isCurrentlySpeaking, onTtsBan, onBan, onDontSp
3232
return (
3333
<div
3434
id={`msg-${msg.id}`}
35-
className="chat-bubble mb-2"
35+
className="chat-bubble mb-2 p-2"
3636
style={{
3737
borderLeft: `3px solid ${color}`,
3838
backgroundColor: isCurrentlySpeaking ? '#1a3a1a' : undefined,
3939
opacity: msg.allowTTS ? 1 : 0.7,
4040
}}
4141
>
42-
{/* username-container */}
43-
<div className="d-flex justify-content-between align-items-start px-2 pt-2">
44-
<div>
45-
<span id={`msg-user-${msg.id}`} className="fw-bold" style={{ color }}>
46-
{msg.displayName ?? msg.username}
47-
</span>
48-
{msg.spokenName && msg.spokenName !== (msg.displayName ?? msg.username) && (
49-
<span className="text-muted small ms-1">({msg.spokenName})</span>
42+
<div className="d-flex justify-content-between align-items-start">
43+
{/* Left: username + message */}
44+
<div className="flex-grow-1 me-2">
45+
<div className="mb-1">
46+
<span id={`msg-user-${msg.id}`} className="fw-bold" style={{ color }}>
47+
{msg.displayName ?? msg.username}
48+
</span>
49+
{msg.spokenName && msg.spokenName !== (msg.displayName ?? msg.username) && (
50+
<span className="text-muted small ms-1">({msg.spokenName})</span>
51+
)}
52+
{msg.platform && msg.platform !== 'Twitch' && (
53+
<span className="badge bg-secondary ms-1 small">{msg.platform}</span>
54+
)}
55+
{msg.voiceName && (
56+
<span className="text-muted ms-2" style={{ fontSize: '0.72rem' }}>{speakerIcon} {msg.voiceName}</span>
57+
)}
58+
</div>
59+
<span id={`msg-text-${msg.id}`} dangerouslySetInnerHTML={{ __html: msg.message }} />
60+
{msg.translatedMessage && (
61+
<div className="text-muted small mt-1" dangerouslySetInnerHTML={{ __html: msg.translatedMessage }} />
5062
)}
51-
{msg.platform && msg.platform !== 'Twitch' && (
52-
<span className="badge bg-secondary ms-1 small">{msg.platform}</span>
53-
)}
54-
</div>
55-
<div className="text-muted small text-end ms-2 flex-shrink-0" style={{ maxWidth: '40%' }}>
56-
{msg.voiceName}
5763
</div>
58-
</div>
59-
60-
{/* message-container */}
61-
<div className="px-2 pb-1">
62-
<span className="me-1">{speakerIcon}</span>
63-
<span id={`msg-text-${msg.id}`} dangerouslySetInnerHTML={{ __html: msg.message }} />
64-
{msg.translatedMessage && (
65-
<div className="text-muted small mt-1" dangerouslySetInnerHTML={{ __html: msg.translatedMessage }} />
66-
)}
67-
</div>
6864

69-
{/* buttons-container */}
70-
<div className="d-flex justify-content-center pb-1">
71-
<div className="btn-group btn-group-sm">
65+
{/* Right: action buttons */}
66+
<div className="btn-group btn-group-sm flex-shrink-0">
7267
<button
73-
className="btn btn-outline-warning btn-xs py-0 px-2"
68+
className="btn btn-outline-warning btn-xs py-0 px-1"
7469
title="TTS Ban"
7570
onClick={() => onTtsBan(msg.username ?? '')}
7671
>
7772
<i className="fa fa-volume-xmark" />
78-
<div><span className="small">TTS Ban</span></div>
7973
</button>
8074
<button
81-
className="btn btn-outline-danger btn-xs py-0 px-2"
75+
className="btn btn-outline-danger btn-xs py-0 px-1"
8276
title="Ban"
8377
onClick={() => onBan(msg.username ?? '')}
8478
>
8579
<i className="fa fa-gavel" />
86-
<div><span className="small">Ban</span></div>
8780
</button>
8881
<button
89-
className="btn btn-outline-secondary btn-xs py-0 px-2"
82+
className="btn btn-outline-secondary btn-xs py-0 px-1"
9083
title="Don't Speak"
9184
onClick={() => onDontSpeak(msg.id)}
9285
>
9386
<i className="fa fa-comment-slash" />
94-
<div><span className="small">Skip</span></div>
9587
</button>
9688
</div>
9789
</div>

0 commit comments

Comments
 (0)