Present: a list's slides picked on the setup screen, not the block

- Setup: Overview slide and A slide per item per list (`lists`), its
  items ticked on and off when either is picked
- The block's two fields and 098's columns go (100)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-11-12 05:02:06 -06:00
parent ae06cd2b4f
commit c4bb685bc0
6 changed files with 70 additions and 68 deletions

View file

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

View file

@ -0,0 +1,10 @@
-- ═══════════════════════════════════════════════════════════════
-- 100 A LIST'S SLIDES PICKED WHEN PRESENTING
--
-- A list block's Overview slide and A slide per item (098) are
-- picked on the Present setup screen (EventPresent.tsx, `lists` in
-- its address) rather than on the block, so 098's columns go.
-- ═══════════════════════════════════════════════════════════════
ALTER TABLE content_blocks DROP COLUMN present_list_overview;
ALTER TABLE content_blocks DROP COLUMN present_list_items;

View file

@ -76,8 +76,6 @@ function presentOf(row) {
map_no_details: row.present_map_no_details === 1,
places: row.present_places,
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;
}
@ -91,8 +89,7 @@ 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,
word_motion, word_direction, word_seconds, list_style, org_kind,
present_show, present_text, present_map_split, present_map_no_list,
present_map_no_details, present_places, present_place_keys,
present_list_overview, present_list_items
present_map_no_details, present_places, present_place_keys
FROM content_blocks
WHERE owner_kind = ? AND slot IN (?, 'both') AND owner_id IN (${placeholders(ids.length)})
ORDER BY owner_id, sort_order`,

View file

@ -556,20 +556,6 @@ export const PRESENT_BLOCK_FIELDS = [
when: { path: "present_places", value: "picked" },
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 = {

View file

@ -89,10 +89,6 @@ export type BlockPresent = {
/** A map: which locations get a slide; null every marked one. */
places: 'picked' | 'none' | null
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). */

View file

@ -16,13 +16,14 @@
cards each events block (088): its events on one slide
event then each event alone: picture, title, its person
host and its own page's blocks (else its card text)
list a list block with an Overview slide (098): its
list a list block picked for an Overview slide: 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.
item then, picked for A slide per item, each item: its
text the heading, its detail under it, centered
A list picked for neither is part of its section's text. The
setup picks them per list (`lists`, o<section>.<block> and
i<section>.<block>) and ticks its items on and off (`hide`,
l<section>.<block>.<item>).
A schedule's slides, for each day picked, in order:
overview the day's picked entries on one slide
@ -102,6 +103,7 @@ import {
import { mediaUrl } from '../lib/media.ts'
import { BRAND, accentText, readableOn, withAlpha } from '../lib/color.ts'
import { documentTitle } from '../lib/site.ts'
import { preview } from '../lib/text.ts'
import { useDarkTheme } from '../lib/darkTheme.ts'
import './EventPresent.css'
@ -130,13 +132,16 @@ const OWN_SLIDES = new Map([
['map', 'Map'],
['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 =>
/* A list's picks in `lists`: its Overview slide, A slide per item. */
const overviewKey = (s: number, b: number) => `o${s}.${b}`
const itemsKey = (s: number, b: number) => `i${s}.${b}`
/* A list item's key in `hide`. */
const listKey = (s: number, b: number, i: number) => `l${s}.${b}.${i}`
/* What the setup calls a block with slides of its own (a list picked
for an Overview slide or A slide per item), else null. */
const ownSlides = (block: ContentBlock, lists: Set<string>, s: number, b: number): 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}`}`
(block.type === 'list' && (lists.has(overviewKey(s, b)) || lists.has(itemsKey(s, b))) ? 'List' : null)
/* Blocks that start a section. */
const STARTS_SECTION = new Set(['heading', 'tab'])
@ -235,11 +240,12 @@ function readSettings(params: URLSearchParams) {
screen: Number.isFinite(screen) && screen > 0 ? screen : PER_SCREEN,
only: params.get('only') || null,
order: list(params.get('order')),
lists: new Set(list(params.get('lists')) ?? []),
theme: THEMES.find((theme) => theme === params.get('theme')) ?? null,
}
}
type Settings = ReturnType<typeof readSettings>
type Picks = Pick<Settings, 'skipped' | 'hidden' | 'seconds' | 'only'>
type Picks = Pick<Settings, 'skipped' | 'hidden' | 'seconds' | 'only' | 'lists'>
/* An entry or sub-item with its key (key()), carried through the
picks and the tag filter, which copy blocks. */
@ -332,12 +338,12 @@ function mapSlides(slides: Slide[], block: ContentBlock, at: string, label: stri
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[] {
const { skipped, seconds, hidden } = picks
const { skipped, seconds, hidden, lists } = picks
const slides: Slide[] = []
sections.forEach((section, s) => {
if (skipped.has(s)) return
const label = section.title
const text = section.blocks.filter((block) => !ownSlides(block))
const text = section.blocks.filter((block, b) => !ownSlides(block, lists, s, b))
// Nothing but a heading: it titles the slides that follow.
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 })
@ -347,12 +353,12 @@ function buildSlides(sections: Section[], schedules: Map<ContentBlock, Schedule>
const schedule = schedules.get(block)
if (schedule) scheduleSlides(slides, schedule, picks)
if (block.type === 'map' && block.venue) mapSlides(slides, block, at, label, title, seconds)
if (block.type === 'list' && ownSlides(block)) {
if (block.type === 'list' && ownSlides(block, lists, s, b)) {
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))) {
if (seconds.list && lists.has(overviewKey(s, b)) && items.length) {
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) {
if (seconds.item && lists.has(itemsKey(s, b))) {
for (const { item, i } of items) slides.push({ id: `i${at}.${i}`, kind: 'item', seconds: seconds.item, label, entry: item })
}
}
@ -510,6 +516,7 @@ export default function EventPresent() {
if (next.only) out.set('only', next.only)
if (next.order?.length) out.set('order', next.order.join(','))
if (next.theme) out.set('theme', next.theme)
if (next.lists.size) out.set('lists', [...next.lists].join(','))
out.set('play', '1')
setParams(out)
}}
@ -543,8 +550,9 @@ function Setup({
const [screen, setScreen] = useState(settings.screen)
const [order, setOrder] = useState(settings.order)
const [theme, setTheme] = useState(settings.theme)
const [lists, setLists] = useState(settings.lists)
const [dragging, setDragging] = useState<number | null>(null)
const slides = ordered(buildSlides(sections, schedules, { skipped, hidden, seconds, only }), order)
const slides = ordered(buildSlides(sections, schedules, { skipped, hidden, seconds, only, lists }), order)
const count = slides.length
// Moves a slide in the list, which then names every slide shown.
const move = (from: number, to: number) => {
@ -680,7 +688,7 @@ function Setup({
<div className="space-y-6">
{sections.map((section, s) => {
const on = !skipped.has(s)
const kinds = [...new Set(section.blocks.map((block) => ownSlides(block) ?? 'Text'))]
const kinds = [...new Set(section.blocks.map((block, b) => ownSlides(block, lists, s, b) ?? 'Text'))]
return (
<fieldset key={s} className="bg-raised p-4 shadow-sm">
<legend className="sr-only">{section.title}</legend>
@ -690,31 +698,39 @@ function Setup({
<span className="text-xs text-muted">{kinds.join(', ')}</span>
</label>
{section.blocks.map((block, b) => {
// A list with slides: its overview, then its items.
if (block.type === 'list' && ownSlides(block)) {
// A list: its own slides if picked, then its items.
if (block.type === 'list' && block.items?.length) {
const own = ownSlides(block, lists, s, b)
const first = preview(block.items.map((item) => item.text).join(', '), 60)
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)))}
/>
<p className="text-sm text-muted">List: {first}</p>
<PickEntry
label="Overview slide: every item's text, centered"
enabled={on}
checked={lists.has(overviewKey(s, b))}
onToggle={() => setLists(toggle(lists, overviewKey(s, b)))}
/>
<PickEntry
label="A slide per item: its text, its detail under it"
enabled={on}
checked={lists.has(itemsKey(s, b))}
onToggle={() => setLists(toggle(lists, itemsKey(s, b)))}
/>
{own && (
<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>
)}
<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>
)
}
@ -829,7 +845,7 @@ function Setup({
<button
type="button"
disabled={count === 0}
onClick={() => onPlay({ skipped, hidden, seconds, screen, only, order, theme })}
onClick={() => onPlay({ skipped, hidden, seconds, screen, only, order, theme, lists })}
className="btn inline-flex items-center gap-2 px-6 py-3 disabled:opacity-50"
style={{ background: accent, color: readableOn(accent) }}
>