Present: list slides, centered people

- A list block's Overview slide and A slide per item (098): its
  items' text on one slide, and each item with its detail, centered
- Setup ticks a list's overview and items on and off; List overview
  and List items seconds
- A presented people row is centered

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-11-12 04:57:08 -06:00
parent 584340b0ee
commit 2282bee23c
7 changed files with 152 additions and 8 deletions

View file

@ -189,6 +189,9 @@ export const blocksChild = (ownerKind) => ({
bool("present_map_no_details"), bool("present_map_no_details"),
enumeration("present_places", ["picked", "none"]), enumeration("present_places", ["picked", "none"]),
text("present_place_keys"), text("present_place_keys"),
// A list's own slides (098).
bool("present_list_overview"),
bool("present_list_items"),
], ],
children: [ children: [
{ {

View file

@ -0,0 +1,18 @@
-- ═══════════════════════════════════════════════════════════════
-- 098 A LIST BLOCK'S PRESENTATION SLIDES
--
-- A list block presented (EventPresent.tsx) is a section's text,
-- unless it has slides of its own:
--
-- present_list_overview one slide of every item's text, without
-- the detail, centered
-- present_list_items a slide per item: its text the heading,
-- its detail under it, centered
--
-- Either or both. Other block types ignore them.
-- ═══════════════════════════════════════════════════════════════
ALTER TABLE content_blocks ADD COLUMN present_list_overview INTEGER NOT NULL DEFAULT 0
CHECK (present_list_overview IN (0, 1));
ALTER TABLE content_blocks ADD COLUMN present_list_items INTEGER NOT NULL DEFAULT 0
CHECK (present_list_items IN (0, 1));

View file

@ -74,6 +74,8 @@ function presentOf(row) {
map_no_details: row.present_map_no_details === 1, map_no_details: row.present_map_no_details === 1,
places: row.present_places, places: row.present_places,
place_keys: row.present_place_keys ? row.present_place_keys.split(",").filter(Boolean) : [], place_keys: row.present_place_keys ? row.present_place_keys.split(",").filter(Boolean) : [],
list_overview: row.present_list_overview === 1,
list_items: row.present_list_items === 1,
}; };
return Object.values(present).some((value) => (Array.isArray(value) ? value.length : value)) ? present : null; return Object.values(present).some((value) => (Array.isArray(value) ? value.length : value)) ? present : null;
} }
@ -87,7 +89,8 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
`SELECT id, owner_id, type, text, media, href, alt, cite, captions, team_id, venue_id, `SELECT id, owner_id, type, text, media, href, alt, cite, captions, team_id, venue_id,
word_motion, word_direction, word_seconds, list_style, org_kind, word_motion, word_direction, word_seconds, list_style, org_kind,
present_hide, present_text, present_map_split, present_map_no_list, present_hide, present_text, present_map_split, present_map_no_list,
present_map_no_details, present_places, present_place_keys present_map_no_details, present_places, present_place_keys,
present_list_overview, present_list_items
FROM content_blocks FROM content_blocks
WHERE owner_kind = ? AND slot IN (?, 'both') AND owner_id IN (${placeholders(ids.length)}) WHERE owner_kind = ? AND slot IN (?, 'both') AND owner_id IN (${placeholders(ids.length)})
ORDER BY owner_id, sort_order`, ORDER BY owner_id, sort_order`,

View file

@ -777,7 +777,7 @@ function Tile({
function PeopleRow({ groups, people }: { groups?: PeopleGroup[]; people?: Person[] }) { function PeopleRow({ groups, people }: { groups?: PeopleGroup[]; people?: Person[] }) {
const everyone = [...(groups ?? []).flatMap((group) => group.people), ...(people ?? [])]; const everyone = [...(groups ?? []).flatMap((group) => group.people), ...(people ?? [])];
return ( return (
<ul className="flex flex-wrap gap-6"> <ul className="flex flex-wrap justify-center gap-6">
{everyone.map((person, i) => ( {everyone.map((person, i) => (
<li key={person.id ?? i} className="flex w-28 flex-col items-center text-center"> <li key={person.id ?? i} className="flex w-28 flex-col items-center text-center">
<span className="block h-24 w-24 overflow-hidden rounded-full"> <span className="block h-24 w-24 overflow-hidden rounded-full">

View file

@ -551,6 +551,20 @@ export const PRESENT_BLOCK_FIELDS = [
when: { path: "present_places", value: "picked" }, when: { path: "present_places", value: "picked" },
emptyNote: "No locations yet: pick the block's Venue, and give it locations under Data → Venues.", emptyNote: "No locations yet: pick the block's Venue, and give it locations under Data → Venues.",
}, },
{
path: "present_list_overview",
label: "Overview slide",
widget: "checkbox",
help: "Presented: a slide of every item's text, without the detail, centered.",
when: { path: "type", value: "list" },
},
{
path: "present_list_items",
label: "A slide per item",
widget: "checkbox",
help: "Presented: each item alone, its text the heading and its detail under it, centered. With either of these the list leaves its section's text slide.",
when: { path: "type", value: "list" },
},
]; ];
export const blocksChild = { export const blocksChild = {

View file

@ -86,6 +86,10 @@ export type BlockPresent = {
/** A map: which locations get a slide; null every marked one. */ /** A map: which locations get a slide; null every marked one. */
places: 'picked' | 'none' | null places: 'picked' | 'none' | null
place_keys: string[] place_keys: string[]
/** A list: one slide of its items' text (098). */
list_overview: boolean
/** A list: a slide per item, its detail under its text (098). */
list_items: boolean
} }
/** An event's presentation look (095). */ /** An event's presentation look (095). */

View file

@ -16,6 +16,13 @@
cards each events block (088): its events on one slide cards each events block (088): its events on one slide
event then each event alone: picture, title, its person event then each event alone: picture, title, its person
host and its own page's blocks (else its card text) host and its own page's blocks (else its card text)
list a list block with an Overview slide (098): its
items' text, centered
item then, with A slide per item, each item: its text
the heading, its detail under it, centered
A list without either is part of its section's text. The setup
ticks a list's overview (`hide` l<section>.<block>) and its items
(l<section>.<block>.<item>) on and off.
A schedule's slides, for each day picked, in order: A schedule's slides, for each day picked, in order:
overview the day's picked entries on one slide overview the day's picked entries on one slide
@ -81,7 +88,7 @@ import {
} from '../components/ScheduleBlock.tsx' } from '../components/ScheduleBlock.tsx'
import ContentBlocks, { eventLine } from '../components/ContentBlocks.tsx' import ContentBlocks, { eventLine } from '../components/ContentBlocks.tsx'
import { LocationNumber, MapPicture, isMarked, locationNumber } from '../components/MapBlock.tsx' import { LocationNumber, MapPicture, isMarked, locationNumber } from '../components/MapBlock.tsx'
import { Paragraphs } from '../components/InlineText.tsx' import { Inline, Paragraphs } from '../components/InlineText.tsx'
import { Presenting } from '../lib/presenting.ts' import { Presenting } from '../lib/presenting.ts'
import { import {
useEvent, useEvent,
@ -111,6 +118,8 @@ const KINDS = [
{ key: 'place', label: 'Map locations', help: 'The map again for each location, it lit up', seconds: 8 }, { key: 'place', label: 'Map locations', help: 'The map again for each location, it lit up', seconds: 8 },
{ key: 'cards', label: 'Event lists', help: "An events block's events on one slide", seconds: 15 }, { key: 'cards', label: 'Event lists', help: "An events block's events on one slide", seconds: 15 },
{ key: 'event', label: 'Event spotlight', help: 'Each event of an events block alone', seconds: 12 }, { key: 'event', label: 'Event spotlight', help: 'Each event of an events block alone', seconds: 12 },
{ key: 'list', label: 'List overview', help: "A list block's items on one slide, without their detail", seconds: 12 },
{ key: 'item', label: 'List items', help: 'Each list item alone, its detail under it', seconds: 10 },
] as const ] as const
type Kind = (typeof KINDS)[number]['key'] type Kind = (typeof KINDS)[number]['key']
@ -121,6 +130,14 @@ const OWN_SLIDES = new Map([
['map', 'Map'], ['map', 'Map'],
['events', 'Events'], ['events', 'Events'],
]) ])
/* What the setup calls a block with slides of its own (a list with
an Overview slide or A slide per item, 098), else null. */
const ownSlides = (block: ContentBlock): string | null =>
OWN_SLIDES.get(block.type) ??
(block.type === 'list' && (block.present?.list_overview || block.present?.list_items) ? 'List' : null)
/* A list's overview's key in `hide`, and an item's (`i`). */
const listKey = (s: number, b: number, i?: number) => `l${s}.${b}${i == null ? '' : `.${i}`}`
/* Blocks that start a section. */ /* Blocks that start a section. */
const STARTS_SECTION = new Set(['heading', 'tab']) const STARTS_SECTION = new Set(['heading', 'tab'])
/* Text that alone makes no section slide: the heading titles what /* Text that alone makes no section slide: the heading titles what
@ -311,15 +328,16 @@ function mapSlides(slides: Slide[], block: ContentBlock, at: string, label: stri
/* Each slide's id says where it comes from, so a saved order still /* Each slide's id says where it comes from, so a saved order still
finds it: t<section> a section's text; v and p a map and its finds it: t<section> a section's text; v and p a map and its
locations, c and e an events list and its events, by locations, c and e an events list and its events, by
<section>.<block>; o, k, s, g and m a schedule's overview, block, <section>.<block>; l and i a list's overview and items (listKey);
spotlight, graphic and map image, and x its tag slides, by key(). */ o, k, s, g and m a schedule's overview, block, spotlight, graphic
and map image, and x its tag slides, by key(). */
function buildSlides(sections: Section[], schedules: Map<ContentBlock, Schedule>, picks: Picks): Slide[] { function buildSlides(sections: Section[], schedules: Map<ContentBlock, Schedule>, picks: Picks): Slide[] {
const { skipped, seconds } = picks const { skipped, seconds, hidden } = picks
const slides: Slide[] = [] const slides: Slide[] = []
sections.forEach((section, s) => { sections.forEach((section, s) => {
if (skipped.has(s)) return if (skipped.has(s)) return
const label = section.title const label = section.title
const text = section.blocks.filter((block) => !OWN_SLIDES.has(block.type)) const text = section.blocks.filter((block) => !ownSlides(block))
// Nothing but a heading: it titles the slides that follow. // Nothing but a heading: it titles the slides that follow.
const own = text.some((block) => !FILLER.has(block.type)) const own = text.some((block) => !FILLER.has(block.type))
if (seconds.section && own) slides.push({ id: `t${s}`, kind: 'section', seconds: seconds.section, label, blocks: text }) if (seconds.section && own) slides.push({ id: `t${s}`, kind: 'section', seconds: seconds.section, label, blocks: text })
@ -329,6 +347,15 @@ function buildSlides(sections: Section[], schedules: Map<ContentBlock, Schedule>
const schedule = schedules.get(block) const schedule = schedules.get(block)
if (schedule) scheduleSlides(slides, schedule, picks) if (schedule) scheduleSlides(slides, schedule, picks)
if (block.type === 'map' && block.venue) mapSlides(slides, block, at, label, title, seconds) if (block.type === 'map' && block.venue) mapSlides(slides, block, at, label, title, seconds)
if (block.type === 'list' && ownSlides(block)) {
const items = (block.items ?? []).flatMap((item, i) => (hidden.has(listKey(s, b, i)) ? [] : [{ item, i }]))
if (seconds.list && block.present?.list_overview && items.length && !hidden.has(listKey(s, b))) {
slides.push({ id: `l${at}`, kind: 'list', seconds: seconds.list, label, title: title ?? undefined, items: items.map(({ item }) => item) })
}
if (seconds.item && block.present?.list_items) {
for (const { item, i } of items) slides.push({ id: `i${at}.${i}`, kind: 'item', seconds: seconds.item, label, entry: item })
}
}
if (block.type === 'events') { if (block.type === 'events') {
const items = (block.items ?? []).filter((item) => item.event) const items = (block.items ?? []).filter((item) => item.event)
if (seconds.cards && items.length) slides.push({ id: `c${at}`, kind: 'cards', seconds: seconds.cards, label, items }) if (seconds.cards && items.length) slides.push({ id: `c${at}`, kind: 'cards', seconds: seconds.cards, label, items })
@ -374,6 +401,10 @@ function slideName(slide: Slide): string {
return slide.location!.name return slide.location!.name
case 'event': case 'event':
return entry!.text || entry!.event!.title return entry!.text || entry!.event!.title
case 'list':
return slide.title ?? (slide.items ?? []).map((item) => item.text).join(', ')
case 'item':
return entry!.text
default: default:
return [slide.day?.name, entry!.time, entry!.text].filter(Boolean).join(' · ') return [slide.day?.name, entry!.time, entry!.text].filter(Boolean).join(' · ')
} }
@ -649,7 +680,7 @@ function Setup({
<div className="space-y-6"> <div className="space-y-6">
{sections.map((section, s) => { {sections.map((section, s) => {
const on = !skipped.has(s) const on = !skipped.has(s)
const kinds = [...new Set(section.blocks.map((block) => (OWN_SLIDES.get(block.type) ?? 'Text')))] const kinds = [...new Set(section.blocks.map((block) => ownSlides(block) ?? 'Text'))]
return ( return (
<fieldset key={s} className="bg-raised p-4 shadow-sm"> <fieldset key={s} className="bg-raised p-4 shadow-sm">
<legend className="sr-only">{section.title}</legend> <legend className="sr-only">{section.title}</legend>
@ -659,6 +690,34 @@ function Setup({
<span className="text-xs text-muted">{kinds.join(', ')}</span> <span className="text-xs text-muted">{kinds.join(', ')}</span>
</label> </label>
{section.blocks.map((block, b) => { {section.blocks.map((block, b) => {
// A list with slides: its overview, then its items.
if (block.type === 'list' && ownSlides(block)) {
return (
<div key={b} className="mt-3 space-y-2 pl-7">
{block.present?.list_overview && (
<PickEntry
label="List overview"
strong
enabled={on}
checked={!hidden.has(listKey(s, b))}
onToggle={() => setHidden(toggle(hidden, listKey(s, b)))}
/>
)}
<ul className="space-y-2 pl-7">
{(block.items ?? []).map((item, i) => (
<li key={i}>
<PickEntry
label={item.text}
enabled={on}
checked={!hidden.has(listKey(s, b, i))}
onToggle={() => setHidden(toggle(hidden, listKey(s, b, i)))}
/>
</li>
))}
</ul>
</div>
)
}
const schedule = schedules.get(block) const schedule = schedules.get(block)
if (!schedule) return null if (!schedule) return null
const { n, days } = schedule const { n, days } = schedule
@ -1369,8 +1428,51 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
) )
} }
if (slide.kind === 'list') {
const items = slide.items ?? []
return (
<div className="flex h-full flex-col items-center text-center">
{slide.title && <SlideTitle color={color}>{slide.title}</SlideTitle>}
<Scroll center className="w-full">
<ul className="space-y-[2vh]">
{items.map((item, i) => (
<li key={i}>
<Rise order={i + 1}>
<span className="text-[clamp(1.4rem,3vw,4rem)] font-bold leading-tight text-ink">
<Inline text={item.text} accent={accent} />
</span>
</Rise>
</li>
))}
</ul>
</Scroll>
</div>
)
}
const entry = slide.entry! const entry = slide.entry!
if (slide.kind === 'item') {
return (
<div className="flex h-full flex-col text-center">
<Scroll center>
<Rise>
<h1 className="text-[clamp(2.4rem,5.5vw,7rem)] font-bold leading-[1.05]" style={{ color }}>
<Inline text={entry.text} accent={accent} />
</h1>
</Rise>
{entry.detail && (
<Rise order={1}>
<p className="mx-auto mt-[3vh] max-w-[70vw] text-[clamp(1.2rem,2.6vw,3.2rem)] leading-snug text-body">
{entry.detail}
</p>
</Rise>
)}
</Scroll>
</div>
)
}
if (slide.kind === 'event') { if (slide.kind === 'event') {
const event = entry.event! const event = entry.event!
const image = mediaUrl(event.image) const image = mediaUrl(event.image)