Lobby: sheet theme switch in the tab bar, remove extra toolbar

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-22 11:12:32 +00:00
parent 7e69b68b37
commit 59df681cfa
4 changed files with 42 additions and 23 deletions
+3 -9
View File
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useRef, useState } from 'react'
import PaperSheet from './PaperSheet.jsx'
import PaperSheet, { ThemeSwitch } from './PaperSheet.jsx'
const J = { 'Content-Type': 'application/json' }
const send = (url, method, body) => fetch(url, { method, headers: J, body: body === undefined ? undefined : JSON.stringify(body) })
@@ -323,14 +323,7 @@ function CharTab({ cid, owner, rules, onOpen, name }) {
return (
<div>
{err && <p className="warn">{err}</p>}
{data && (
<PaperSheet data={data} baseRules={rules} tools={
<>
<span className="muted small">{owner ? `Played by ${owner}` : 'Your character'} · read-only, hover or tap a value for details</span>
<button className="ghost" onClick={onOpen}>{owner ? 'Open in Character tab' : 'Edit in Character tab'}</button>
</>
} />
)}
{data && <PaperSheet data={data} baseRules={rules} bare />}
</div>
)
}
@@ -400,6 +393,7 @@ function LobbyView({ id, rules, user, onOpen }) {
<button key={m.username} role="tab" aria-selected={active === `sheet:${m.username}`} className={active === `sheet:${m.username}` ? 'on' : ''}
onClick={() => setTab(`sheet:${m.username}`)} title={m.username}>{m.me && !lobby.is_dm ? 'My character' : m.character.name}</button>
))}
{active.startsWith('sheet:') && <span className="tabright"><ThemeSwitch /></span>}
</div>
{active.startsWith('sheet:') && (() => {