Schedule: entry types, picked times, striped rows, blocks in the presentation

Entries get a type (normal, block, break, heading) and a Featured tick.
Times are picked (start, optional end) and shown as 7:00pm or 9:00 to
10:30am; the typed time stays as the override, so existing entries look
the same. A block holds sub-items (content_block_subitems, migration 086),
each with every entry field. Rows alternate a faint tint. The presentation
gets a Blocks slide (its own seconds) before each sub-item's spotlight,
and sub-items get their own checkboxes on the setup page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-11-02 23:15:53 -06:00
parent 274ffc26e0
commit 7885d10249
9 changed files with 603 additions and 120 deletions

View file

@ -13,8 +13,13 @@
The slides, for each day picked, in order:
overview the day's picked entries on one slide
spotlight one entry: its person beside title, time and place
block a block entry (086) and its sub-items on one slide,
in place of its spotlight; then each sub-item gets
the spotlight, graphic and map slides an entry does
graphic an entry's graphic, full screen
map an entry's own map image (069), full screen
A heading (086) is only a line on the overview; a break gets no
spotlight.
Keys while playing: arrows step, Space pauses, Escape leaves full
screen (the browser's), S goes back to the setup.
@ -25,11 +30,11 @@ import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
import { useParams, useSearchParams } from 'react-router-dom'
import PageState from '../components/PageState.tsx'
import { Avatar, groupByDay, mapAlt, type Day } from '../components/ScheduleBlock.tsx'
import { Avatar, FeaturedStar, featuredStyle, groupByDay, mapAlt, type Day } from '../components/ScheduleBlock.tsx'
import { Paragraphs } from '../components/InlineText.tsx'
import { useEvent, type ContentBlockItem } from '../lib/useContent.ts'
import { mediaUrl } from '../lib/media.ts'
import { BRAND, accentText, readableOn } from '../lib/color.ts'
import { BRAND, accentText, readableOn, withAlpha } from '../lib/color.ts'
import { documentTitle } from '../lib/site.ts'
import './SchedulePresent.css'
@ -37,6 +42,7 @@ import './SchedulePresent.css'
const KINDS = [
{ key: 'overview', label: 'Day overview', help: 'The whole day on one slide', seconds: 20 },
{ key: 'spotlight', label: 'Entry spotlight', help: 'One entry at a time, with its person', seconds: 12 },
{ key: 'block', label: 'Blocks', help: 'A block and the things in it, before each gets a spotlight', seconds: 15 },
{ key: 'graphic', label: 'Graphics', help: "An entry's graphic, full screen", seconds: 10 },
{ key: 'map', label: 'Map images', help: "An entry's own map, full screen", seconds: 10 },
] as const
@ -47,10 +53,15 @@ const ONE_COLUMN = 8
/* How long the controls stay up after the pointer last moved (ms). */
const CONTROLS_FOR = 2500
type Slide = { kind: Kind; seconds: number; day: Day; entry?: ContentBlockItem }
/* `parent` is a sub-item's block. */
type Slide = { kind: Kind; seconds: number; day: Day; entry?: ContentBlockItem; parent?: ContentBlockItem }
/* An entry's key in the address: day index, a dot, entry index. */
const entryKey = (day: number, entry: number) => `${day}.${entry}`
/* An entry's key in the address: day index, a dot, entry index, and
for a sub-item another dot and its index. */
const entryKey = (...at: number[]) => at.join('.')
/* Lines on an overview: entries and sub-items. */
const lineCount = (entries: ContentBlockItem[]) =>
entries.reduce((n, entry) => n + 1 + (entry.kind === 'block' ? (entry.items?.length ?? 0) : 0), 0)
const list = (value: string | null) => (value ? value.split(',').filter(Boolean) : null)
function readSettings(params: URLSearchParams, days: Day[]) {
@ -70,13 +81,32 @@ function buildSlides(days: Day[], { pickedDays, hidden, seconds }: Settings): Sl
const slides: Slide[] = []
days.forEach((all, d) => {
if (!pickedDays.has(d)) return
const day = { ...all, entries: all.entries.filter((_, e) => !hidden.has(entryKey(d, e))) }
if (day.entries.length === 0) return
const entries = all.entries.flatMap((entry, e) => {
if (hidden.has(entryKey(d, e))) return []
if (entry.kind !== 'block') return [entry]
return [{ ...entry, items: (entry.items ?? []).filter((_, i) => !hidden.has(entryKey(d, e, i))) }]
})
if (entries.length === 0) return
const day = { ...all, entries }
if (seconds.overview) slides.push({ kind: 'overview', seconds: seconds.overview, day })
for (const entry of day.entries) {
if (seconds.spotlight) slides.push({ kind: 'spotlight', seconds: seconds.spotlight, day, entry })
if (seconds.graphic && entry.media) slides.push({ kind: 'graphic', seconds: seconds.graphic, day, entry })
if (seconds.map && entry.map_image) slides.push({ kind: 'map', seconds: seconds.map, day, entry })
const media = (entry: ContentBlockItem, parent?: ContentBlockItem) => {
if (seconds.graphic && entry.media) slides.push({ kind: 'graphic', seconds: seconds.graphic, day, entry, parent })
if (seconds.map && entry.map_image) slides.push({ kind: 'map', seconds: seconds.map, day, entry, parent })
}
for (const entry of entries) {
if (entry.kind === 'heading') continue
if (entry.kind === 'block') {
if (seconds.block) slides.push({ kind: 'block', seconds: seconds.block, day, entry })
media(entry)
for (const item of entry.items ?? []) {
if (seconds.spotlight) slides.push({ kind: 'spotlight', seconds: seconds.spotlight, day, entry: item, parent: entry })
media(item, entry)
}
continue
}
if (seconds.spotlight && entry.kind !== 'break') slides.push({ kind: 'spotlight', seconds: seconds.spotlight, day, entry })
media(entry)
}
})
return slides
@ -243,16 +273,26 @@ function Setup({
<ul className="mt-3 space-y-2 pl-7">
{day.entries.map((entry, e) => (
<li key={e}>
<label className={`flex items-baseline gap-3 ${pickedDays.has(d) ? '' : 'opacity-50'}`}>
<input
type="checkbox"
disabled={!pickedDays.has(d)}
checked={!hidden.has(entryKey(d, e))}
onChange={() => setHidden(toggle(hidden, entryKey(d, e)))}
/>
<span className="w-32 shrink-0 text-sm text-muted">{entry.time}</span>
<span>{entry.text}</span>
</label>
<PickEntry
entry={entry}
enabled={pickedDays.has(d)}
checked={!hidden.has(entryKey(d, e))}
onToggle={() => setHidden(toggle(hidden, entryKey(d, e)))}
/>
{entry.kind === 'block' && entry.items?.length ? (
<ul className="mt-2 space-y-2 pl-7">
{entry.items.map((item, i) => (
<li key={i}>
<PickEntry
entry={item}
enabled={pickedDays.has(d) && !hidden.has(entryKey(d, e))}
checked={!hidden.has(entryKey(d, e, i))}
onToggle={() => setHidden(toggle(hidden, entryKey(d, e, i)))}
/>
</li>
))}
</ul>
) : null}
</li>
))}
</ul>
@ -284,6 +324,38 @@ function Setup({
)
}
/* One entry's checkbox on the setup screen, its kind beside it. */
const KIND_NOTE = { block: 'Block', break: 'Break', heading: 'Heading' } as const
function PickEntry({
entry,
enabled,
checked,
onToggle,
}: {
entry: ContentBlockItem
enabled: boolean
checked: boolean
onToggle: () => void
}) {
const note = entry.kind && entry.kind !== 'entry' ? KIND_NOTE[entry.kind] : null
return (
<label className={`flex items-baseline gap-3 ${enabled ? '' : 'opacity-50'}`}>
<input type="checkbox" disabled={!enabled} checked={checked} onChange={onToggle} />
<span className="w-32 shrink-0 text-sm text-muted">{entry.time}</span>
<span className={entry.kind === 'heading' ? 'font-semibold' : ''}>
{entry.featured && (
<span className="mr-1 text-link">
<FeaturedStar />
</span>
)}
{entry.text}
</span>
{note && <span className="text-xs text-muted">{note}</span>}
</label>
)
}
/* ── Player ─────────────────────────────────────────────────── */
function Player({
@ -444,12 +516,60 @@ function Rise({ order = 0, from = 'below', className = '', children }: {
)
}
/* One line of the day overview: an entry, or (`sub`) one of a
block's sub-items under it. A heading is a label; a break is
quieter. */
function OverviewLine({ entry, accent, sub = false }: { entry: ContentBlockItem; accent: string; sub?: boolean }) {
const color = accentText(accent)
if (entry.kind === 'heading') {
return (
<p
className="px-[1vw] pt-[2vh] pb-[0.6vh] text-[clamp(0.9rem,1.5vw,2rem)] font-bold uppercase tracking-wide"
style={{ color }}
>
{entry.text}
</p>
)
}
const quiet = entry.kind === 'break'
return (
<div className={`flex items-baseline gap-[2vw] px-[1vw] ${sub ? 'py-[0.6vh]' : 'border-b border-brand/15 py-[1.2vh]'}`}>
<span
className={`shrink-0 font-semibold ${sub ? 'w-[10vw] text-[clamp(0.9rem,1.4vw,1.9rem)]' : 'w-[12vw] text-[clamp(1rem,1.8vw,2.4rem)]'}`}
style={{ color: quiet ? undefined : color }}
>
{entry.time}
</span>
<span className="min-w-0 flex-1">
<span
className={`block leading-tight ${
quiet ? 'font-semibold text-muted' : 'font-bold text-ink'
} ${sub ? 'text-[clamp(1rem,1.9vw,2.4rem)]' : 'text-[clamp(1.2rem,2.4vw,3rem)]'}`}
>
{entry.featured && (
<span className="mr-[0.6vw]" style={{ color }}>
<FeaturedStar className="h-[0.8em] w-[0.8em]" />
</span>
)}
{entry.text}
</span>
{(entry.location || entry.person) && (
<span className="mt-1 flex flex-wrap items-center gap-x-[1.5vw] text-[clamp(0.9rem,1.4vw,1.8rem)] text-muted">
{entry.location && <span>{entry.location}</span>}
{entry.person && <span>{entry.person.name}</span>}
</span>
)}
</span>
</div>
)
}
function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
const color = accentText(accent)
if (slide.kind === 'overview') {
const entries = slide.day.entries
const two = entries.length > ONE_COLUMN
const two = lineCount(entries) > ONE_COLUMN
return (
<div className="flex h-full flex-col">
<Rise>
@ -459,22 +579,18 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
</Rise>
<ul className={`grid min-h-0 flex-1 content-start gap-x-[4vw] ${two ? 'grid-cols-2' : 'grid-cols-1'}`}>
{entries.map((entry, i) => (
<li key={i}>
<Rise order={i + 1} from="left" className="flex items-baseline gap-[2vw] border-b border-brand/15 py-[1.2vh]">
<span className="w-[12vw] shrink-0 text-[clamp(1rem,1.8vw,2.4rem)] font-semibold" style={{ color }}>
{entry.time}
</span>
<span className="min-w-0 flex-1">
<span className="block text-[clamp(1.2rem,2.4vw,3rem)] font-bold leading-tight text-ink">
{entry.text}
</span>
{(entry.location || entry.person) && (
<span className="mt-1 flex flex-wrap items-center gap-x-[1.5vw] text-[clamp(0.9rem,1.4vw,1.8rem)] text-muted">
{entry.location && <span>{entry.location}</span>}
{entry.person && <span>{entry.person.name}</span>}
</span>
)}
</span>
<li key={i} className="even:bg-tint-soft/60" style={entry.featured ? featuredStyle(accent) : undefined}>
<Rise order={i + 1} from="left">
<OverviewLine entry={entry} accent={accent} />
{entry.kind === 'block' && entry.items?.length ? (
<ul className="ml-[14vw] pb-[1vh]">
{entry.items.map((item, j) => (
<li key={j} style={item.featured ? featuredStyle(accent) : undefined}>
<OverviewLine entry={item} accent={accent} sub />
</li>
))}
</ul>
) : null}
</Rise>
</li>
))}
@ -485,6 +601,70 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
const entry = slide.entry!
if (slide.kind === 'block') {
const items = entry.items ?? []
return (
<div className="flex h-full flex-col">
<Rise>
<p className="text-[clamp(1.2rem,2.4vw,3rem)] font-semibold" style={{ color }}>
{[slide.day.name, entry.time].filter(Boolean).join(' · ')}
</p>
</Rise>
<Rise order={1}>
<h1 className="mt-[1vh] text-[clamp(2.4rem,5vw,6.5rem)] font-bold leading-[1.05] text-ink">
{entry.featured && (
<span className="mr-[1vw]" style={{ color }}>
<FeaturedStar className="h-[0.8em] w-[0.8em]" />
</span>
)}
{entry.text}
</h1>
</Rise>
{(entry.location || entry.person || entry.detail) && (
<Rise order={2}>
<p className="mt-[1vh] flex flex-wrap gap-x-[2vw] text-[clamp(1.1rem,2vw,2.6rem)] text-muted">
{[entry.location, entry.person?.name, entry.detail].filter(Boolean).map((part, i) => (
<span key={i}>{part}</span>
))}
</p>
</Rise>
)}
<ul className="mt-[4vh] min-h-0 flex-1" style={{ borderLeft: `0.4vw solid ${withAlpha(accent, 40)}` }}>
{items.map((item, i) => (
<li key={i} className="even:bg-tint-soft/60" style={item.featured ? featuredStyle(accent) : undefined}>
<Rise order={i + 3} from="left" className="flex items-center gap-[2vw] px-[2vw] py-[1.6vh]">
<span className="w-[14vw] shrink-0 text-[clamp(1rem,2vw,2.6rem)] font-semibold" style={{ color }}>
{item.time}
</span>
<span className="min-w-0 flex-1">
<span className="block text-[clamp(1.3rem,2.8vw,3.6rem)] font-bold leading-tight text-ink">
{item.featured && (
<span className="mr-[0.6vw]" style={{ color }}>
<FeaturedStar className="h-[0.8em] w-[0.8em]" />
</span>
)}
{item.text}
</span>
{(item.location || item.detail) && (
<span className="mt-1 block text-[clamp(0.9rem,1.6vw,2rem)] text-muted">
{[item.location, item.detail].filter(Boolean).join(' · ')}
</span>
)}
</span>
{item.person && (
<span className="flex shrink-0 items-center gap-[1vw] text-[clamp(0.9rem,1.6vw,2rem)] text-body">
<Avatar person={item.person} size="h-[5vw] w-[5vw] text-[1.4vw]" />
{item.person.name}
</span>
)}
</Rise>
</li>
))}
</ul>
</div>
)
}
if (slide.kind === 'graphic' || slide.kind === 'map') {
const src = mediaUrl(slide.kind === 'map' ? entry.map_image : entry.media)
const alt = slide.kind === 'map' ? mapAlt(entry) : (entry.media_alt ?? '')
@ -521,11 +701,18 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
<div className="min-w-0 flex-1">
<Rise from="right">
<p className="text-[clamp(1.2rem,2.4vw,3rem)] font-semibold" style={{ color }}>
{[slide.day.name, entry.time].filter(Boolean).join(' · ')}
{[slide.day.name, slide.parent?.text, entry.time].filter(Boolean).join(' · ')}
</p>
</Rise>
<Rise order={1} from="right">
<h1 className="mt-[1vh] text-[clamp(2.4rem,5.5vw,7rem)] font-bold leading-[1.05] text-ink">{entry.text}</h1>
<h1 className="mt-[1vh] text-[clamp(2.4rem,5.5vw,7rem)] font-bold leading-[1.05] text-ink">
{entry.featured && (
<span className="mr-[1vw]" style={{ color }}>
<FeaturedStar className="h-[0.8em] w-[0.8em]" />
</span>
)}
{entry.text}
</h1>
</Rise>
{entry.location && (
<Rise order={2} from="right">