Move scoreboard visibility controls to a full-width bar
The toggle lived in the right-hand column, which drops below the scoring grid on windows narrower than 1280px, so it was off screen. It now sits directly under the title at every width. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -114,6 +114,12 @@ export function ControlRoom({ view }: { view: LiveView }) {
|
||||
</dl>
|
||||
)}
|
||||
|
||||
{/* Full width and first, so the visibility toggle is on screen at every window size. */}
|
||||
<section className={panel}>
|
||||
<h2 className="mb-2 text-lg font-bold">Scoreboard — what the room sees</h2>
|
||||
<ScoreboardPanel view={view} />
|
||||
</section>
|
||||
|
||||
<div className="grid items-start gap-4 lg:grid-cols-[15rem_minmax(0,1fr)] xl:grid-cols-[15rem_minmax(0,1fr)_20rem]">
|
||||
<nav aria-label="Games" className={panel}>
|
||||
<h2 className="text-lg font-bold">Games</h2>
|
||||
@@ -199,11 +205,6 @@ export function ControlRoom({ view }: { view: LiveView }) {
|
||||
</section>
|
||||
|
||||
<div className="flex flex-col gap-4 lg:col-span-2 xl:col-span-1">
|
||||
<section className={panel}>
|
||||
<h2 className="mb-2 text-lg font-bold">Scoreboard</h2>
|
||||
<ScoreboardPanel view={view} />
|
||||
</section>
|
||||
|
||||
<section className={panel}>
|
||||
<h2 className="text-lg font-bold">Standings</h2>
|
||||
<p className="text-sm text-ink/70">Always live here, whatever the room sees.</p>
|
||||
|
||||
@@ -32,25 +32,27 @@ export function ScoreboardPanel({ view }: { view: LiveView }) {
|
||||
const nextTeam = reveal.next ? teams.find((team) => team.id === reveal.next?.teamId) : undefined;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex flex-wrap items-center gap-x-4 gap-y-3">
|
||||
{reveal.active ? (
|
||||
<div className="flex flex-col gap-2 rounded-md border-2 border-floodlight bg-floodlight/15 p-3">
|
||||
<p className="font-bold">
|
||||
Reveal mode · {reveal.revealedCount} of {teams.length} revealed
|
||||
</p>
|
||||
{reveal.next ? (
|
||||
<>
|
||||
{/* Only the host sees who is next, so they can build it up out loud. */}
|
||||
<p>
|
||||
<div className="flex flex-wrap items-center gap-2 rounded-md border-2 border-floodlight bg-floodlight/15 p-3">
|
||||
<p className="mr-2">
|
||||
<strong>
|
||||
Reveal mode · {reveal.revealedCount} of {teams.length} revealed.
|
||||
</strong>{" "}
|
||||
{reveal.next ? (
|
||||
// Only the host sees who is next, so they can build it up out loud.
|
||||
<>
|
||||
Next: <strong>{ordinal(reveal.next.rank)} place</strong> — {nextTeam?.name} (
|
||||
{formatScore(reveal.next.total)})
|
||||
</p>
|
||||
<Button disabled={pending} onClick={() => run(() => revealNext(event.id))}>
|
||||
Reveal next
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
<p>Every team is revealed.</p>
|
||||
</>
|
||||
) : (
|
||||
"Every team is revealed."
|
||||
)}
|
||||
</p>
|
||||
{reveal.next && (
|
||||
<Button disabled={pending} onClick={() => run(() => revealNext(event.id))}>
|
||||
Reveal next
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
variant={reveal.next ? "secondary" : "primary"}
|
||||
@@ -65,7 +67,11 @@ export function ScoreboardPanel({ view }: { view: LiveView }) {
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div role="group" aria-label="What the room sees" className="grid grid-cols-3 gap-1">
|
||||
<div
|
||||
role="group"
|
||||
aria-label="What the room sees"
|
||||
className="grid w-full max-w-md grid-cols-3 gap-1"
|
||||
>
|
||||
{VISIBILITY_ORDER.map((visibility) => {
|
||||
const selected = event.visibility === visibility;
|
||||
return (
|
||||
@@ -88,7 +94,7 @@ export function ScoreboardPanel({ view }: { view: LiveView }) {
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<p>{options[event.visibility].explain}</p>
|
||||
<p className="min-w-48 flex-1">{options[event.visibility].explain}</p>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -111,7 +117,11 @@ export function ScoreboardPanel({ view }: { view: LiveView }) {
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<ErrorText>{error}</ErrorText>
|
||||
{error && (
|
||||
<div className="basis-full">
|
||||
<ErrorText>{error}</ErrorText>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user