Present: a heading alone as a centered slide; just an events list

- A section left with only its heading and subheadings, and nothing
  after it to title, gets a centered slide of them
- Setup, per events block: A slide per event, so the list slide can
  show alone

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-11-12 06:57:38 -06:00
parent b2ef692155
commit b286cbddbf

View file

@ -152,6 +152,7 @@ const OWN_SLIDES = new Map([
by eventKey. */
const EVENT_PARTS = [
['overview', 'List slide'],
['each', 'A slide per event'],
['picture', 'Picture'],
['line', 'Type and date'],
['person', 'Presenter'],
@ -257,7 +258,8 @@ function sectionsOf(blocks: ContentBlock[], title: string): Section[] {
sections.push({ title: heading || title, headed: Boolean(heading), blocks: [] })
} else if (!block.present?.hide) sections[sections.length - 1].blocks.push(block)
}
return sections.filter((section) => section.blocks.length)
// A heading with nothing left under it still has its title slide.
return sections.filter((section) => section.blocks.length || section.headed)
}
/* A day's, entry's or sub-item's key in the address: the schedule's
@ -407,6 +409,7 @@ function buildSlides(sections: Section[], schedules: Map<ContentBlock, Schedule>
slides.push({ id: `t${s}`, kind: 'section', seconds: seconds.section, label, blocks: text, pictures: side })
}
const title = section.headed && !own ? label : null
const before = slides.length
section.blocks.forEach((block, b) => {
const at = `${s}.${b}`
const schedule = schedules.get(block)
@ -433,11 +436,17 @@ function buildSlides(sections: Section[], schedules: Map<ContentBlock, Schedule>
if (seconds.cards && items.length && !off.has('overview')) {
slides.push({ id: `c${at}`, kind: 'cards', seconds: seconds.cards, label, title: title ?? undefined, items: items.map(({ item }) => item), off })
}
if (seconds.event) {
// Without A slide per event, just the list slide.
if (seconds.event && !off.has('each')) {
for (const { item, i } of items) slides.push({ id: `e${at}.${i}`, kind: 'event', seconds: seconds.event, label, entry: item, off })
}
}
})
// Only a heading (and subheadings) and nothing after it to title:
// the heading as a slide of its own, centered.
if (seconds.section && section.headed && !own && slides.length === before) {
slides.push({ id: `t${s}`, kind: 'section', seconds: seconds.section, label, blocks: text })
}
})
return slides
}
@ -1624,8 +1633,8 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
// The page's own blocks, zoomed up from the page's size. The
// zoom is inside Scroll, so it measures what the screen shows.
const zoom = Math.max(1, window.innerWidth / TEXT_WIDTH)
// Only people or pictures: the title and them in the middle of the
// slide, both ways.
// Only people or pictures, or just the heading and subheadings: the
// title and them in the middle of the slide, both ways.
if (slide.blocks!.every((block) => block.type === 'people' || isPicture(block) || FILLER.has(block.type))) {
return (
<div className="flex h-full flex-col text-center">