Lobby: chat at the right window edge, DM rolls hidden from players

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJhXuLD2Z6hv3Wqeq9UL9K
This commit is contained in:
Claude
2026-10-21 17:00:02 +00:00
parent a88b8d2fa3
commit 69e53c1520
4 changed files with 25 additions and 16 deletions
+5 -5
View File
@@ -186,7 +186,7 @@ function Chat({ me, people, msgs, poll, id, to, setTo }) {
const who = (m) => (
<>
<strong>{m.mine ? 'You' : m.from || '?'}</strong>
{m.to && <em className="small whispertag"> {m.mine ? `to ${m.to}` : 'to you'} (private)</em>}
{m.to && <em className="small whispertag"> {m.to === m.from ? '(only visible to you, the DM)' : m.mine ? `to ${m.to} (private)` : 'to you (private)'}</em>}
</>
)
@@ -241,7 +241,7 @@ function DieIcon({ sides }) {
)
}
function DiceBar({ id, to, poll }) {
function DiceBar({ id, to, poll, isDm }) {
const [count, setCount] = useState(1)
const [busy, setBusy] = useState(false)
const [err, setErr] = useState('')
@@ -265,7 +265,7 @@ function DiceBar({ id, to, poll }) {
<DieIcon sides={d} /><span>d{d}</span>
</button>
))}
<span className={`small dicedest ${to ? 'priv' : 'muted'}`}>{to ? `Private: ${to}` : 'Public'}</span>
<span className={`small dicedest ${to || isDm ? 'priv' : 'muted'}`}>{to ? `Private: ${to}` : isDm ? 'Hidden (only you)' : 'Public'}</span>
{err && <span className="warn small">{err}</span>}
</div>
)
@@ -297,7 +297,7 @@ function DiceTray({ rolls, me }) {
const t = rollText(m)
return (
<div key={m.key} className="trayroll">
<div className="small">{m.mine ? 'You' : m.from} rolled <strong>{t.dice}</strong>{m.to ? ` · private${m.mine ? ` to ${m.to}` : ''}` : ''}</div>
<div className="small">{m.mine ? 'You' : m.from} rolled <strong>{t.dice}</strong>{m.to ? (m.to === m.from ? ' · only you' : ` · private${m.mine ? ` to ${m.to}` : ''}`) : ''}</div>
<div className="trayrow">
{m.roll.results.map((v, i) => <Die key={i} sides={m.roll.sides} value={v} delay={i * 120} />)}
{t.n > 1 && <span className="traytotal">= {t.sum}</span>}
@@ -461,7 +461,7 @@ function LobbyView({ id, rules, user, onOpen }) {
</div>
<DiceTray rolls={tray} me={user} />
<DiceBar id={id} to={dest} poll={feed.poll} />
<DiceBar id={id} to={dest} poll={feed.poll} isDm={lobby.is_dm} />
</section>
)
}