From 818d648e9182e07740fa60c14fdb61494c2d25b2 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Mon, 9 Nov 2026 03:21:18 -0600
Subject: [PATCH 01/33] Venues, map blocks and event blocks; schedule entries
link to them
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Data → Venues: a map picture with its locations marked as pins or
boxes (088). A Map block draws a venue with its locations listed;
a schedule names a venue and its entries pick a location, linking to
the map on the page with it lit up. Entries and sub-items can name
an event (a workshop) and take what they leave blank from it, and an
Events block shows event cards.
Co-Authored-By: Claude Opus 5.5
---
docs/updating-data-in-code.md | 6 +-
server/src/admin-schema.js | 11 ++
server/src/admin-schema/columns.js | 11 ++
server/src/admin-schema/venues.js | 44 +++++++
server/src/migrations/088_venues.sql | 125 +++++++++++++++++++
server/src/seed-showcase.js | 40 +++++-
server/src/shape.js | 104 +++++++++++++++-
src/components/ContentBlocks.tsx | 66 ++++++++++
src/components/MapBlock.tsx | 155 ++++++++++++++++++++++++
src/components/ScheduleBlock.tsx | 33 ++++-
src/components/admin/MapMarkerInput.tsx | 130 ++++++++++++++++++++
src/components/admin/fields.tsx | 66 +++++++---
src/lib/adminSchema.ts | 2 +
src/lib/adminSchema/shared.ts | 84 ++++++++++++-
src/lib/adminSchema/venues.ts | 72 +++++++++++
src/lib/useContent.ts | 44 +++++++
src/pages/admin/EntityEdit.tsx | 1 +
src/pages/admin/adminNav.ts | 5 +
18 files changed, 964 insertions(+), 35 deletions(-)
create mode 100644 server/src/admin-schema/venues.js
create mode 100644 server/src/migrations/088_venues.sql
create mode 100644 src/components/MapBlock.tsx
create mode 100644 src/components/admin/MapMarkerInput.tsx
create mode 100644 src/lib/adminSchema/venues.ts
diff --git a/docs/updating-data-in-code.md b/docs/updating-data-in-code.md
index 36d92c0..fbfbe4b 100644
--- a/docs/updating-data-in-code.md
+++ b/docs/updating-data-in-code.md
@@ -181,8 +181,8 @@ also in `server/src/admin-schema/` and a CHECK):
| Links → Kind (on organizations, events, people, teams) | action, social, website, email | no | `splitLinks` in `server/src/shape.js` |
| Links → Platform | instagram, facebook, discord, youtube, tiktok, x, substack, spotify, linkedin | **yes**, `PLATFORMS` | `PlatformIcon.tsx` draws the icon on the button. **No CHECK and no `enumeration`**: the column is plain text, so adding one is an entry in `PLATFORMS` (`src/lib/platforms.ts`) and its icon in `src/components/PlatformIcon.tsx`, no migration. |
| Content blocks → Shown in (slot) | card, body | **yes** | `paragraphs()` in `server/src/shape.js` (card), `ContentBlocks.tsx` (body) |
-| Content blocks → Type | heading, subheading, paragraph, list, links, quote, image, divider, video, button, callout, schedule, table | **yes**, `BLOCK_TYPES` (with each type's description) | `ContentBlocks.tsx` (one renderer per type). Which fields each type shows is `when` on the fields in `blocksChild` (`src/lib/adminSchema/shared.ts`). |
-| Content blocks → Schedule items → Type | (blank: normal entry), block, break, heading | **yes**, migration 086 | `SCHEDULE_KINDS` in `src/lib/adminSchema/shared.ts`; drawn by `ScheduleBlock.tsx` and `SchedulePresent.tsx` (which slides each kind gets). A block's sub-items are `content_block_subitems`. A schedule's own tags (087) are `content_block_tags`, rows of the block typed in the admin (not a fixed list); entries name them by `tag_key`, made in the admin as the tag is added. |
+| Content blocks → Type | heading, subheading, paragraph, list, links, quote, image, divider, video, button, callout, schedule, table, cards, people, map, events | **yes**, `BLOCK_TYPES` (with each type's description) | `ContentBlocks.tsx` (one renderer per type). Which fields each type shows is `when` on the fields in `blocksChild` (`src/lib/adminSchema/shared.ts`). |
+| Content blocks → Schedule items → Type | (blank: normal entry), block, break, heading | **yes**, migration 086 | `SCHEDULE_KINDS` in `src/lib/adminSchema/shared.ts`; drawn by `ScheduleBlock.tsx` and `SchedulePresent.tsx` (which slides each kind gets). A block's sub-items are `content_block_subitems`. A schedule's own tags (087) are `content_block_tags`, rows of the block typed in the admin (not a fixed list); entries name them by `tag_key`, made in the admin as the tag is added. A schedule's Venue (088) lends its locations (Data → Venues, `venue_locations`) to its entries' Map location, named by `location_key` the same way; an entry's Event (a workshop) fills what it leaves blank in `shape.js` (`attachEvents`). |
| Timeline → Kind (+ list filter) | milestone, event, organization, award, people | no | `KIND_NAMES` in `src/pages/sections/history/TimelineEntry.tsx` |
| Timeline → Points at (+ list filter) | event, organization, award, person, team | no | `refHref` in `src/lib/hrefs.ts` |
| Timeline → Precision (and on events/orgs) | year, month, day | no | the history page's grouping |
@@ -272,7 +272,7 @@ A Numbers section's "Number Source" dropdown works the same way:
| The icons a Connect nav section's path can pick | `src/data/pathIcons.ts` (keys and labels) **and** `ICONS` in `src/pages/sections/home/Pathfinder.tsx` (the Phosphor icon for each key) | Add a line to both. A path saved with an emoji from before the list shows it as it is. |
| A page section's accent color | `BRAND` and `ACCENTS` in `src/lib/color.ts` | Pages pick from these (`accent: ACCENTS.green`); add a color there, not a hex in a page. Each is readable as text on white and the tints. |
| The palette (the 16-color grid the theme is drawn from) | `PALETTE` in `src/lib/color.ts` | Four families, a column each. `PALETTE_LIGHT` / `PALETTE_DARK` are the fills things colored by data use (a person's initials tile, `paletteFill`); the page background's layers (how many circles, their sizes and parallax speeds) are `LAYERS` in `src/components/PageBackdrop.tsx` and its shades are in `PageBackdrop.css`; the admin home's two alternating group colors are `BLOCK_COLORS` in `src/pages/admin/AdminHome.tsx`. |
-| The accessibility panel's choices (bottom right of every public page) | `SETTINGS` in `src/components/AccessibilityPanel.tsx`; the color blind modes are `VISIONS` and `SWAPS` in `src/lib/color.ts` | Each choice is an attribute on `` styled in `src/index.css`, and `index.html` sets it again before the first paint, so a new one goes in all three. A color blind mode replaces all three color families, teal, green and amber (`SWAPS`, picked by simulating each type: see the comment there), in code, in data colors as they load (`src/lib/api.ts`, never under /admin), in CSS (the `--pal-*` variables in `src/index.css`, which hold the same values as `SWAPS`: change both) and in the theme tokens drawn from them. A palette hex in a component or CSS file should be `var(--pal--)` (eg. `var(--pal-amber-2)`), or a color blind mode won't reach it. Reading mode is `src/components/ReaderView.tsx`, which reads the hidden page and writes out its headings, paragraphs, links and described pictures. A part it can't read well (a carousel, tabs, details behind a click, a map) draws its own text version when `useReadingMode()` (`src/lib/readingMode.ts`) is on: the hero, pathfinder, stats, history rail, event lists, calendar (the next six weeks), featured cards, org lists and groups map, history timeline, schedule, people tiles and video player; the countdown draws nothing. A new component with any of those should do the same. Something saved or sent (the newsletter's colors) is a stored hex, which is never swapped. |
+| The accessibility panel's choices (bottom right of every public page) | `SETTINGS` in `src/components/AccessibilityPanel.tsx`; the color blind modes are `VISIONS` and `SWAPS` in `src/lib/color.ts` | Each choice is an attribute on `` styled in `src/index.css`, and `index.html` sets it again before the first paint, so a new one goes in all three. A color blind mode replaces all three color families, teal, green and amber (`SWAPS`, picked by simulating each type: see the comment there), in code, in data colors as they load (`src/lib/api.ts`, never under /admin), in CSS (the `--pal-*` variables in `src/index.css`, which hold the same values as `SWAPS`: change both) and in the theme tokens drawn from them. A palette hex in a component or CSS file should be `var(--pal--)` (eg. `var(--pal-amber-2)`), or a color blind mode won't reach it. Reading mode is `src/components/ReaderView.tsx`, which reads the hidden page and writes out its headings, paragraphs, links and described pictures. A part it can't read well (a carousel, tabs, details behind a click, a map) draws its own text version when `useReadingMode()` (`src/lib/readingMode.ts`) is on: the hero, pathfinder, stats, history rail, event lists, calendar (the next six weeks), featured cards, org lists and groups map, history timeline, schedule, map block (its list alone), people tiles and video player; the countdown draws nothing. A new component with any of those should do the same. Something saved or sent (the newsletter's colors) is a stored hex, which is never swapped. |
| Privacy Policy and Terms wording | the database (082) | Admin → Pages → Page management → Privacy Policy or Terms of Service: their sections' blocks, and the "Last updated" date in the section's blurb whenever the wording changes. The privacy contact email is in the policy's text. The Privacy page must stay true of the code: what the feedback form stores, what the browser keeps, which embeds wait for a click. |
| Event type labels and plurals (public site) | `src/lib/eventTypes.ts` | Also the order of the type filter chips. |
| Event and person role labels (public site) | `ROLE_LABEL` in `src/pages/EventDetail.tsx` and `src/pages/PersonDetail.tsx` | |
diff --git a/server/src/admin-schema.js b/server/src/admin-schema.js
index 824c108..7378685 100644
--- a/server/src/admin-schema.js
+++ b/server/src/admin-schema.js
@@ -64,6 +64,7 @@ import { tags } from "./admin-schema/tags.js";
import { contactTypes } from "./admin-schema/contactTypes.js";
import { redirects } from "./admin-schema/redirects.js";
import { pages } from "./admin-schema/sitePages.js";
+import { venues } from "./admin-schema/venues.js";
export const ENTITIES = {
organizations,
@@ -73,6 +74,7 @@ export const ENTITIES = {
tags,
contact_types: contactTypes,
redirects,
+ venues,
teams,
awards,
timeline,
@@ -106,6 +108,15 @@ export const OPTION_QUERIES = {
contact_types: "SELECT id, name AS label FROM contact_types ORDER BY sort_order, name",
// Link fields with `redirects: true` pick from these (068).
redirects: "SELECT id, id || ' (' || target_url || ')' AS label FROM redirects ORDER BY id",
+ // A map block's venue; its locations ride along (as JSON) for a
+ // schedule's entries to pick from and for the block's preview.
+ venues: `
+ SELECT v.id, v.name AS label, v.map_image, v.map_alt,
+ (SELECT json_group_array(json_object('key', l.location_key, 'name', l.name, 'detail', l.detail,
+ 'x', l.x, 'y', l.y, 'w', l.w, 'h', l.h))
+ FROM (SELECT * FROM venue_locations WHERE venue_id = v.id ORDER BY sort_order) l) AS locations
+ FROM venues v
+ ORDER BY v.name`,
blog_posts: "SELECT id, title AS label FROM blog_posts ORDER BY published_on DESC, title",
// Navigation's Under page: a page by its address (080).
site_pages: "SELECT path AS id, title || ' (' || path || ')' AS label FROM site_pages ORDER BY sort_order, title",
diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js
index 3416e07..f15ffa7 100644
--- a/server/src/admin-schema/columns.js
+++ b/server/src/admin-schema/columns.js
@@ -154,6 +154,9 @@ export const blocksChild = (ownerKind) => ({
"people",
// A blog post's tab (079): its text is the tab's title.
"tab",
+ // A venue's map, and event cards (088).
+ "map",
+ "events",
],
{ required: true },
),
@@ -170,6 +173,8 @@ export const blocksChild = (ownerKind) => ({
int("word_seconds"),
// People blocks only (054): whose team's tiles to show.
text("team_id"),
+ // Map and schedule blocks (088): whose map and locations.
+ text("venue_id"),
],
children: [
{
@@ -198,6 +203,10 @@ export const blocksChild = (ownerKind) => ({
bool("featured"),
// The block's tags it has, by key, comma-separated (087).
text("tags"),
+ // A workshop or other event it is, and its place on the
+ // block's venue map (088).
+ text("event_id"),
+ text("location_key"),
],
children: [
{
@@ -223,6 +232,8 @@ export const blocksChild = (ownerKind) => ({
text("map_image"),
bool("featured"),
text("tags"),
+ text("event_id"),
+ text("location_key"),
],
},
],
diff --git a/server/src/admin-schema/venues.js b/server/src/admin-schema/venues.js
new file mode 100644
index 0000000..2525229
--- /dev/null
+++ b/server/src/admin-schema/venues.js
@@ -0,0 +1,44 @@
+import { text, real } from "./columns.js";
+
+/* ── Venues (088_venues.sql) ─────────────────────────────────────
+
+ A place we gather, with its map picture and the locations marked
+ on it. Map blocks draw it, and schedule entries link to its
+ locations. Its own entity because content_blocks.venue_id points
+ at it; nothing points at a location's row, entries name one by
+ location_key, so the locations can be replaced wholesale. */
+
+export const venues = {
+ key: "venues",
+ table: "venues",
+ idColumn: "id",
+ idKind: "slug",
+
+ list: {
+ columns: ["id", "name", "address"],
+ filters: [],
+ search: ["name", "id", "address"],
+ order: "name",
+ },
+
+ columns: [text("name", { required: true }), text("address"), text("map_image"), text("map_alt")],
+
+ children: [
+ {
+ key: "locations",
+ table: "venue_locations",
+ owner: { column: "venue_id" },
+ order: "sort_order",
+ columns: [
+ // Made by the admin as the row is added, so it isn't input.
+ text("location_key", { required: true, seeded: true }),
+ text("name", { required: true }),
+ text("detail"),
+ real("x"),
+ real("y"),
+ real("w"),
+ real("h"),
+ ],
+ },
+ ],
+};
diff --git a/server/src/migrations/088_venues.sql b/server/src/migrations/088_venues.sql
new file mode 100644
index 0000000..9be8b4c
--- /dev/null
+++ b/server/src/migrations/088_venues.sql
@@ -0,0 +1,125 @@
+-- ═══════════════════════════════════════════════════════════════
+-- 088 VENUES, MAP BLOCKS AND EVENT BLOCKS
+--
+-- Data → Venues: a place we gather (a camp, a church), with one map
+-- picture and its marked locations, each a pin (x, y) or a box
+-- (x, y, w, h), in percent of the picture from its top left.
+--
+-- A 'map' content block draws a venue's map with its locations
+-- listed beside it; a schedule block names a venue too, and its
+-- entries and sub-items pick one of its locations (location_key),
+-- which links to the map block on the same page, the location
+-- lit up. The venue's locations are rewritten on every save, so an
+-- entry names one by `location_key` (made in the admin when the
+-- location is added), as schedule tags do (087).
+--
+-- An 'events' content block shows events as cards, an item each
+-- (event_id); a schedule entry or sub-item can name an event too
+-- (a workshop), and takes what it leaves blank from it.
+--
+-- content_blocks.type's CHECK can't change in place, so the table
+-- is rebuilt (as in 079), then its index and owner trigger made
+-- again.
+-- ═══════════════════════════════════════════════════════════════
+
+CREATE TABLE venues (
+ id TEXT PRIMARY KEY
+ CONSTRAINT "A venue's URL ID can use only lowercase letters, numbers and hyphens, eg. camp-hebron."
+ CHECK (id <> '' AND id NOT GLOB '*[^a-z0-9-]*'),
+ name TEXT NOT NULL,
+ address TEXT,
+ map_image TEXT, -- an upload
+ map_alt TEXT
+) STRICT;
+
+CREATE TABLE venue_locations (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ venue_id TEXT NOT NULL REFERENCES venues (id) ON DELETE CASCADE,
+ sort_order INTEGER NOT NULL DEFAULT 0,
+ location_key TEXT NOT NULL,
+ name TEXT NOT NULL,
+ detail TEXT,
+ x REAL CHECK (x BETWEEN 0 AND 100),
+ y REAL CHECK (y BETWEEN 0 AND 100),
+ w REAL CHECK (w > 0 AND w <= 100), -- null: a pin
+ h REAL CHECK (h > 0 AND h <= 100),
+ UNIQUE (venue_id, location_key)
+) STRICT;
+
+ALTER TABLE content_block_items ADD COLUMN event_id TEXT
+ REFERENCES events (id) ON DELETE SET NULL;
+ALTER TABLE content_block_items ADD COLUMN location_key TEXT;
+ALTER TABLE content_block_subitems ADD COLUMN event_id TEXT
+ REFERENCES events (id) ON DELETE SET NULL;
+ALTER TABLE content_block_subitems ADD COLUMN location_key TEXT;
+
+CREATE TABLE content_blocks_new (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ owner_kind TEXT NOT NULL
+ CHECK (owner_kind IN ('organization', 'event', 'person', 'team', 'blog_post', 'page_section',
+ 'newsletter')),
+ owner_id TEXT NOT NULL,
+ slot TEXT NOT NULL DEFAULT 'body' CHECK (slot IN ('card', 'body', 'both')),
+ sort_order INTEGER NOT NULL DEFAULT 0,
+
+ type TEXT NOT NULL
+ CHECK (type IN ('heading', 'subheading', 'paragraph',
+ 'list', 'links', 'quote', 'image', 'divider',
+ 'video', 'button', 'callout', 'schedule', 'table', 'cards',
+ 'people', 'tab', 'map', 'events')),
+ text TEXT,
+ media TEXT,
+ href TEXT,
+ alt TEXT,
+ cite TEXT,
+ team_id TEXT REFERENCES teams (id) ON DELETE SET NULL,
+ captions TEXT,
+ word_motion TEXT CHECK (word_motion IN ('slide', 'flip', 'fade', 'type', 'mirror')),
+ word_direction TEXT CHECK (word_direction IN ('top', 'bottom')),
+ word_seconds INTEGER CHECK (word_seconds BETWEEN 1 AND 20),
+ -- Map and schedule blocks: whose map, and whose locations.
+ venue_id TEXT REFERENCES venues (id) ON DELETE SET NULL
+) STRICT;
+
+INSERT INTO content_blocks_new
+ (id, owner_kind, owner_id, slot, sort_order, type, text, media, href, alt, cite, team_id, captions,
+ word_motion, word_direction, word_seconds)
+SELECT id, owner_kind, owner_id, slot, sort_order, type, text, media, href, alt, cite, team_id, captions,
+ word_motion, word_direction, word_seconds
+ FROM content_blocks;
+
+PRAGMA legacy_alter_table = ON;
+DROP TABLE content_blocks;
+ALTER TABLE content_blocks_new RENAME TO content_blocks;
+PRAGMA legacy_alter_table = OFF;
+
+CREATE INDEX content_blocks_owner_idx
+ ON content_blocks (owner_kind, owner_id, slot, sort_order);
+
+CREATE TRIGGER content_blocks_owner_exists
+BEFORE INSERT ON content_blocks
+BEGIN
+ SELECT CASE
+ WHEN new.owner_kind = 'event'
+ AND NOT EXISTS (SELECT 1 FROM events WHERE id = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such event')
+ WHEN new.owner_kind = 'organization'
+ AND NOT EXISTS (SELECT 1 FROM organizations WHERE id = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such organization')
+ WHEN new.owner_kind = 'person'
+ AND NOT EXISTS (SELECT 1 FROM people WHERE id = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such person')
+ WHEN new.owner_kind = 'team'
+ AND NOT EXISTS (SELECT 1 FROM teams WHERE id = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such team')
+ WHEN new.owner_kind = 'blog_post'
+ AND NOT EXISTS (SELECT 1 FROM blog_posts WHERE id = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such blog post')
+ WHEN new.owner_kind = 'page_section'
+ AND NOT EXISTS (SELECT 1 FROM page_sections WHERE CAST(id AS TEXT) = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such page section')
+ WHEN new.owner_kind = 'newsletter'
+ AND NOT EXISTS (SELECT 1 FROM newsletters WHERE CAST(id AS TEXT) = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such newsletter')
+ END;
+END;
diff --git a/server/src/seed-showcase.js b/server/src/seed-showcase.js
index 07c8a77..7b6e776 100644
--- a/server/src/seed-showcase.js
+++ b/server/src/seed-showcase.js
@@ -79,6 +79,7 @@ const MEMBERS = ["showcase-member-1", "showcase-member-2", "showcase-member-3"];
const EVENT = "showcase-event";
const SERIES = "showcase-series";
const PAST = "showcase-past-event";
+const VENUE = "showcase-venue";
/* ── Content ───────────────────────────────────────────────── */
@@ -87,21 +88,24 @@ const PAST = "showcase-past-event";
a description, graphic and map, one linked, a heading, a featured
entry, a block with sub-items, a break, typed and picked times,
tags (one a tab of its own in its color, one with No tab), and one
- with no day (it lands in a tab of its own). */
+ with no day (it lands in a tab of its own). Its venue's locations
+ (088) are picked on some entries, one with no typed Location, and
+ one sub-item is the showcase workshop, filled in from it. */
const SCHEDULE = [
"schedule",
- { text: "The weekend at a glance. Tap an entry for more." },
+ { text: "The weekend at a glance. Tap an entry for more.", venue_id: VENUE },
[
{ day: "Friday", start_time: "16:00", text: "Arrivals and check-in", location: "Front desk", tags: "showcase-youth,showcase-all" },
{ day: "Friday", kind: "heading", text: "Evening", detail: "A heading across the day" },
- { day: "Friday", time: "7:00 to 8:30pm", text: "Opening session", location: "Main Hall", person_id: "showcase-person", detail: "Welcome and worship", description: "The **opening session** sets the theme for the weekend.\n\nBring a notebook.", media: "/uploads/showcase.jpg", map: "Camp Hebron, Halifax PA", map_image: "/uploads/showcase.jpg" },
+ { day: "Friday", time: "7:00 to 8:30pm", text: "Opening session", location_key: "hall", person_id: "showcase-person", detail: "Welcome and worship", description: "The **opening session** sets the theme for the weekend.\n\nBring a notebook.", media: "/uploads/showcase.jpg", map: "Camp Hebron, Halifax PA", map_image: "/uploads/showcase.jpg" },
{ day: "Saturday", start_time: "08:00", end_time: "09:00", kind: "break", text: "Breakfast", location: "Dining hall" },
{ day: "Saturday", start_time: "09:00", end_time: "10:30", kind: "block", text: "Workshops", location: "Classrooms", detail: "Pick one of three", items: [
- { start_time: "09:00", end_time: "09:45", text: "Leading worship", location: "Room A", person_id: "showcase-member-2", url: "/blog/content-block-showcase" },
+ { start_time: "09:00", end_time: "09:45", text: "Leading worship", location: "Room A", location_key: "rooma", person_id: "showcase-member-2", url: "/blog/content-block-showcase" },
+ { start_time: "09:00", end_time: "09:45", text: "Showcase Past Workshop", event_id: PAST, location_key: "rooma" },
{ start_time: "09:00", end_time: "09:45", text: "Speaking with confidence", location: "Room B", featured: 1, tags: "showcase-youth", description: "A featured sub-item that folds out." },
{ time: "After the first round", text: "Open questions", location: "Room C" },
] },
- { day: "Saturday", start_time: "19:00", featured: 1, tags: "showcase-youth", text: "Talent night", location: "Main Hall", person_id: "showcase-member-3", description: "Sign up at the front desk by noon." },
+ { day: "Saturday", start_time: "19:00", featured: 1, tags: "showcase-youth", text: "Talent night", location: "Main Hall", location_key: "hall", person_id: "showcase-member-3", description: "Sign up at the front desk by noon." },
{ day: "Sunday", time: "10:00am", text: "Closing service", location: "Chapel", map: "Main Street, Halifax PA" },
{ time: "Any time", text: "Quiet room open", location: "Library", detail: "An entry with no day" },
],
@@ -141,6 +145,13 @@ const ALL_BLOCKS = [
["image", { media: IMAGE, alt: "The same picture, linked", href: "/history" }],
["subheading", { text: "Schedule" }],
SCHEDULE,
+ ["subheading", { text: "Map" }],
+ ["map", { venue_id: VENUE }],
+ ["subheading", { text: "Events" }],
+ ["events", {}, [
+ { event_id: PAST, text: "Showcase Past Workshop" },
+ { event_id: "showcase-event", text: "A card with its own title", detail: "And its own text in place of the event's." },
+ ]],
["subheading", { text: "Video" }],
["video", { href: "https://www.youtube.com/watch?v=dQw4w9WgXcQ", text: "A YouTube video, with its own thumbnail" }],
["video", { href: "https://vimeo.com/76979871", media: IMAGE, text: "A Vimeo video with an uploaded still" }],
@@ -255,6 +266,7 @@ tx(db, () => {
db.prepare(`DELETE FROM awards WHERE id LIKE 'showcase-%'`).run();
db.prepare(`DELETE FROM affiliations WHERE person_id LIKE 'showcase-%' OR org_id LIKE 'showcase-%'`).run();
db.prepare(`DELETE FROM teams WHERE id LIKE 'showcase-%'`).run();
+ db.prepare(`DELETE FROM venues WHERE id LIKE 'showcase-%'`).run();
db.prepare(`DELETE FROM people WHERE id LIKE 'showcase-%'`).run();
db.prepare(`DELETE FROM organizations WHERE id = ?`).run(GROUP);
db.prepare(`DELETE FROM organizations WHERE id LIKE 'showcase-%'`).run();
@@ -412,7 +424,6 @@ tx(db, () => {
{ kind: "social", platform: "instagram", label: "@showcaseretreat", url: "https://instagram.com/showcaseretreat" },
]);
blocks("event", EVENT, "both", cardText("event"));
- blocks("event", EVENT, "body", [...pageBody("event"), ["heading", { text: "Schedule" }], SCHEDULE]);
insert("events", {
id: SERIES,
@@ -458,6 +469,23 @@ tx(db, () => {
insert("event_people", { event_id: PAST, person_id: PERSON, role: "host", is_public: 1, sort_order: 0 });
blocks("event", PAST, "card", cardText("past event"));
+ /* ── Venue (088): a pin, a box and an unmarked location ── */
+ insert("venues", { id: VENUE, name: "Showcase Retreat Center", address: "123 Example Road, Exampletown PA", map_image: IMAGE });
+ [
+ { location_key: "hall", name: "Main Hall", detail: "Sessions and talent night", x: 30, y: 40 },
+ { location_key: "rooma", name: "Room A", detail: "Workshops", x: 55, y: 20, w: 25, h: 30 },
+ { location_key: "desk", name: "Front desk", detail: "Not marked on the map" },
+ ].forEach((location, i) => insert("venue_locations", { venue_id: VENUE, sort_order: i, ...location }));
+
+ // The retreat's page, after the workshop and venue its schedule names.
+ blocks("event", EVENT, "body", [
+ ...pageBody("event"),
+ ["heading", { text: "Schedule" }],
+ SCHEDULE,
+ ["heading", { text: "Map" }],
+ ["map", { venue_id: VENUE }],
+ ]);
+
/* ── Award ── */
insert("awards", {
id: AWARD,
diff --git a/server/src/shape.js b/server/src/shape.js
index aee9313..721ab11 100644
--- a/server/src/shape.js
+++ b/server/src/shape.js
@@ -70,7 +70,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") {
const blockRows = db
.prepare(
- `SELECT id, owner_id, type, text, media, href, alt, cite, captions, team_id,
+ `SELECT id, owner_id, type, text, media, href, alt, cite, captions, team_id, venue_id,
word_motion, word_direction, word_seconds
FROM content_blocks
WHERE owner_kind = ? AND slot IN (?, 'both') AND owner_id IN (${placeholders(ids.length)})
@@ -92,6 +92,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") {
cite: row.cite,
captions: row.captions,
team_id: row.team_id,
+ venue_id: row.venue_id,
// Its rotating words' motion (084), when it has its own.
words: row.word_motion || row.word_direction || row.word_seconds
? { motion: row.word_motion, direction: row.word_direction, seconds: row.word_seconds }
@@ -109,6 +110,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") {
const ENTRY_FIELDS = `i.text, i.detail, i.url, i.start_time, i.end_time, i.time, i.location,
i.description, i.media, i.media_alt, i.map, i.map_image, i.featured, i.tags,
+ i.event_id, i.location_key,
p.id AS person_id, p.display_name AS person_name,
p.photo AS person_photo, p.tagline AS person_tagline`;
@@ -172,9 +174,107 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") {
block.items.forEach(cut);
}
+ attachVenues(db, [...byId.values()]);
+ attachEvents(db, [...byId.values()]);
+
return out;
}
+/* A map or schedule block's venue (088), its locations in order,
+ and each entry's location_key made its place on it: `place` is
+ the location, and the location's name stands in for a blank
+ typed Location. A key the venue no longer has is dropped. */
+function attachVenues(db, blocks) {
+ const ids = [...new Set(blocks.map((block) => block.venue_id).filter(Boolean))];
+ if (ids.length === 0) return;
+ const venues = new Map(
+ db
+ .prepare(`SELECT id, name, address, map_image, map_alt FROM venues WHERE id IN (${placeholders(ids.length)})`)
+ .all(...ids)
+ .map((row) => [row.id, { ...row, locations: [] }]),
+ );
+ const locationRows = db
+ .prepare(
+ `SELECT venue_id, location_key AS key, name, detail, x, y, w, h
+ FROM venue_locations
+ WHERE venue_id IN (${placeholders(ids.length)})
+ ORDER BY venue_id, sort_order`,
+ )
+ .all(...ids);
+ for (const { venue_id, ...location } of locationRows) venues.get(venue_id)?.locations.push(location);
+
+ for (const block of blocks) {
+ const venue = venues.get(block.venue_id);
+ block.venue = venue ?? null;
+ const place = (entry) => {
+ const location = venue?.locations.find((l) => l.key === entry.location_key) ?? null;
+ entry.place = location ? { venue_id: venue.id, key: location.key, name: location.name } : null;
+ if (location && !entry.location) entry.location = location.name;
+ entry.items?.forEach(place);
+ };
+ block.items.forEach(place);
+ }
+}
+
+/* The events named by items (088): an events block's cards, and a
+ schedule entry or sub-item that is a workshop, which takes what
+ it leaves blank from its event: the link, the description (its
+ card text), the graphic (its photo) and the person (a person
+ host). An unpublished event is no event. */
+function attachEvents(db, blocks) {
+ const entries = [];
+ const walk = (entry) => {
+ entries.push(entry);
+ entry.items?.forEach(walk);
+ };
+ blocks.forEach((block) => block.items.forEach(walk));
+ const ids = [...new Set(entries.map((entry) => entry.event_id).filter(Boolean))];
+ if (ids.length === 0) return;
+
+ const rows = db
+ .prepare(
+ `SELECT e.id, e.title, e.tagline, e.event_type, e.starts_on, e.ends_on, e.date_label,
+ e.effective_color AS color, COALESCE(e.card_image, e.photo) AS image, e.photo_alt,
+ p.id AS person_id, p.display_name AS person_name, p.photo AS person_photo,
+ p.tagline AS person_tagline
+ FROM v_events e
+ LEFT JOIN v_people_public p ON e.host_kind = 'person' AND p.id = e.host_id AND p.is_published = 1
+ WHERE e.is_published = 1 AND e.id IN (${placeholders(ids.length)})`,
+ )
+ .all(...ids);
+ const cards = loadBlocks(db, "event", rows.map((row) => row.id), "card");
+ const events = new Map(rows.map((row) => [row.id, row]));
+
+ for (const entry of entries) {
+ const row = events.get(entry.event_id);
+ if (!row) {
+ entry.event = null;
+ continue;
+ }
+ const blurb = paragraphs(cards.get(row.id) ?? []).join("\n\n") || row.tagline || null;
+ entry.event = {
+ id: row.id,
+ title: row.title,
+ event_type: row.event_type,
+ starts_on: row.starts_on,
+ ends_on: row.ends_on,
+ date_label: row.date_label,
+ color: row.color,
+ image: row.image,
+ blurb,
+ };
+ entry.url ||= `/events/${row.id}`;
+ entry.description ||= blurb;
+ if (!entry.media && row.image) {
+ entry.media = row.image;
+ entry.media_alt = row.photo_alt;
+ }
+ if (!entry.person && row.person_id) {
+ entry.person = { id: row.person_id, name: row.person_name, photo: row.person_photo, tagline: row.person_tagline };
+ }
+ }
+}
+
/* A schedule entry or sub-item as the page gets it. `time` is what
to show: the typed override, else the picked times (086). An
unpublished person comes back as no person. */
@@ -194,6 +294,8 @@ function scheduleEntry(row) {
map_image: row.map_image,
featured: row.featured === 1,
tags: row.tags ? row.tags.split(",").filter(Boolean) : [],
+ event_id: row.event_id,
+ location_key: row.location_key,
person: row.person_id
? {
id: row.person_id,
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index 4d9299e..eb4f2a5 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -30,6 +30,12 @@
people team_id's members as people tiles, then
items as more tiles: person, text their
title (an unpublished person is left out)
+ map venue: its map, locations marked and
+ listed (MapBlock); a schedule's places
+ link to it
+ events items as event cards: event (from
+ event_id), text the title shown, detail
+ in place of the event's card text
divider nothing
"Formatted" is InlineText.tsx: **bold**, *italic*, [text](url),
@@ -50,6 +56,9 @@ import type { ContentBlock, ContentBlockItem } from '../lib/useContent.ts'
import { Anchor, Inline, Paragraphs, isExternalUrl } from './InlineText.tsx'
import VideoPlayer from './VideoPlayer.tsx'
import ScheduleBlock from './ScheduleBlock.tsx'
+import MapBlock, { PageMaps } from './MapBlock.tsx'
+import { eventHref } from '../lib/hrefs.ts'
+import { occurrenceLabel } from '../lib/eventSeries.ts'
import { accentText, BRAND } from '../lib/color.ts'
import { headingAnchors } from '../lib/contents.ts'
import { SITE_NAME } from '../lib/site.ts'
@@ -94,7 +103,11 @@ export default function ContentBlocks({
presentAt && block.type === 'schedule' ? `${presentAt}?block=${schedules++}` : undefined,
)
+ // The venues mapped here, for a schedule's places to link to.
+ const maps = new Set(blocks.flatMap((block) => (block.type === 'map' && block.venue ? [block.venue.id] : [])))
+
return (
+
{blocks.map((block, index) => (
@@ -108,6 +121,7 @@ export default function ContentBlocks({
))}
+
)
}
@@ -144,6 +158,40 @@ function LinkCard({ item }: { item: ContentBlockItem }) {
)
}
+/* One event card (088): the event's picture, its type and date,
+ its title (or the item's text) and card text (or the item's
+ detail); the whole card links to the event. */
+function EventCard({ item, accent }: { item: ContentBlockItem; accent: string }) {
+ const event = item.event!
+ const img = useSmallImage(mediaUrl(event.image))
+ const color = event.color || accent
+ const when = event.date_label || (event.starts_on ? occurrenceLabel(event.starts_on) : null)
+ const kind = event.event_type && event.event_type !== 'other' ? event.event_type : null
+ return (
+
+ {!img.failed && (
+
+ )}
+
+ {(kind || when) && (
+
+ {[kind, when].filter(Boolean).join(' · ')}
+
+ )}
+
+ {item.text || event.title}
+
+ {(item.detail || event.blurb) && (
+ {item.detail || event.blurb}
+ )}
+
+
+ )
+}
+
/* A table block's text as rows of cells: one row per line, cells
split by "|" (a literal bar is "\|"), blank lines skipped. A
leading and trailing bar, as in Markdown, is allowed. */
@@ -395,6 +443,24 @@ function Block({
/>
)
+ case 'map':
+ if (!block.venue) return null
+ return
+
+ case 'events': {
+ const events = (block.items ?? []).filter((item) => item.event)
+ if (events.length === 0) return null
+ return (
+
+ {events.map((item, i) => (
+
+
+
+ ))}
+
+ )
+ }
+
case 'people': {
const picked = (block.items ?? [])
.filter((item) => item.person)
diff --git a/src/components/MapBlock.tsx b/src/components/MapBlock.tsx
new file mode 100644
index 0000000..25728bd
--- /dev/null
+++ b/src/components/MapBlock.tsx
@@ -0,0 +1,155 @@
+/* ═══════════════════════════════════════════════════════════════
+ MAP BLOCK
+
+ The 'map' content block (088): a venue's map picture with its
+ locations marked on it, each a numbered pin or a box, and the
+ locations listed beside it (under it on a phone).
+
+ One picture, the marks drawn over it in percent of its size, so
+ they stay on their places at any width. A location is lit up
+ (in the accent, the rest dimmed) while its row or mark is hovered
+ or focused, and when the address points at it: #map--,
+ the link a schedule entry's place makes (mapAnchor). That id is
+ the mark's own, so Layout's jump to the anchor scrolls it into
+ view and focuses it.
+
+ Reading mode (readingMode.ts) gets the list alone, no picture.
+
+ PageMaps holds the venues that have a map block among the blocks
+ drawn together (ContentBlocks), so a schedule's places link only
+ when there's a map on the page to go to.
+ ═══════════════════════════════════════════════════════════════ */
+
+import { createContext, useState } from 'react'
+import { Link, useLocation } from 'react-router-dom'
+
+import { mediaUrl } from '../lib/media.ts'
+import type { Venue, VenueLocation } from '../lib/useContent.ts'
+import { accentText, readableOn, withAlpha } from '../lib/color.ts'
+import { useReadingMode } from '../lib/readingMode.ts'
+
+export const PageMaps = createContext>(new Set())
+
+export const mapAnchor = (venueId: string, key: string) => `map-${venueId}-${key}`
+
+const isBox = (location: VenueLocation) => location.w != null && location.h != null
+
+export default function MapBlock({ venue, accent }: { venue: Venue; accent: string }) {
+ const { hash, search } = useLocation()
+ const [hovered, setHovered] = useState(null)
+ const marked = venue.locations.filter((location) => location.x != null && location.y != null)
+ const fromHash = venue.locations.find((location) => hash === `#${mapAnchor(venue.id, location.key)}`)?.key ?? null
+ const active = hovered ?? fromHash
+ const image = useReadingMode() ? null : mediaUrl(venue.map_image)
+ const fill = accent.startsWith('#') ? accent : '#000000'
+
+ const to = (key: string) => ({ search, hash: mapAnchor(venue.id, key) })
+ const light = (key: string) => ({
+ onMouseEnter: () => setHovered(key),
+ onMouseLeave: () => setHovered(null),
+ onFocus: () => setHovered(key),
+ onBlur: () => setHovered(null),
+ })
+ const number = (location: VenueLocation) => venue.locations.indexOf(location) + 1
+
+ return (
+
+ {image && (
+
+
+ {marked.map((location) => {
+ const on = active === location.key
+ const dim = active != null && !on
+ return (
+
+
+ {number(location)}
+
+ {on && (
+
+ {location.name}
+
+ )}
+
+ )
+ })}
+
+ )}
+
+
+ {venue.name}
+ {venue.address && {venue.address}
}
+
+ {venue.locations.map((location) => {
+ const on = active === location.key
+ const row = (
+ <>
+
+ {number(location)}
+
+
+
+ {location.name}
+
+ {location.detail && {location.detail} }
+
+ >
+ )
+ const rowClass = 'flex items-start gap-3 px-2 py-1.5 text-body'
+ const rowStyle = on ? { background: withAlpha(accent, 12) } : undefined
+ return (
+
+ {location.x != null && location.y != null ? (
+
+ {row}
+
+ ) : (
+ {row}
+ )}
+
+ )
+ })}
+
+
+
+ )
+}
diff --git a/src/components/ScheduleBlock.tsx b/src/components/ScheduleBlock.tsx
index ef7a5a2..7a65b96 100644
--- a/src/components/ScheduleBlock.tsx
+++ b/src/components/ScheduleBlock.tsx
@@ -32,6 +32,12 @@
day's name. A tagged entry comes whole; an untagged block comes
with only its tagged sub-items. A tag on nothing draws no tab.
+ An entry's place on the block's venue (088) links to the map
+ block on the same page, the location lit up there (MapBlock);
+ with no map of that venue on the page it's plain text. An entry
+ that is an event (a workshop) has already taken what it left
+ blank from it (shape.js).
+
On an event page a Present button opens the schedule as a
slideshow for a screen (SchedulePresent.tsx).
@@ -42,9 +48,9 @@
it, no map frame (ReadingSchedule).
═══════════════════════════════════════════════════════════════ */
-import { CaretDown, Presentation, Star } from '@phosphor-icons/react'
+import { CaretDown, MapPin, Presentation, Star } from '@phosphor-icons/react'
import { Fragment, createContext, useContext, useId, useState, type KeyboardEvent, type ReactNode } from 'react'
-import { Link } from 'react-router-dom'
+import { Link, useLocation } from 'react-router-dom'
import { personHref } from '../lib/hrefs.ts'
import { mediaUrl, initials } from '../lib/media.ts'
@@ -54,6 +60,7 @@ import { withAlpha, accentText, readableOn } from '../lib/color.ts'
import { useSmallImage } from '../lib/useSmallImage.ts'
import { focusOnMount } from '../lib/focus.ts'
import { useReadingMode } from '../lib/readingMode.ts'
+import { PageMaps, mapAnchor } from './MapBlock.tsx'
const BODY = 'var(--color-muted)'
const WEEKDAYS = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']
@@ -136,6 +143,26 @@ function todayIndex(days: Day[]): number {
return found >= 0 ? found : 0
}
+/* An entry's location, linked to its place on a map block on the
+ page when there is one (088). */
+function Place({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
+ const maps = useContext(PageMaps)
+ const { search } = useLocation()
+ if (!entry.location) return null
+ if (!entry.place || !maps.has(entry.place.venue_id)) return {entry.location}
+ return (
+
+
+ {entry.location}
+ , on the map
+
+ )
+}
+
/* An entry's own map image says what it maps. */
export const mapAlt = (entry: ContentBlockItem) => `Map: ${entry.map?.trim() || entry.location || entry.text}`
@@ -240,7 +267,7 @@ function Entry({ entry, accent, sub = false }: { entry: ContentBlockItem; accent
{(entry.location || entry.person) && (
- {entry.location && {entry.location} }
+
{entry.person && (
diff --git a/src/components/admin/MapMarkerInput.tsx b/src/components/admin/MapMarkerInput.tsx
new file mode 100644
index 0000000..7ae0a8f
--- /dev/null
+++ b/src/components/admin/MapMarkerInput.tsx
@@ -0,0 +1,130 @@
+/* A venue location's mark on the venue's map (088), for the
+ `mapMarker` widget (fields.tsx): click the picture for a pin, drag
+ for a box. Saved as x, y (and w, h for a box) in percent of the
+ picture from its top left, one decimal, through onPatch. The
+ numbers under it set the same thing by keyboard. */
+
+import { useRef, useState, type PointerEvent } from "react";
+
+type Mark = { x: number | null; y: number | null; w: number | null; h: number | null };
+
+const round = (n: number) => Math.round(Math.min(100, Math.max(0, n)) * 10) / 10;
+// Moved less than this (percent) between press and release: a click.
+const CLICK = 1.5;
+
+export default function MapMarkerInput({ image, row, locked, onPatch }: any) {
+ const box = useRef(null);
+ const [drag, setDrag] = useState<{ x0: number; y0: number; x1: number; y1: number } | null>(null);
+ const mark: Mark = { x: row.x ?? null, y: row.y ?? null, w: row.w ?? null, h: row.h ?? null };
+
+ const at = (e: PointerEvent) => {
+ const r = box.current!.getBoundingClientRect();
+ return { x: round(((e.clientX - r.left) / r.width) * 100), y: round(((e.clientY - r.top) / r.height) * 100) };
+ };
+
+ const up = (e: PointerEvent) => {
+ if (!drag) return;
+ const { x, y } = at(e);
+ setDrag(null);
+ if (Math.abs(x - drag.x0) < CLICK && Math.abs(y - drag.y0) < CLICK) {
+ onPatch({ x: drag.x0, y: drag.y0, w: null, h: null });
+ } else {
+ onPatch({
+ x: Math.min(x, drag.x0),
+ y: Math.min(y, drag.y0),
+ w: round(Math.abs(x - drag.x0)),
+ h: round(Math.abs(y - drag.y0)),
+ });
+ }
+ };
+
+ const shown = drag
+ ? {
+ x: Math.min(drag.x0, drag.x1),
+ y: Math.min(drag.y0, drag.y1),
+ w: Math.abs(drag.x1 - drag.x0),
+ h: Math.abs(drag.y1 - drag.y0),
+ }
+ : mark;
+
+ const number = (key: keyof Mark, label: string) => (
+
+ {label}
+ onPatch({ [key]: e.target.value === "" ? null : round(Number(e.target.value)) })}
+ className="w-20 border border-muted/25 bg-surface px-2 py-1 text-body"
+ />
+
+ );
+
+ return (
+
+ {image ? (
+
{
+ if (locked) return;
+ e.currentTarget.setPointerCapture(e.pointerId);
+ const { x, y } = at(e);
+ setDrag({ x0: x, y0: y, x1: x, y1: y });
+ }}
+ onPointerMove={(e) => drag && setDrag({ ...drag, x1: at(e).x, y1: at(e).y })}
+ onPointerUp={up}
+ >
+
+ {shown.x != null && shown.y != null && (
+
+ )}
+
+ ) : (
+
Add the venue's map above, then mark this location on it.
+ )}
+
+ {number("x", "Left %")}
+ {number("y", "Top %")}
+ {number("w", "Width %")}
+ {number("h", "Height %")}
+ {mark.x != null && !locked && (
+ onPatch({ x: null, y: null, w: null, h: null })}
+ className="text-link hover:underline"
+ >
+ Clear mark
+
+ )}
+
+
+ );
+}
diff --git a/src/components/admin/fields.tsx b/src/components/admin/fields.tsx
index b80c2fc..8ff6ebe 100644
--- a/src/components/admin/fields.tsx
+++ b/src/components/admin/fields.tsx
@@ -77,6 +77,15 @@
Data → Links/redirects (the `redirects` options) that fills the
field with the short link's full address, /go/.
+ `fills: "text"` on a select fills that field of the row, while
+ it's empty, with the picked option's label.
+
+ `widget: "mapMarker"` (on `x`) marks a venue's location on the
+ map picture its parent row holds in `imageFrom`: a click is a
+ pin (x, y), a drag a box (x, y, w, h), in percent (MapMarkerInput
+ below). `lends` gets the form's options too, so a block can lend
+ its venue's locations from the venues list.
+
`widget: "testNotice"` is a text box of email addresses with a
"Send a test notice" button (TestNoticeInput below), for Site
settings → Notices.
@@ -114,6 +123,9 @@ import ContentBlocks from "../ContentBlocks.tsx";
import { FILTER_FROM, OptionFilter, narrow } from "../OptionFilter.tsx";
import { ImageInput, LinkPreviewInput } from "./MediaLibrary.tsx";
import { ChooseFileButton } from "./DriveFiles.tsx";
+import MapMarkerInput from "./MapMarkerInput.tsx";
+import { venueFromOption } from "../../lib/adminSchema/shared.ts";
+import { mediaUrl } from "../../lib/media.ts";
import { siteUrl } from "../../lib/site.ts";
/* Live previews a collection can name with `preview`. Each gets the
@@ -122,21 +134,25 @@ const PREVIEWS = {
// The form holds an entry's person as person_id; the renderer wants
// the person, so it's looked up in the select options (a name, no
// photo: the options carry no more).
- contentBlock: (row, options) => (
- {
- const person = item.person_id
- ? options?.people?.find((p) => p.id === item.person_id)
- : null;
- return { ...item, person: person ? { id: person.id, name: person.label } : null };
- }),
- },
- ]}
- />
- ),
+ // A venue and an item's event and map location come from the
+ // options the same way (088): an event as its title only.
+ contentBlock: (row, options) => {
+ const venue = venueFromOption(options?.venues?.find((v) => v.id === row.venue_id));
+ const shape = (item) => {
+ const person = item.person_id ? options?.people?.find((p) => p.id === item.person_id) : null;
+ const event = item.event_id ? options?.events?.find((e) => e.id === item.event_id) : null;
+ const location = venue?.locations.find((l) => l.key === item.location_key);
+ return {
+ ...item,
+ person: person ? { id: person.id, name: person.label } : null,
+ event: event ? { id: event.id, title: event.label } : null,
+ place: location ? { venue_id: venue!.id, key: location.key, name: location.name } : null,
+ location: item.location || location?.name,
+ items: (item.items ?? []).map(shape),
+ };
+ };
+ return ;
+ },
};
const input =
@@ -282,7 +298,7 @@ function Checklist({ id, options, value, disabled, empty, onChange }: {
/* ── Field ───────────────────────────────────────────────────── */
-export function Field({ field, value, row, options, error, onChange, onPatch }: any) {
+export function Field({ field, value, row, parentRow, options, error, onChange, onPatch }: any) {
const id = `f-${field.path.replace(/\./g, "-")}`;
const widget = field.widget ?? "text";
// readOnly may be a test of the row (a core page's address).
@@ -397,6 +413,14 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
)}
{
+ // `fills`: a pick also fills that empty field of the
+ // row with the option's label (a workshop's title).
+ const picked = e.target.value;
+ const label = list?.find(([optionId]) => String(optionId) === picked)?.[1];
+ if (field.fills && picked && !row?.[field.fills] && onPatch) onPatch({ [field.path]: picked, [field.fills]: label });
+ else onChange(picked);
+ }}
disabled={locked}
className={`${locked ? inputLocked : common.className} ${
orphaned && !locked ? inputError : ""
@@ -440,6 +464,13 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
onChange={onChange}
onPatch={onPatch}
/>
+ ) : widget === "mapMarker" ? (
+
) : widget === "testNotice" ? (
= {
organizations,
@@ -42,6 +43,7 @@ export const ADMIN_ENTITIES: Record = {
tags,
contact_types: contactTypes,
redirects,
+ venues,
teams,
awards,
timeline,
diff --git a/src/lib/adminSchema/shared.ts b/src/lib/adminSchema/shared.ts
index 33c0cb8..cf1fddb 100644
--- a/src/lib/adminSchema/shared.ts
+++ b/src/lib/adminSchema/shared.ts
@@ -309,6 +309,8 @@ export const BLOCK_TYPES = [
["table", "Table", "A grid of text, eg. a comparison chart: one row per line, cells split by |, the first row the header."],
["cards", "Link cards", "Cards with a picture, title and description, each a link to a page or a file, like a link shared in a chat; up to three in a row. Paste a link and press Fetch preview, or Choose a file."],
["people", "People", "People tiles: a team's members, or people picked one by one as items (each with their title), or both."],
+ ["map", "Map", "A venue's map with its locations marked and listed beside it (Data → Venues). A schedule on the same page with the same venue links its locations here."],
+ ["events", "Events", "Event cards, eg. the workshops on offer: picture, type, date, title and card text, each linking to the event's page."],
["divider", "Divider", "A thin line between parts."],
];
@@ -336,6 +338,42 @@ export const CARD_ITEM = { scope: "parent", path: "type", value: "cards" };
export const NOT_CARD_ITEM = { scope: "parent", path: "type", value: ["list", "links", "schedule"] };
/* An item that's a person on a people block. */
export const PEOPLE_ITEM = { scope: "parent", path: "type", value: "people" };
+/* An item that's an event card on an events block (088). */
+export const EVENT_ITEM = { scope: "parent", path: "type", value: "events" };
+
+/* A venues option (the /admin/options query) as a Venue: its
+ locations arrive as JSON. */
+export const venueFromOption = (option) =>
+ option
+ ? {
+ id: option.id,
+ name: option.label,
+ map_image: option.map_image,
+ map_alt: option.map_alt,
+ locations: JSON.parse(option.locations || "[]"),
+ }
+ : null;
+
+/* A schedule entry's or sub-item's workshop and place (088). */
+const eventField = (when?: any) => ({
+ path: "event_id",
+ label: "Event",
+ widget: "select",
+ optionsFrom: "events",
+ fills: "text",
+ blankLabel: "Default: none",
+ help: "Optional: a workshop or other event this is. Its title fills an empty Title; its card text, photo, person host and page fill what's left blank here.",
+ when,
+});
+const placeField = (when?: any) => ({
+ path: "location_key",
+ label: "Map location",
+ widget: "select",
+ optionsFrom: "mapLocations",
+ blankLabel: "Default: none",
+ help: "One of the block's venue's locations (the block's Venue, Data → Venues). Links to the map on the page and fills an empty Location.",
+ when,
+});
export const blockTypeLabel = (type) => BLOCK_TYPES.find(([value]) => value === type)?.[1] ?? type;
@@ -417,8 +455,10 @@ const TAGS_FIELD = {
block's day. */
const SUB_ITEM_FIELDS = [
...scheduleTimeFields(),
+ eventField(),
{ path: "text", label: "Title", required: true },
- { path: "location", label: "Location", help: "eg. Room B" },
+ placeField(),
+ { path: "location", label: "Location", help: "eg. Room B. Default: the map location's name" },
{
path: "person_id",
label: "Person",
@@ -546,13 +586,29 @@ export const blocksChild = {
help: "Shows the team's members as tiles, its leads first. People added as items show after it.",
when: { path: "type", value: "people" },
},
+ {
+ path: "venue_id",
+ label: "Venue",
+ widget: "select",
+ optionsFrom: "venues",
+ blankLabel: "Default: none",
+ help: (row) =>
+ row?.type === "map"
+ ? "Whose map to show (Data → Venues). Without one the block shows nothing."
+ : "Optional: the venue whose locations entries pick from (Data → Venues). With a Map block of it on the page, they link to it.",
+ when: { path: "type", value: ["map", "schedule"] },
+ },
...wordFields("", "", { path: "type", value: ["heading", "subheading", "paragraph", "callout", "quote"] }),
],
// A schedule's tags, for its entries' and sub-items' Tags (087).
- lends: (row) => ({
+ lends: (row, options) => ({
scheduleTags: (row.tags ?? [])
.filter((tag) => tag.name?.trim())
.map((tag) => ({ id: tag.tag_key, label: tag.name })),
+ // Its venue's locations, for entries' Map location (088).
+ mapLocations: (venueFromOption(options?.venues?.find((v) => v.id === row.venue_id))?.locations ?? []).map(
+ (location) => ({ id: location.key, label: location.name }),
+ ),
}),
children: [
{
@@ -573,7 +629,7 @@ export const blocksChild = {
key: "items",
label: "Items",
addLabel: "Add item",
- when: { path: "type", value: ["list", "links", "schedule", "cards", "people"] },
+ when: { path: "type", value: ["list", "links", "schedule", "cards", "people", "events"] },
title: (row) => [row.day, row.time || row.start_time, row.text].filter(Boolean).join(" · ") || "New item",
blank: { text: "" },
fields: [
@@ -613,11 +669,28 @@ export const blocksChild = {
help: "Shown as a tile with their photo, linked to their page",
when: PEOPLE_ITEM,
},
- { path: "text", label: "Text", required: true, help: "Schedules: the entry's title. Cards: the card's title. People: their title on the tile, eg. Speaker" },
+ {
+ path: "event_id",
+ label: "Event",
+ widget: "select",
+ optionsFrom: "events",
+ fills: "text",
+ required: true,
+ help: "The event the card shows and links to. An unpublished one is left out.",
+ when: EVENT_ITEM,
+ },
+ eventField(SCHEDULE_ENTRY),
+ {
+ path: "text",
+ label: "Text",
+ required: true,
+ help: "Schedules: the entry's title. Cards: the card's title. Events: the title shown, filled from the event. People: their title on the tile, eg. Speaker",
+ },
+ placeField(SCHEDULE_ENTRY),
{
path: "location",
label: "Location",
- help: "eg. Main Hall",
+ help: "eg. Main Hall. Default: the map location's name",
when: SCHEDULE_ENTRY,
},
{
@@ -631,6 +704,7 @@ export const blocksChild = {
},
{ path: "detail", label: "Detail", help: "A line under the text. Lists: shown after the text", when: NOT_CARD_ITEM },
{ path: "detail", label: "Description", widget: "textarea", full: true, when: CARD_ITEM },
+ { path: "detail", label: "Card text", widget: "textarea", full: true, help: "Default: the event's card text", when: EVENT_ITEM },
{ path: "url", label: "URL", help: "Blank for plain text. Link buttons need one.", files: true, when: NOT_CARD_ITEM },
{
path: "media",
diff --git a/src/lib/adminSchema/venues.ts b/src/lib/adminSchema/venues.ts
new file mode 100644
index 0000000..5b05189
--- /dev/null
+++ b/src/lib/adminSchema/venues.ts
@@ -0,0 +1,72 @@
+/* ── Venues (088_venues.sql) ─────────────────────────────────────
+ Data → Venues: a place we gather, with one map picture and the
+ locations marked on it (a pin or a box each). A Map content block
+ draws it; a schedule block names it, and its entries pick one of
+ its locations, linking to the map. Server side:
+ server/src/admin-schema/venues.js. */
+
+import { mediaUrl } from "../media.ts";
+
+export const venues = {
+ key: "venues",
+ label: "Venues",
+ singular: "venue",
+ idLabel: "URL ID",
+ slugFrom: "name",
+
+ list: {
+ columns: [
+ { key: "name", label: "Name", primary: true },
+ { key: "address", label: "Address" },
+ ],
+ filters: [],
+ },
+
+ groups: [
+ {
+ legend: "Venue",
+ fields: [
+ { path: "name", label: "Name", required: true, help: "eg. Camp Hebron" },
+ { path: "address", label: "Address", help: "Shown over the list of locations. Optional." },
+ {
+ path: "map_image",
+ label: "Map",
+ widget: "image",
+ crop: "free",
+ resolve: mediaUrl,
+ full: true,
+ help: "One picture of the whole place, eg. the camp's site plan. Locations are marked on it below.",
+ },
+ {
+ path: "map_alt",
+ label: "Map description",
+ full: true,
+ help: "For screen readers. Default: Map of .",
+ },
+ ],
+ },
+ ],
+
+ children: [
+ {
+ key: "locations",
+ label: "Locations",
+ addLabel: "Add location",
+ note: "The places on the map, in the order they're listed. Schedule entries pick one of these.",
+ title: (row) => row.name || "New location",
+ blank: () => ({ location_key: crypto.randomUUID().slice(0, 8) }),
+ fields: [
+ { path: "name", label: "Name", required: true, help: "eg. Main Hall" },
+ { path: "detail", label: "Detail", help: "A line under the name, eg. Upstairs, by the dining hall" },
+ {
+ path: "x",
+ label: "On the map",
+ widget: "mapMarker",
+ imageFrom: "map_image",
+ full: true,
+ help: "Click the map for a pin, or drag out a box for an area. Default: listed, not marked.",
+ },
+ ],
+ },
+ ],
+};
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index e346739..fd5c42d 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -43,6 +43,8 @@ export type ContentBlock = {
| 'tab'
| 'cards'
| 'people'
+ | 'map'
+ | 'events'
text?: string | null
media?: string | null
href?: string | null
@@ -57,6 +59,43 @@ export type ContentBlock = {
items?: ContentBlockItem[]
/** A schedule's own tags (087). */
tags?: ScheduleTag[]
+ /** A map or schedule block's venue (088). */
+ venue_id?: string | null
+ venue?: Venue | null
+}
+
+/** A venue (088): its map picture and the locations marked on it,
+ * each a pin (x, y) or a box (x, y, w, h), in percent. */
+export type Venue = {
+ id: string
+ name: string
+ address?: string | null
+ map_image?: string | null
+ map_alt?: string | null
+ locations: VenueLocation[]
+}
+export type VenueLocation = {
+ key: string
+ name: string
+ detail?: string | null
+ x?: number | null
+ y?: number | null
+ w?: number | null
+ h?: number | null
+}
+
+/** An event an item names (088): an events block's card, or the
+ * workshop a schedule entry is. */
+export type ItemEvent = {
+ id: string
+ title: string
+ event_type?: string | null
+ starts_on?: string | null
+ ends_on?: string | null
+ date_label?: string | null
+ color?: string | null
+ image?: string | null
+ blurb?: string | null
}
/** A schedule's tag (087). `tab` is whether it gets a tab of its own. */
@@ -89,6 +128,11 @@ export type ContentBlockItem = {
items?: ContentBlockItem[]
/** Its block's tags it has, by key (087). */
tags?: string[]
+ /** The event it is, and its place on the block's venue (088). */
+ event_id?: string | null
+ event?: ItemEvent | null
+ location_key?: string | null
+ place?: { venue_id: string; key: string; name: string } | null
}
export type Link = {
diff --git a/src/pages/admin/EntityEdit.tsx b/src/pages/admin/EntityEdit.tsx
index af0873e..101761f 100644
--- a/src/pages/admin/EntityEdit.tsx
+++ b/src/pages/admin/EntityEdit.tsx
@@ -587,6 +587,7 @@ export default function EntityEdit() {
options={options}
errors={errors}
errorPrefix={`${child.key}.`}
+ parentRow={form}
className=""
onChange={(rows) => setForm((prev) => ({ ...prev, [child.key]: rows }))}
/>
diff --git a/src/pages/admin/adminNav.ts b/src/pages/admin/adminNav.ts
index 87d0811..6d992f0 100644
--- a/src/pages/admin/adminNav.ts
+++ b/src/pages/admin/adminNav.ts
@@ -90,6 +90,11 @@ export const DATA_NAV = {
label: "Tags",
blurb: "Descriptors for organizations and events, eg. Online, In-Person. Who carries a tag is edited on the record.",
},
+ {
+ to: "/admin/venues",
+ label: "Venues",
+ blurb: "Places we gather, each with a map and its locations marked, for map blocks and schedules.",
+ },
{
to: "/admin/redirects",
label: "Links/redirects",
From df8052c75ec6f0995a18dbc07a7e1c18c8d46324 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Mon, 9 Nov 2026 03:41:21 -0600
Subject: [PATCH 02/33] Present: the whole event page, in sections at its
headings
The presentation (now EventPresent) cuts the event's page into
sections at its Heading blocks: a section's text on one slide, then
its schedules' slides, a map block's map and each location lit up,
and an events block's grid and each event. One Present button on the
event page replaces the schedule's. Setup lists the sections, each
schedule's days and entries under its own; the address keys are now
skip and hide, numbered by schedule.
Co-Authored-By: Claude Opus 5.5
---
docs/updating-data-in-code.md | 2 +-
server/src/pageMeta.js | 2 +-
src/App.tsx | 6 +-
src/components/ContentBlocks.tsx | 29 +-
src/components/MapBlock.tsx | 206 ++++--
src/components/ScheduleBlock.tsx | 24 +-
src/pages/EventDetail.tsx | 20 +-
.../{SchedulePresent.css => EventPresent.css} | 2 +-
.../{SchedulePresent.tsx => EventPresent.tsx} | 604 +++++++++++++-----
9 files changed, 635 insertions(+), 260 deletions(-)
rename src/pages/{SchedulePresent.css => EventPresent.css} (94%)
rename src/pages/{SchedulePresent.tsx => EventPresent.tsx} (59%)
diff --git a/docs/updating-data-in-code.md b/docs/updating-data-in-code.md
index fbfbe4b..6a629b9 100644
--- a/docs/updating-data-in-code.md
+++ b/docs/updating-data-in-code.md
@@ -182,7 +182,7 @@ also in `server/src/admin-schema/` and a CHECK):
| Links → Platform | instagram, facebook, discord, youtube, tiktok, x, substack, spotify, linkedin | **yes**, `PLATFORMS` | `PlatformIcon.tsx` draws the icon on the button. **No CHECK and no `enumeration`**: the column is plain text, so adding one is an entry in `PLATFORMS` (`src/lib/platforms.ts`) and its icon in `src/components/PlatformIcon.tsx`, no migration. |
| Content blocks → Shown in (slot) | card, body | **yes** | `paragraphs()` in `server/src/shape.js` (card), `ContentBlocks.tsx` (body) |
| Content blocks → Type | heading, subheading, paragraph, list, links, quote, image, divider, video, button, callout, schedule, table, cards, people, map, events | **yes**, `BLOCK_TYPES` (with each type's description) | `ContentBlocks.tsx` (one renderer per type). Which fields each type shows is `when` on the fields in `blocksChild` (`src/lib/adminSchema/shared.ts`). |
-| Content blocks → Schedule items → Type | (blank: normal entry), block, break, heading | **yes**, migration 086 | `SCHEDULE_KINDS` in `src/lib/adminSchema/shared.ts`; drawn by `ScheduleBlock.tsx` and `SchedulePresent.tsx` (which slides each kind gets). A block's sub-items are `content_block_subitems`. A schedule's own tags (087) are `content_block_tags`, rows of the block typed in the admin (not a fixed list); entries name them by `tag_key`, made in the admin as the tag is added. A schedule's Venue (088) lends its locations (Data → Venues, `venue_locations`) to its entries' Map location, named by `location_key` the same way; an entry's Event (a workshop) fills what it leaves blank in `shape.js` (`attachEvents`). |
+| Content blocks → Schedule items → Type | (blank: normal entry), block, break, heading | **yes**, migration 086 | `SCHEDULE_KINDS` in `src/lib/adminSchema/shared.ts`; drawn by `ScheduleBlock.tsx` and `EventPresent.tsx` (which slides each kind gets; the presentation cuts the event's page into sections at its Heading blocks). A block's sub-items are `content_block_subitems`. A schedule's own tags (087) are `content_block_tags`, rows of the block typed in the admin (not a fixed list); entries name them by `tag_key`, made in the admin as the tag is added. A schedule's Venue (088) lends its locations (Data → Venues, `venue_locations`) to its entries' Map location, named by `location_key` the same way; an entry's Event (a workshop) fills what it leaves blank in `shape.js` (`attachEvents`). |
| Timeline → Kind (+ list filter) | milestone, event, organization, award, people | no | `KIND_NAMES` in `src/pages/sections/history/TimelineEntry.tsx` |
| Timeline → Points at (+ list filter) | event, organization, award, person, team | no | `refHref` in `src/lib/hrefs.ts` |
| Timeline → Precision (and on events/orgs) | year, month, day | no | the history page's grouping |
diff --git a/server/src/pageMeta.js b/server/src/pageMeta.js
index f6054e4..9540502 100644
--- a/server/src/pageMeta.js
+++ b/server/src/pageMeta.js
@@ -426,7 +426,7 @@ export function metaFor(db, rawPath, user = null) {
};
}
- // An event's schedule presentation (SchedulePresent.tsx): the
+ // An event page's presentation (EventPresent.tsx): the
// event's own title and preview, kept out of search, pointing
// search engines at the event page.
const present = pathname.match(/^\/events\/([^/]+)\/present$/);
diff --git a/src/App.tsx b/src/App.tsx
index 4f6b860..c9c295e 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -67,7 +67,7 @@ const AwardDetail = lazyPage(() => import("./pages/AwardDetail.tsx"))
const PersonDetail = lazyPage(() => import("./pages/PersonDetail.tsx"))
const BlogPost = lazyPage(() => import("./pages/BlogPost.tsx"))
const DirectoryPage = lazyPage(() => import("./pages/DirectoryPage.tsx"))
-const SchedulePresent = lazyPage(() => import("./pages/SchedulePresent.tsx"))
+const EventPresent = lazyPage(() => import("./pages/EventPresent.tsx"))
/*Admin Pages*/
const AdminLayout = lazyPage(() => import("./pages/admin/AdminLayout.tsx"))
@@ -110,12 +110,12 @@ export default function App() {
{/* Every page of the site: Pages → Page management (PageAtPath). */}
} />
- {/* A schedule as a slideshow for a screen: full screen, no Layout. */}
+ {/* An event page as a slideshow for a screen: full screen, no Layout. */}
-
+
}
/>
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index eb4f2a5..0b315da 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -52,7 +52,7 @@
import { mediaUrl } from '../lib/media.ts'
import PeopleTiles from './PeopleTiles.tsx'
-import type { ContentBlock, ContentBlockItem } from '../lib/useContent.ts'
+import type { ContentBlock, ContentBlockItem, ItemEvent } from '../lib/useContent.ts'
import { Anchor, Inline, Paragraphs, isExternalUrl } from './InlineText.tsx'
import VideoPlayer from './VideoPlayer.tsx'
import ScheduleBlock from './ScheduleBlock.tsx'
@@ -72,7 +72,6 @@ export default function ContentBlocks({
blocks,
accent = BRAND,
className = '',
- presentAt,
anchorPrefix = '',
}: {
blocks?: ContentBlock[] | null
@@ -80,9 +79,6 @@ export default function ContentBlocks({
className?: string
/** Put before each heading's id: a blog post's tab (contents.ts, splitTabs). */
anchorPrefix?: string
- /** An event page's presentation route: each schedule gets a Present
- * button to it, `?block=` naming which schedule (from 0). */
- presentAt?: string
}) {
if (!blocks?.length) return null
// Headings get ids so a post's contents (PostContents) and a shared
@@ -98,10 +94,6 @@ export default function ContentBlocks({
return level
})
- let schedules = 0
- const presentHrefs = blocks.map((block) =>
- presentAt && block.type === 'schedule' ? `${presentAt}?block=${schedules++}` : undefined,
- )
// The venues mapped here, for a schedule's places to link to.
const maps = new Set(blocks.flatMap((block) => (block.type === 'map' && block.venue ? [block.venue.id] : [])))
@@ -116,7 +108,6 @@ export default function ContentBlocks({
accent={accent}
anchor={idAt.get(index)}
level={levels[index]}
- presentHref={presentHrefs[index]}
/>
))}
@@ -161,12 +152,19 @@ function LinkCard({ item }: { item: ContentBlockItem }) {
/* One event card (088): the event's picture, its type and date,
its title (or the item's text) and card text (or the item's
detail); the whole card links to the event. */
+/* An event's type and date, eg. workshop · June 14, 2025 (shown
+ capitalized), or null with neither. */
+export function eventLine(event: ItemEvent): string | null {
+ const when = event.date_label || (event.starts_on ? occurrenceLabel(event.starts_on) : null)
+ const kind = event.event_type && event.event_type !== 'other' ? event.event_type : null
+ return [kind, when].filter(Boolean).join(' · ') || null
+}
+
function EventCard({ item, accent }: { item: ContentBlockItem; accent: string }) {
const event = item.event!
const img = useSmallImage(mediaUrl(event.image))
const color = event.color || accent
- const when = event.date_label || (event.starts_on ? occurrenceLabel(event.starts_on) : null)
- const kind = event.event_type && event.event_type !== 'other' ? event.event_type : null
+ const line = eventLine(event)
return (
)}
- {(kind || when) && (
+ {line && (
- {[kind, when].filter(Boolean).join(' · ')}
+ {line}
)}
@@ -223,13 +221,11 @@ function Block({
accent,
anchor,
level,
- presentHref,
}: {
block: ContentBlock
accent: string
anchor?: string
level: 3 | 4 | 5
- presentHref?: string
}) {
const text = block.text ?? ''
const reading = useReadingMode()
@@ -439,7 +435,6 @@ function Block({
tags={block.tags}
intro={block.text}
accent={accent}
- presentHref={presentHref}
/>
)
diff --git a/src/components/MapBlock.tsx b/src/components/MapBlock.tsx
index 25728bd..bb704f3 100644
--- a/src/components/MapBlock.tsx
+++ b/src/components/MapBlock.tsx
@@ -13,6 +13,9 @@
the mark's own, so Layout's jump to the anchor scrolls it into
view and focuses it.
+ MapPicture is the picture and its marks alone; the event's
+ presentation (EventPresent.tsx) draws it too, with no links.
+
Reading mode (readingMode.ts) gets the list alone, no picture.
PageMaps holds the venues that have a map block among the blocks
@@ -20,8 +23,8 @@
when there's a map on the page to go to.
═══════════════════════════════════════════════════════════════ */
-import { createContext, useState } from 'react'
-import { Link, useLocation } from 'react-router-dom'
+import { createContext, useState, type CSSProperties } from 'react'
+import { Link, useLocation, type To } from 'react-router-dom'
import { mediaUrl } from '../lib/media.ts'
import type { Venue, VenueLocation } from '../lib/useContent.ts'
@@ -33,15 +36,138 @@ export const PageMaps = createContext>(new Set())
export const mapAnchor = (venueId: string, key: string) => `map-${venueId}-${key}`
const isBox = (location: VenueLocation) => location.w != null && location.h != null
+export const isMarked = (location: VenueLocation) => location.x != null && location.y != null
+
+/* A location's number on the map and in the list: its place in the
+ venue's order. */
+export const locationNumber = (venue: Venue, location: VenueLocation) => venue.locations.indexOf(location) + 1
+
+/* A location's numbered dot, in the accent. */
+export function LocationNumber({
+ n,
+ accent,
+ className = 'h-6 w-6 text-xs',
+ style,
+}: {
+ n: number
+ accent: string
+ className?: string
+ style?: CSSProperties
+}) {
+ return (
+
+ {n}
+
+ )
+}
+
+/* The venue's picture with its marks, `active` lit up. With `link`
+ each mark is a link (and `light` its hover and focus); without,
+ the marks are only drawn. `className` sizes the picture's box. */
+export function MapPicture({
+ venue,
+ accent,
+ active,
+ link,
+ light,
+ className = '',
+ big = false,
+}: {
+ venue: Venue
+ accent: string
+ active: string | null
+ link?: (key: string) => To
+ light?: (key: string) => object
+ className?: string
+ /** Bigger marks, for a screen across a room. */
+ big?: boolean
+}) {
+ const image = mediaUrl(venue.map_image)
+ if (!image) return null
+ return (
+
+
+ {venue.locations.filter(isMarked).map((location) => {
+ const on = active === location.key
+ const dim = active != null && !on
+ const style: CSSProperties = isBox(location)
+ ? {
+ left: `${location.x}%`,
+ top: `${location.y}%`,
+ width: `${location.w}%`,
+ height: `${location.h}%`,
+ border: `${big ? 4 : 2}px solid ${accent}`,
+ background: withAlpha(accent, on ? 35 : 12),
+ opacity: dim ? 0.35 : 1,
+ }
+ : {
+ left: `${location.x}%`,
+ top: `${location.y}%`,
+ transform: 'translate(-50%, -50%)',
+ opacity: dim ? 0.35 : 1,
+ zIndex: on ? 1 : undefined,
+ }
+ const dot = big
+ ? isBox(location)
+ ? 'absolute top-[0.5vw] left-[0.5vw] h-[2.6vw] w-[2.6vw] text-[1.3vw]'
+ : on
+ ? 'h-[4vw] w-[4vw] text-[2vw]'
+ : 'h-[2.8vw] w-[2.8vw] text-[1.4vw]'
+ : isBox(location)
+ ? 'absolute top-1 left-1 h-6 w-6 text-xs'
+ : on
+ ? 'h-9 w-9 text-xs'
+ : 'h-7 w-7 text-xs'
+ const inside = (
+ <>
+
+ {on && !big && (
+
+ {location.name}
+
+ )}
+ >
+ )
+ return link ? (
+
+ {inside}
+
+ ) : (
+
+ {inside}
+
+ )
+ })}
+
+ )
+}
export default function MapBlock({ venue, accent }: { venue: Venue; accent: string }) {
const { hash, search } = useLocation()
const [hovered, setHovered] = useState(null)
- const marked = venue.locations.filter((location) => location.x != null && location.y != null)
const fromHash = venue.locations.find((location) => hash === `#${mapAnchor(venue.id, location.key)}`)?.key ?? null
const active = hovered ?? fromHash
- const image = useReadingMode() ? null : mediaUrl(venue.map_image)
- const fill = accent.startsWith('#') ? accent : '#000000'
+ const picture = !useReadingMode() && Boolean(venue.map_image)
const to = (key: string) => ({ search, hash: mapAnchor(venue.id, key) })
const light = (key: string) => ({
@@ -50,68 +176,12 @@ export default function MapBlock({ venue, accent }: { venue: Venue; accent: stri
onFocus: () => setHovered(key),
onBlur: () => setHovered(null),
})
- const number = (location: VenueLocation) => venue.locations.indexOf(location) + 1
return (
- {image && (
-
-
- {marked.map((location) => {
- const on = active === location.key
- const dim = active != null && !on
- return (
-
-
- {number(location)}
-
- {on && (
-
- {location.name}
-
- )}
-
- )
- })}
-
- )}
+ {picture && }
-
+
{venue.name}
{venue.address && {venue.address}
}
@@ -119,13 +189,7 @@ export default function MapBlock({ venue, accent }: { venue: Venue; accent: stri
const on = active === location.key
const row = (
<>
-
- {number(location)}
-
+
{location.name}
@@ -138,7 +202,7 @@ export default function MapBlock({ venue, accent }: { venue: Venue; accent: stri
const rowStyle = on ? { background: withAlpha(accent, 12) } : undefined
return (
- {location.x != null && location.y != null ? (
+ {isMarked(location) ? (
{row}
diff --git a/src/components/ScheduleBlock.tsx b/src/components/ScheduleBlock.tsx
index 7a65b96..bc7ee4d 100644
--- a/src/components/ScheduleBlock.tsx
+++ b/src/components/ScheduleBlock.tsx
@@ -38,8 +38,8 @@
that is an event (a workshop) has already taken what it left
blank from it (shape.js).
- On an event page a Present button opens the schedule as a
- slideshow for a screen (SchedulePresent.tsx).
+ The event page's Present button shows it, with the rest of the
+ page, as a slideshow for a screen (EventPresent.tsx).
Tabs follow the ARIA tab pattern: arrow keys move between them.
@@ -48,7 +48,7 @@
it, no map frame (ReadingSchedule).
═══════════════════════════════════════════════════════════════ */
-import { CaretDown, MapPin, Presentation, Star } from '@phosphor-icons/react'
+import { CaretDown, MapPin, Star } from '@phosphor-icons/react'
import { Fragment, createContext, useContext, useId, useState, type KeyboardEvent, type ReactNode } from 'react'
import { Link, useLocation } from 'react-router-dom'
@@ -475,14 +475,11 @@ export default function ScheduleBlock({
tags = [],
intro,
accent,
- presentHref,
}: {
items: ContentBlockItem[]
tags?: ScheduleTag[]
intro?: string | null
accent: string
- /** Where the Present button goes; no button without it. */
- presentHref?: string
}) {
const days = groupByDay(items)
const [active, setActive] = useState(() => todayIndex(days))
@@ -526,21 +523,6 @@ export default function ScheduleBlock({
)}
- {presentHref && (
-
-
-
- Present
-
(opens in a new tab)
-
-
- )}
-
{tabs.length > 1 && (
{tabs.map((tab, index) => {
diff --git a/src/pages/EventDetail.tsx b/src/pages/EventDetail.tsx
index d237f7b..31c03a2 100644
--- a/src/pages/EventDetail.tsx
+++ b/src/pages/EventDetail.tsx
@@ -35,7 +35,8 @@ import { mediaUrl } from '../lib/media.ts'
import { eventTypeLabel } from '../lib/eventTypes.ts'
import { occurrenceLabel, seriesLabel, seriesTimes, upcomingOccurrences } from '../lib/eventSeries.ts'
import { capitalize } from '../lib/text.ts'
-import { accentText, readableOn, BRAND } from '../lib/color.ts'
+import { accentText, readableOn, withAlpha, BRAND } from '../lib/color.ts'
+import { Presentation } from '@phosphor-icons/react'
const BODY = 'var(--color-muted)'
@@ -109,7 +110,22 @@ export default function EventDetail() {
)}
-
+ {/* The page as a slideshow for a screen (EventPresent.tsx). */}
+ {event.blocks.length > 0 && (
+
+
+
+ Present
+
(opens in a new tab)
+
+
+ )}
+
{event.links.length > 0 && (
diff --git a/src/pages/SchedulePresent.css b/src/pages/EventPresent.css
similarity index 94%
rename from src/pages/SchedulePresent.css
rename to src/pages/EventPresent.css
index de31f90..98d7801 100644
--- a/src/pages/SchedulePresent.css
+++ b/src/pages/EventPresent.css
@@ -1,4 +1,4 @@
-/* The schedule presentation's motion (SchedulePresent.tsx). The
+/* The event presentation's motion (EventPresent.tsx). The
reduced motion rule in index.css stops all of it. */
.present-in {
diff --git a/src/pages/SchedulePresent.tsx b/src/pages/EventPresent.tsx
similarity index 59%
rename from src/pages/SchedulePresent.tsx
rename to src/pages/EventPresent.tsx
index 29f9bde..b8a5d42 100644
--- a/src/pages/SchedulePresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -1,16 +1,23 @@
/* ═══════════════════════════════════════════════════════════════
- SCHEDULE PRESENTATION: /events/:id/present?block=
+ EVENT PRESENTATION: /events/:id/present
- An event's schedule block as an endless slideshow for a screen
- (digital signage), opened from the block's Present button. Outside
- the site's Layout: no header, footer or backdrop.
+ An event page's content blocks as an endless slideshow for a
+ screen (digital signage), opened from the page's Present button.
+ Outside the site's Layout: no header, footer or backdrop.
- First a setup screen: which days and entries, and how many seconds
- each kind of slide stays up (0 leaves that kind out). Play writes
- the choices into the address, so a signage device can bookmark it
- and start the same way every time (`play=1` skips the setup).
+ The page is cut into sections at its Heading blocks (the blocks
+ before the first are a section under the event's title). Each
+ section, in order, gives:
+ section its text blocks (everything but the kinds below) on
+ one slide under its heading, scrolling if long
+ schedule each schedule block's slides (below)
+ venue each map block (088): the map with its locations
+ place then the map once per marked location, it lit up
+ cards each events block (088): its events on one slide
+ event then each event alone: picture, title, card text
+ and its person host
- The 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
spotlight one entry: its person beside title, time and place
block a block entry (086) and its sub-items on one slide,
@@ -21,10 +28,20 @@
tag after the days: each of the schedule's tags (087)
and everything it's on, under each day's name
A heading (086) is only a line on the overview; a break gets no
- spotlight. A slide with more than the screen holds waits half its
- seconds, scrolls to the end at "Scroll" seconds a screenful
- (`screen=`), then waits the other half. "Only entries tagged" (`only=`) cuts every slide
- to what one tag is on, eg. for a screen outside the youth room.
+ spotlight. "Only entries tagged" (`only=`) cuts every
+ schedule slide to what one tag is on, eg. for a screen outside the
+ youth room.
+
+ First a setup screen: which sections, days and entries, and how
+ many seconds each kind of slide stays up (0 leaves that kind out).
+ Play writes the choices into the address, so a signage device can
+ bookmark it and start the same way every time (`play=1` skips the
+ setup): `skip` the sections left out, by number; `hide` the days
+ (schedule.day), entries (schedule.day.entry) and sub-items
+ (schedule.day.entry.item) left out, a schedule numbered among the
+ page's schedules. A slide with more than the screen holds waits
+ half its seconds, scrolls to the end at "Scroll" seconds a
+ screenful (`screen=`), then waits the other half.
Keys while playing: arrows step, Space pauses, Escape leaves full
screen (the browser's), S goes back to the setup.
@@ -47,54 +64,99 @@ import {
withTag,
type Day,
} from '../components/ScheduleBlock.tsx'
+import ContentBlocks, { eventLine } from '../components/ContentBlocks.tsx'
+import { LocationNumber, MapPicture, isMarked, locationNumber } from '../components/MapBlock.tsx'
import { Paragraphs } from '../components/InlineText.tsx'
-import { useEvent, type ContentBlockItem, type ScheduleTag } from '../lib/useContent.ts'
+import {
+ useEvent,
+ type ContentBlock,
+ type ContentBlockItem,
+ type ScheduleTag,
+ type Venue,
+ type VenueLocation,
+} from '../lib/useContent.ts'
import { mediaUrl } from '../lib/media.ts'
import { BRAND, accentText, readableOn, withAlpha } from '../lib/color.ts'
import { documentTitle } from '../lib/site.ts'
-import './SchedulePresent.css'
+import './EventPresent.css'
/* Each kind of slide, its address key and seconds when unset. */
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 },
- { key: 'tag', label: 'Tag slides', help: "Each tag and everything it's on, after the days", seconds: 15 },
+ { key: 'section', label: 'Sections', help: "A section's text under its heading", seconds: 20 },
+ { key: 'overview', label: 'Day overview', help: 'A schedule day on one slide', seconds: 20 },
+ { key: 'spotlight', label: 'Entry spotlight', help: 'One schedule entry at a time, with its person', seconds: 12 },
+ { key: 'block', label: 'Blocks', help: 'A schedule block and the things in it, before each gets a spotlight', seconds: 15 },
+ { key: 'graphic', label: 'Graphics', help: "A schedule entry's graphic, full screen", seconds: 10 },
+ { key: 'map', label: 'Map images', help: "A schedule entry's own map, full screen", seconds: 10 },
+ { key: 'tag', label: 'Tag slides', help: "Each schedule tag and everything it's on, after the days", seconds: 15 },
+ { key: 'venue', label: 'Maps', help: "A map block: the venue's map with its locations", seconds: 15 },
+ { 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: 'event', label: 'Event spotlight', help: 'Each event of an events block alone', seconds: 12 },
] as const
type Kind = (typeof KINDS)[number]['key']
+/* Blocks with slides of their own, not a section's text, as the
+ setup screen names them. */
+const OWN_SLIDES = new Map([
+ ['schedule', 'Schedule'],
+ ['map', 'Map'],
+ ['events', 'Events'],
+])
+/* Blocks that start a section. */
+const STARTS_SECTION = new Set(['heading', 'tab'])
+
/* Seconds a long slide takes to scroll one screenful, when unset. */
const PER_SCREEN = 8
/* An overview with more entries than this goes to two columns. */
const ONE_COLUMN = 8
/* How long the controls stay up after the pointer last moved (ms). */
const CONTROLS_FOR = 2500
+/* A section's text is drawn at the page's size, zoomed to a screen
+ this many pixels wide or more. */
+const TEXT_WIDTH = 1000
-/* `parent` is a sub-item's block; a tag slide has its `tag` and the
- `days` it gathers from. */
+/* `label` is the top bar's right side: the day, else the section.
+ The rest is what each kind draws. */
type Slide = {
kind: Kind
seconds: number
- day: Day
+ label: string
+ day?: Day
entry?: ContentBlockItem
parent?: ContentBlockItem
tag?: ScheduleTag
days?: Day[]
+ tags?: ScheduleTag[]
+ blocks?: ContentBlock[]
+ venue?: Venue
+ location?: VenueLocation
+ items?: ContentBlockItem[]
}
-/* 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('.')
+/* A part of the page: a heading and the blocks under it. */
+type Section = { title: string; blocks: ContentBlock[] }
+/* A schedule block, numbered among the page's, with its days. */
+type Schedule = { n: number; days: Day[]; tags: ScheduleTag[] }
+
+function sectionsOf(blocks: ContentBlock[], title: string): Section[] {
+ const sections: Section[] = [{ title, blocks: [] }]
+ for (const block of blocks) {
+ if (STARTS_SECTION.has(block.type)) sections.push({ title: block.text || title, blocks: [] })
+ else sections[sections.length - 1].blocks.push(block)
+ }
+ return sections.filter((section) => section.blocks.length)
+}
+
+/* A day's, entry's or sub-item's key in the address: the schedule's
+ number, the day's, then the entry's and sub-item's, dotted. */
+const key = (...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[]) {
- const pickedDays = list(params.get('days'))?.map(Number) ?? days.map((_, i) => i)
- const hidden = new Set(list(params.get('hide')) ?? [])
+function readSettings(params: URLSearchParams) {
const seconds = Object.fromEntries(
KINDS.map((kind) => {
const value = Number(params.get(kind.key) ?? kind.seconds)
@@ -103,51 +165,48 @@ function readSettings(params: URLSearchParams, days: Day[]) {
) as Record
const screen = Number(params.get('screen') ?? PER_SCREEN)
return {
- pickedDays: new Set(pickedDays),
- hidden,
+ skipped: new Set((list(params.get('skip')) ?? []).map(Number)),
+ hidden: new Set(list(params.get('hide')) ?? []),
seconds,
screen: Number.isFinite(screen) && screen > 0 ? screen : PER_SCREEN,
only: params.get('only') || null,
}
}
type Settings = ReturnType
+type Picks = Pick
-function buildSlides(
- days: Day[],
- tags: ScheduleTag[],
- { pickedDays, hidden, seconds, only }: Pick,
-): Slide[] {
- const slides: Slide[] = []
+function scheduleSlides(slides: Slide[], { n, days, tags }: Schedule, { hidden, seconds, only }: Picks) {
const kept: Day[] = []
days.forEach((all, d) => {
- if (!pickedDays.has(d)) return
+ if (hidden.has(key(n, d))) return
let entries = all.entries.flatMap((entry, e) => {
- if (hidden.has(entryKey(d, e))) return []
+ if (hidden.has(key(n, d, e))) return []
if (entry.kind !== 'block') return [entry]
- return [{ ...entry, items: (entry.items ?? []).filter((_, i) => !hidden.has(entryKey(d, e, i))) }]
+ return [{ ...entry, items: (entry.items ?? []).filter((_, i) => !hidden.has(key(n, d, e, i))) }]
})
if (only) entries = withTag(entries, only)
if (entries.length === 0) return
kept.push({ name: all.name, entries })
const day = { ...all, entries }
- if (seconds.overview) slides.push({ kind: 'overview', seconds: seconds.overview, day })
+ const at = { day, label: day.name, tags }
+ if (seconds.overview) slides.push({ kind: 'overview', seconds: seconds.overview, ...at })
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 })
+ if (seconds.graphic && entry.media) slides.push({ kind: 'graphic', seconds: seconds.graphic, ...at, entry, parent })
+ if (seconds.map && entry.map_image) slides.push({ kind: 'map', seconds: seconds.map, ...at, 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 })
+ if (seconds.block) slides.push({ kind: 'block', seconds: seconds.block, ...at, entry })
media(entry)
for (const item of entry.items ?? []) {
- if (seconds.spotlight) slides.push({ kind: 'spotlight', seconds: seconds.spotlight, day, entry: item, parent: entry })
+ if (seconds.spotlight) slides.push({ kind: 'spotlight', seconds: seconds.spotlight, ...at, entry: item, parent: entry })
media(item, entry)
}
continue
}
- if (seconds.spotlight && entry.kind !== 'break') slides.push({ kind: 'spotlight', seconds: seconds.spotlight, day, entry })
+ if (seconds.spotlight && entry.kind !== 'break') slides.push({ kind: 'spotlight', seconds: seconds.spotlight, ...at, entry })
media(entry)
}
})
@@ -156,24 +215,59 @@ function buildSlides(
for (const tag of tags) {
if (only && tag.key !== only) continue
const tagDays = daysWithTag(kept, tag.key)
- if (tagDays.length) slides.push({ kind: 'tag', seconds: seconds.tag, day: { name: '', entries: [] }, tag, days: tagDays })
+ if (tagDays.length) slides.push({ kind: 'tag', seconds: seconds.tag, label: tag.name, tag, days: tagDays, tags })
}
}
+}
+
+function buildSlides(sections: Section[], schedules: Map, picks: Picks): Slide[] {
+ const { skipped, seconds } = picks
+ const slides: Slide[] = []
+ sections.forEach((section, s) => {
+ if (skipped.has(s)) return
+ const label = section.title
+ const text = section.blocks.filter((block) => !OWN_SLIDES.has(block.type))
+ if (seconds.section && text.length) slides.push({ kind: 'section', seconds: seconds.section, label, blocks: text })
+ for (const block of section.blocks) {
+ const schedule = schedules.get(block)
+ if (schedule) scheduleSlides(slides, schedule, picks)
+ if (block.type === 'map' && block.venue) {
+ const venue = block.venue
+ if (seconds.venue) slides.push({ kind: 'venue', seconds: seconds.venue, label, venue })
+ if (seconds.place && venue.map_image) {
+ for (const location of venue.locations.filter(isMarked)) {
+ slides.push({ kind: 'place', seconds: seconds.place, label, venue, location })
+ }
+ }
+ }
+ if (block.type === 'events') {
+ const items = (block.items ?? []).filter((item) => item.event)
+ if (seconds.cards && items.length) slides.push({ kind: 'cards', seconds: seconds.cards, label, items })
+ if (seconds.event) for (const entry of items) slides.push({ kind: 'event', seconds: seconds.event, label, entry })
+ }
+ }
+ })
return slides
}
-export default function SchedulePresent() {
+export default function EventPresent() {
const { id } = useParams()
const [params, setParams] = useSearchParams()
const { data: event, loading, error, notFound, reload } = useEvent(id)
- const blockIndex = Number(params.get('block') ?? 0)
- const schedule = event?.blocks?.filter((block) => block.type === 'schedule')[blockIndex]
- const days = useMemo(() => groupByDay(schedule?.items ?? []), [schedule])
- const tags = schedule?.tags ?? []
+ const sections = useMemo(() => (event ? sectionsOf(event.blocks ?? [], event.title) : []), [event])
+ const schedules = useMemo(() => {
+ const out = new Map()
+ for (const block of event?.blocks ?? []) {
+ if (block.type !== 'schedule') continue
+ const days = groupByDay(block.items ?? [])
+ if (days.length) out.set(block, { n: out.size, days, tags: block.tags ?? [] })
+ }
+ return out
+ }, [event])
useEffect(() => {
- if (event) document.title = documentTitle(`${event.title}: schedule`)
+ if (event) document.title = documentTitle(`${event.title}: present`)
}, [event])
if (!event) {
@@ -193,10 +287,10 @@ export default function SchedulePresent() {
const accent = event.color || BRAND
const back = `/events/${encodeURIComponent(event.id)}`
- if (!schedule || days.length === 0) {
+ if (sections.length === 0) {
return (
- This event has no schedule to present.
+ This event has nothing on its page to present.
Back to {event.title}
@@ -204,22 +298,20 @@ export default function SchedulePresent() {
)
}
- const settings = readSettings(params, days)
+ const settings = readSettings(params)
if (params.get('play') === '1') {
return (
-
- {
- const next = new URLSearchParams(params)
- next.delete('play')
- setParams(next)
- }}
- />
-
+ {
+ const next = new URLSearchParams(params)
+ next.delete('play')
+ setParams(next)
+ }}
+ />
)
}
return (
@@ -227,14 +319,14 @@ export default function SchedulePresent() {
title={event.title}
back={back}
accent={accent}
- days={days}
- tags={tags}
+ sections={sections}
+ schedules={schedules}
settings={settings}
onPlay={(next) => {
// Full screen needs the click itself, so it's asked for here.
document.documentElement.requestFullscreen?.().catch(() => {})
- const out = new URLSearchParams({ block: String(blockIndex) })
- if (next.pickedDays.size < days.length) out.set('days', [...next.pickedDays].sort((a, b) => a - b).join(','))
+ const out = new URLSearchParams()
+ if (next.skipped.size) out.set('skip', [...next.skipped].sort((a, b) => a - b).join(','))
if (next.hidden.size) out.set('hide', [...next.hidden].join(','))
for (const kind of KINDS) out.set(kind.key, String(next.seconds[kind.key]))
out.set('screen', String(next.screen))
@@ -253,25 +345,26 @@ function Setup({
title,
back,
accent,
- days,
- tags,
+ sections,
+ schedules,
settings,
onPlay,
}: {
title: string
back: string
accent: string
- days: Day[]
- tags: ScheduleTag[]
+ sections: Section[]
+ schedules: Map
settings: Settings
onPlay: (settings: Settings) => void
}) {
- const [pickedDays, setPickedDays] = useState(settings.pickedDays)
+ const [skipped, setSkipped] = useState(settings.skipped)
const [hidden, setHidden] = useState(settings.hidden)
const [seconds, setSeconds] = useState(settings.seconds)
const [only, setOnly] = useState(settings.only)
const [screen, setScreen] = useState(settings.screen)
- const count = buildSlides(days, tags, { pickedDays, hidden, seconds, only }).length
+ const count = buildSlides(sections, schedules, { skipped, hidden, seconds, only }).length
+ const tags = [...schedules.values()].flatMap((schedule) => schedule.tags)
const toggle = (set: Set, value: T) => {
const next = new Set(set)
@@ -285,7 +378,7 @@ function Setup({
- Present the schedule
+ Present the page
{title}
@@ -349,7 +442,9 @@ function Setup({
Only entries tagged
- Every slide shows only what this tag is on, eg. for one room's screen
+
+ Every schedule slide shows only what this tag is on, eg. for one room's screen
+
- Days and entries
+ Sections
+ The page's parts, each starting at a Heading block.
- {days.map((day, d) => (
-
- {day.name || 'Schedule'}
-
- setPickedDays(toggle(pickedDays, d))} />
- {day.name || 'Schedule'}
-
-
- {day.entries.map((entry, e) => (
-
- setHidden(toggle(hidden, entryKey(d, e)))}
- />
- {entry.kind === 'block' && entry.items?.length ? (
-
- {entry.items.map((item, i) => (
-
- setHidden(toggle(hidden, entryKey(d, e, i)))}
- />
-
- ))}
-
- ) : null}
-
- ))}
-
-
- ))}
+ {sections.map((section, s) => {
+ const on = !skipped.has(s)
+ const kinds = [...new Set(section.blocks.map((block) => (OWN_SLIDES.get(block.type) ?? 'Text')))]
+ return (
+
+ {section.title}
+
+ setSkipped(toggle(skipped, s))} />
+ {section.title}
+ {kinds.join(', ')}
+
+ {section.blocks.map((block, b) => {
+ const schedule = schedules.get(block)
+ if (!schedule) return null
+ const { n, days } = schedule
+ return (
+
+ {days.map((day, d) => (
+
+
setHidden(toggle(hidden, key(n, d)))}
+ />
+
+ {day.entries.map((entry, e) => (
+
+ setHidden(toggle(hidden, key(n, d, e)))}
+ />
+ {entry.kind === 'block' && entry.items?.length ? (
+
+ {entry.items.map((item, i) => (
+
+ setHidden(toggle(hidden, key(n, d, e, i)))}
+ />
+
+ ))}
+
+ ) : null}
+
+ ))}
+
+
+ ))}
+
+ )
+ })}
+
+ )
+ })}
@@ -412,7 +533,7 @@ function Setup({
onPlay({ pickedDays, hidden, seconds, screen, only })}
+ onClick={() => onPlay({ skipped, hidden, seconds, screen, only })}
className="btn inline-flex items-center gap-2 px-6 py-3 disabled:opacity-50"
style={{ background: accent, color: readableOn(accent) }}
>
@@ -431,32 +552,37 @@ function Setup({
)
}
-/* One entry's checkbox on the setup screen, its kind beside it. */
+/* One checkbox on the setup screen: a schedule entry (its time and
+ kind beside it) or a day (`label`, `strong`). */
const KIND_NOTE = { block: 'Block', break: 'Break', heading: 'Heading' } as const
function PickEntry({
entry,
+ label,
+ strong = false,
enabled,
checked,
onToggle,
}: {
- entry: ContentBlockItem
+ entry?: ContentBlockItem
+ label?: string
+ strong?: boolean
enabled: boolean
checked: boolean
onToggle: () => void
}) {
- const note = entry.kind && entry.kind !== 'entry' ? KIND_NOTE[entry.kind] : null
+ const note = entry?.kind && entry.kind !== 'entry' ? KIND_NOTE[entry.kind] : null
return (
- {entry.time}
-
- {entry.featured && (
+ {entry && {entry.time} }
+
+ {entry?.featured && (
)}
- {entry.text}
+ {entry ? entry.text : label}
{note && {note} }
@@ -557,7 +683,7 @@ function Player({
{title}
- {slide.day.name}
+ {slide.label === title ? '' : slide.label}
{/* Keyed by index, so every slide's entrance animation plays. */}
@@ -565,7 +691,9 @@ function Player({
setScroll({ index, seconds: s }) }}
>
-
+
+
+
@@ -676,6 +804,40 @@ function Scroll({ center = false, className = '', children }: {
)
}
+/* A slide's big title. */
+function SlideTitle({ children, color }: { children: ReactNode; color: string }) {
+ return (
+
+
+ {children}
+
+
+ )
+}
+
+/* A picture's width over its height, once it has loaded (0 before). */
+function useRatio(src: string | null) {
+ const [ratio, setRatio] = useState(0)
+ useEffect(() => {
+ if (!src) return
+ const img = new Image()
+ img.onload = () => setRatio(img.naturalWidth / (img.naturalHeight || 1))
+ img.src = src
+ }, [src])
+ return ratio
+}
+
+/* A venue's map at the most the slide holds: as wide as it can be
+ without being taller than `vh` of the screen. */
+function SlideMap({ venue, accent, active, vh }: { venue: Venue; accent: string; active: string | null; vh: number }) {
+ const ratio = useRatio(mediaUrl(venue.map_image))
+ return (
+
+
+
+ )
+}
+
/* An overview's rows: each entry, a block's sub-items under it.
`start` is the first row's place in the slide's entrance. */
function OverviewEntries({ entries, accent, start = 1 }: { entries: ContentBlockItem[]; accent: string; start?: number }) {
@@ -755,16 +917,178 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
const tags = useContext(ScheduleTags)
const color = accentText(accent)
+ if (slide.kind === 'section') {
+ // 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)
+ return (
+
+
{slide.label}
+
+
+
+
+
+
+
+
+ )
+ }
+
+ if (slide.kind === 'venue') {
+ const venue = slide.venue!
+ return (
+
+ {venue.map_image && (
+
+
+
+ )}
+
+
{venue.name}
+
+
+ {venue.locations.map((location, i) => (
+
+
+
+
+ {location.name}
+ {location.detail && (
+ {location.detail}
+ )}
+
+
+
+ ))}
+
+
+
+
+ )
+ }
+
+ if (slide.kind === 'place') {
+ const venue = slide.venue!
+ const location = slide.location!
+ return (
+
+
+
+
+
+
+
+
+
+ {location.name}
+
+ {location.detail && (
+
+ {location.detail}
+
+ )}
+
+
+ {venue.name}
+
+
+
+
+ )
+ }
+
+ if (slide.kind === 'cards') {
+ const items = slide.items ?? []
+ return (
+
+
{slide.label}
+
+ 4 ? 'grid-cols-3' : 'grid-cols-2'}`}>
+ {items.map((item, i) => {
+ const image = mediaUrl(item.event!.image)
+ return (
+
+
+ {image && }
+
+ {eventLine(item.event!) && (
+
+ {eventLine(item.event!)}
+
+ )}
+
+ {item.text || item.event!.title}
+
+ {item.person && (
+
{item.person.name}
+ )}
+
+
+
+ )
+ })}
+
+
+
+ )
+ }
+
+ const entry = slide.entry!
+
+ if (slide.kind === 'event') {
+ const event = entry.event!
+ const image = mediaUrl(event.image)
+ const blurb = entry.detail || event.blurb
+ return (
+
+ {image && (
+
+
+
+ )}
+
+ {eventLine(event) && (
+
+
+ {eventLine(event)}
+
+
+ )}
+
+
+ {entry.text || event.title}
+
+
+ {blurb && (
+
+
+
+ )}
+ {entry.person && (
+
+
+
+ {entry.person.name}
+ {entry.person.tagline && (
+ {entry.person.tagline}
+ )}
+
+
+ )}
+
+
+ )
+ }
+
if (slide.kind === 'overview') {
- const entries = slide.day.entries
+ const entries = slide.day!.entries
const two = lineCount(entries) > ONE_COLUMN
return (
-
-
- {slide.day.name || 'Schedule'}
-
-
+
{slide.day!.name || 'Schedule'}
@@ -782,11 +1106,7 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
let order = 1
return (
-
-
- {tag.name}
-
-
+
{tag.name}
{tagDays.map((day, d) => {
@@ -811,15 +1131,13 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
)
}
- const entry = slide.entry!
-
if (slide.kind === 'block') {
const items = entry.items ?? []
return (
- {[slide.day.name, entry.time].filter(Boolean).join(' · ')}
+ {[slide.day!.name, entry.time].filter(Boolean).join(' · ')}
@@ -915,7 +1233,7 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
- {[slide.day.name, slide.parent?.text, entry.time].filter(Boolean).join(' · ')}
+ {[slide.day!.name, slide.parent?.text, entry.time].filter(Boolean).join(' · ')}
From 375c364861bc0301194eefeb231f62a359d9c341 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Mon, 9 Nov 2026 04:31:34 -0600
Subject: [PATCH 03/33] Events block: a card opens the event in full, its own
blocks too
An events block's events bring their own page's blocks (one level
deep, so events listing each other stop there), photo and place. A
card opens the event under the cards: photo, type and date, title,
place, person host, its blocks (else its card text) and a link to its
page. Reading mode shows them all in full, and the presentation's
event spotlight shows its blocks.
Co-Authored-By: Claude Opus 5.5
---
server/src/shape.js | 23 +++--
src/components/ContentBlocks.tsx | 144 +++++++++++++++++++++++++++----
src/lib/useContent.ts | 6 ++
src/pages/EventPresent.tsx | 34 +++++---
4 files changed, 174 insertions(+), 33 deletions(-)
diff --git a/server/src/shape.js b/server/src/shape.js
index 721ab11..f3f89cd 100644
--- a/server/src/shape.js
+++ b/server/src/shape.js
@@ -64,7 +64,7 @@ export function loadLinks(db, ownerKind, ids) {
rather than no key, so the renderer never has to check.
───────────────────────────────────────────────────────────── */
-export function loadBlocks(db, ownerKind, ids, slot = "body") {
+export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
const out = new Map();
if (ids.length === 0) return out;
@@ -175,7 +175,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") {
}
attachVenues(db, [...byId.values()]);
- attachEvents(db, [...byId.values()]);
+ attachEvents(db, [...byId.values()], depth);
return out;
}
@@ -220,8 +220,13 @@ function attachVenues(db, blocks) {
schedule entry or sub-item that is a workshop, which takes what
it leaves blank from its event: the link, the description (its
card text), the graphic (its photo) and the person (a person
- host). An unpublished event is no event. */
-function attachEvents(db, blocks) {
+ host). An unpublished event is no event.
+
+ An events block's event also brings its own page's blocks
+ (`blocks`), drawn when its card is opened. Only at the top
+ (`depth` 0): a workshop's blocks don't bring theirs, so two
+ events listing each other can't go round forever. */
+function attachEvents(db, blocks, depth = 0) {
const entries = [];
const walk = (entry) => {
entries.push(entry);
@@ -234,7 +239,8 @@ function attachEvents(db, blocks) {
const rows = db
.prepare(
`SELECT e.id, e.title, e.tagline, e.event_type, e.starts_on, e.ends_on, e.date_label,
- e.effective_color AS color, COALESCE(e.card_image, e.photo) AS image, e.photo_alt,
+ e.effective_color AS color, COALESCE(e.card_image, e.photo) AS image, e.photo, e.photo_alt,
+ e.location_label,
p.id AS person_id, p.display_name AS person_name, p.photo AS person_photo,
p.tagline AS person_tagline
FROM v_events e
@@ -244,6 +250,9 @@ function attachEvents(db, blocks) {
.all(...ids);
const cards = loadBlocks(db, "event", rows.map((row) => row.id), "card");
const events = new Map(rows.map((row) => [row.id, row]));
+ const shown = blocks.filter((block) => block.type === "events").flatMap((block) => block.items);
+ const shownIds = [...new Set(shown.map((item) => item.event_id).filter((id) => events.has(id)))];
+ const bodies = depth === 0 && shownIds.length ? loadBlocks(db, "event", shownIds, "body", depth + 1) : new Map();
for (const entry of entries) {
const row = events.get(entry.event_id);
@@ -261,8 +270,12 @@ function attachEvents(db, blocks) {
date_label: row.date_label,
color: row.color,
image: row.image,
+ photo: row.photo,
+ photo_alt: row.photo_alt,
+ location_label: row.location_label,
blurb,
};
+ if (shown.includes(entry)) entry.event.blocks = bodies.get(row.id) ?? [];
entry.url ||= `/events/${row.id}`;
entry.description ||= blurb;
if (!entry.media && row.image) {
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index 0b315da..9fb8e65 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -35,7 +35,9 @@
link to it
events items as event cards: event (from
event_id), text the title shown, detail
- in place of the event's card text
+ in place of the event's card text; a card
+ opens the event in full under them, its
+ own page's blocks too (EventsBlock)
divider nothing
"Formatted" is InlineText.tsx: **bold**, *italic*, [text](url),
@@ -50,14 +52,18 @@
visible even if the renderer hasn't caught up with it.
═══════════════════════════════════════════════════════════════ */
+import { CaretDown } from '@phosphor-icons/react'
+import { useEffect, useId, useRef, useState } from 'react'
+import { Link } from 'react-router-dom'
+
import { mediaUrl } from '../lib/media.ts'
import PeopleTiles from './PeopleTiles.tsx'
import type { ContentBlock, ContentBlockItem, ItemEvent } from '../lib/useContent.ts'
import { Anchor, Inline, Paragraphs, isExternalUrl } from './InlineText.tsx'
import VideoPlayer from './VideoPlayer.tsx'
-import ScheduleBlock from './ScheduleBlock.tsx'
+import ScheduleBlock, { Avatar } from './ScheduleBlock.tsx'
import MapBlock, { PageMaps } from './MapBlock.tsx'
-import { eventHref } from '../lib/hrefs.ts'
+import { eventHref, personHref } from '../lib/hrefs.ts'
import { occurrenceLabel } from '../lib/eventSeries.ts'
import { accentText, BRAND } from '../lib/color.ts'
import { headingAnchors } from '../lib/contents.ts'
@@ -160,15 +166,34 @@ export function eventLine(event: ItemEvent): string | null {
return [kind, when].filter(Boolean).join(' · ') || null
}
-function EventCard({ item, accent }: { item: ContentBlockItem; accent: string }) {
+function EventCard({
+ item,
+ accent,
+ open,
+ panelId,
+ onToggle,
+}: {
+ item: ContentBlockItem
+ accent: string
+ open: boolean
+ panelId: string
+ onToggle: () => void
+}) {
const event = item.event!
const img = useSmallImage(mediaUrl(event.image))
const color = event.color || accent
const line = eventLine(event)
return (
-
{!img.failed && (
@@ -185,8 +210,101 @@ function EventCard({ item, accent }: { item: ContentBlockItem; accent: string })
{(item.detail || event.blurb) && (
{item.detail || event.blurb}
)}
+
+ {open ? 'Close' : 'More'}
+
+
-
+
+ )
+}
+
+/* An event in full (088): its photo, type and date, title, place and
+ person host, then its own page's blocks (else its card text), and
+ a link to its page. */
+function EventInFull({ item, accent, level }: { item: ContentBlockItem; accent: string; level: 3 | 4 | 5 }) {
+ const event = item.event!
+ const color = event.color || accent
+ const photo = mediaUrl(event.photo || event.image)
+ const line = eventLine(event)
+ const Title = `h${level}` as 'h3'
+ const blurb = item.detail || event.blurb
+ return (
+
+ {photo && }
+
+ {line && (
+
+ {line}
+
+ )}
+
{item.text || event.title}
+ {(event.location_label || item.person) && (
+
+ {event.location_label && {event.location_label} }
+ {item.person && (
+
+
+ {item.person.name}
+
+ )}
+
+ )}
+
+ {event.blocks?.length ? (
+
+ ) : blurb ? (
+
+ ) : null}
+
+ {event.title}: the event's page
+
+
+ )
+}
+
+/* An events block (088): its events as cards; one opened shows in
+ full under them, scrolled into view. Reading mode has them all in
+ full. */
+function EventsBlock({ items, accent, level }: { items: ContentBlockItem[]; accent: string; level: 3 | 4 | 5 }) {
+ const [open, setOpen] = useState(null)
+ const panelId = useId()
+ const panel = useRef(null)
+ const reading = useReadingMode()
+ useEffect(() => {
+ if (open != null) panel.current?.scrollIntoView({ behavior: 'smooth', block: 'nearest' })
+ }, [open])
+
+ if (reading) {
+ return (
+
+ {items.map((item, i) => (
+
+ ))}
+
+ )
+ }
+ return (
+
+
+ {items.map((item, i) => (
+
+ setOpen(open === i ? null : i)}
+ />
+
+ ))}
+
+
+ {open != null && items[open] && }
+
+
)
}
@@ -445,15 +563,7 @@ function Block({
case 'events': {
const events = (block.items ?? []).filter((item) => item.event)
if (events.length === 0) return null
- return (
-
- {events.map((item, i) => (
-
-
-
- ))}
-
- )
+ return
}
case 'people': {
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index fd5c42d..a9f8819 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -95,7 +95,13 @@ export type ItemEvent = {
date_label?: string | null
color?: string | null
image?: string | null
+ /** Its own 16:9 photo, and where it is, for showing it in full. */
+ photo?: string | null
+ photo_alt?: string | null
+ location_label?: string | null
blurb?: string | null
+ /** Its own page's blocks: an events block's events only. */
+ blocks?: ContentBlock[]
}
/** A schedule's tag (087). `tab` is whether it gets a tab of its own. */
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index b8a5d42..187fee2 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -14,8 +14,8 @@
venue each map block (088): the map with its locations
place then the map once per marked location, it lit up
cards each events block (088): its events on one slide
- event then each event alone: picture, title, card text
- and its person host
+ event then each event alone: picture, title, its person
+ host and its own page's blocks (else its card text)
A schedule's slides, for each day picked, in order:
overview the day's picked entries on one slide
@@ -1040,6 +1040,10 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
const event = entry.event!
const image = mediaUrl(event.image)
const blurb = entry.detail || event.blurb
+ // Its own page's blocks, when it has some, in place of its card
+ // text, zoomed for the column they're in.
+ const blocks = event.blocks?.length ? event.blocks : null
+ const zoom = Math.max(1, (window.innerWidth * 0.75) / TEXT_WIDTH)
return (
{image && (
@@ -1047,7 +1051,7 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
)}
-
+
{eventLine(event) && (
@@ -1060,15 +1064,8 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
{entry.text || event.title}
- {blurb && (
-
-
-
- )}
{entry.person && (
-
+
{entry.person.name}
@@ -1078,6 +1075,21 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
)}
+ {blocks ? (
+
+
+
+
+
+ ) : (
+ blurb && (
+
+
+
+ )
+ )}
)
From b8a744cf4160cc66e5980fcb09f79bab0e1ede55 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Wed, 11 Nov 2026 02:44:57 -0600
Subject: [PATCH 04/33] Event page: a contents list, a links heading,
full-width blocks; schedule tags in their own row
Migration 089 adds show_contents and links_heading to events (Page
group in the editor). The content blocks fill the column, beside the
contents list when it shows. A schedule's tag tabs sit in a row of
their own under the days, with a note on what they do.
Co-Authored-By: Claude Opus 5.5
---
server/src/admin-schema/events.js | 2 +
.../src/migrations/089_event_page_options.sql | 14 +++
server/src/routes/content.js | 9 +-
src/components/ScheduleBlock.tsx | 86 ++++++++++++-------
src/lib/adminSchema/events.ts | 16 ++++
src/lib/useContent.ts | 4 +
src/pages/EventDetail.tsx | 79 ++++++++++-------
7 files changed, 149 insertions(+), 61 deletions(-)
create mode 100644 server/src/migrations/089_event_page_options.sql
diff --git a/server/src/admin-schema/events.js b/server/src/admin-schema/events.js
index 253a1b8..3b5e791 100644
--- a/server/src/admin-schema/events.js
+++ b/server/src/admin-schema/events.js
@@ -67,6 +67,8 @@ export const events = {
bool("is_published"),
bool("is_listed"),
bool("in_timeline"),
+ bool("show_contents"),
+ text("links_heading"),
// A repeating schedule. Columns rather than a side table: the
// schedule is always exactly one per event, and the public view
diff --git a/server/src/migrations/089_event_page_options.sql b/server/src/migrations/089_event_page_options.sql
new file mode 100644
index 0000000..073c77e
--- /dev/null
+++ b/server/src/migrations/089_event_page_options.sql
@@ -0,0 +1,14 @@
+-- ═══════════════════════════════════════════════════════════════
+-- 089 EVENT PAGE OPTIONS
+--
+-- show_contents the page's headings listed beside its content
+-- blocks, as a blog post's are (PostContents.tsx)
+-- links_heading a heading above the event's link buttons; null
+-- shows none
+--
+-- v_events is SELECT e.*, so it carries both with no rebuild.
+-- ═══════════════════════════════════════════════════════════════
+
+ALTER TABLE events ADD COLUMN show_contents INTEGER NOT NULL DEFAULT 0
+ CHECK (show_contents IN (0, 1));
+ALTER TABLE events ADD COLUMN links_heading TEXT;
diff --git a/server/src/routes/content.js b/server/src/routes/content.js
index 3191e17..629192d 100644
--- a/server/src/routes/content.js
+++ b/server/src/routes/content.js
@@ -591,7 +591,14 @@ content.get("/events/:id", (c) => {
citation: r.citation,
}));
- const event = { ...shapeEvent(row, links, cards, hosts), blocks: body, people, awards };
+ const event = {
+ ...shapeEvent(row, links, cards, hosts),
+ show_contents: row.show_contents === 1,
+ links_heading: row.links_heading,
+ blocks: body,
+ people,
+ awards,
+ };
attachTags(db, "event", [event]);
return json(c, { event });
diff --git a/src/components/ScheduleBlock.tsx b/src/components/ScheduleBlock.tsx
index bc7ee4d..b5c838a 100644
--- a/src/components/ScheduleBlock.tsx
+++ b/src/components/ScheduleBlock.tsx
@@ -28,8 +28,8 @@
Tags (087) are the block's own: an entry or sub-item shows its
tags as chips, and each tag (unless it's set No tab) is a tab
- after the days, gathering what it's on from every day under the
- day's name. A tagged entry comes whole; an untagged block comes
+ in a row of its own under the days, with a note saying what it
+ does, gathering what it's on from every day under the day's name. A tagged entry comes whole; an untagged block comes
with only its tagged sub-items. A tag on nothing draws no tab.
An entry's place on the block's venue (088) links to the map
@@ -48,7 +48,7 @@
it, no map frame (ReadingSchedule).
═══════════════════════════════════════════════════════════════ */
-import { CaretDown, MapPin, Star } from '@phosphor-icons/react'
+import { CaretDown, MapPin, Star, Tag as TagIcon } from '@phosphor-icons/react'
import { Fragment, createContext, useContext, useId, useState, type KeyboardEvent, type ReactNode } from 'react'
import { Link, useLocation } from 'react-router-dom'
@@ -496,9 +496,41 @@ export default function ScheduleBlock({
.map((tag) => ({ label: tag.name, days: daysWithTag(days, tag.key), color: tag.color, tag: true }))
.filter((tab) => tab.days.length),
]
+ const dayCount = days.length
const at = Math.min(active, tabs.length - 1)
const current = tabs[at]
+ // A day's tab, or a tag's: smaller, its tag icon in front.
+ const tabButton = (tab: Tab, index: number) => {
+ const selected = index === at
+ const color = tab.color || accent
+ return (
+ setActive(index)}
+ onKeyDown={onKey}
+ className={
+ 'btn inline-flex items-center gap-1.5 border transition-colors ' +
+ (tab.tag ? 'px-3 py-1 text-xs' : 'px-5 py-2 text-sm')
+ }
+ style={
+ selected
+ ? { background: color, borderColor: color, color: readableOn(color) }
+ : { borderColor: withAlpha(color, 33), color: accentText(color) }
+ }
+ >
+ {tab.tag && }
+ {tab.label}
+
+ )
+ }
+
// Arrows move one tab and wrap; Home and End jump to the ends.
const onKey = (e: KeyboardEvent) => {
const last = tabs.length - 1
@@ -524,32 +556,28 @@ export default function ScheduleBlock({
)}
{tabs.length > 1 && (
-
- {tabs.map((tab, index) => {
- const selected = index === at
- const color = tab.color || accent
- return (
-
setActive(index)}
- onKeyDown={onKey}
- className="btn border px-5 py-2 text-sm transition-colors"
- style={
- selected
- ? { background: color, borderColor: color, color: readableOn(color) }
- : { borderColor: `${withAlpha(color, 33)}`, color: accentText(color) }
- }
- >
- {tab.label}
-
- )
- })}
+
+ {/* Days, then the tags in a row of their own: one tablist,
+ so the arrow keys still walk every tab. */}
+
+
+ {tabs.slice(0, dayCount).map((tab, index) => tabButton(tab, index))}
+
+ {tabs.length > dayCount && (
+
+
+
+ By tag
+
+ {tabs.slice(dayCount).map((tab, i) => tabButton(tab, dayCount + i))}
+
+ )}
+
+ {tabs.length > dayCount && (
+
+ Pick a tag to see everything it's on, from every day.
+
+ )}
)}
diff --git a/src/lib/adminSchema/events.ts b/src/lib/adminSchema/events.ts
index ad14084..a4babc0 100644
--- a/src/lib/adminSchema/events.ts
+++ b/src/lib/adminSchema/events.ts
@@ -173,6 +173,22 @@ export const events = {
},
],
},
+ {
+ legend: "Page",
+ fields: [
+ {
+ path: "show_contents",
+ label: "Show contents",
+ widget: "checkbox",
+ help: "Lists the content blocks' headings beside them, the one being read lit (a fold-out on phones), as on a blog post. Worth it with two or more headings.",
+ },
+ {
+ path: "links_heading",
+ label: "Links heading",
+ help: "Above the link buttons, eg. Sign up. Default: no heading.",
+ },
+ ],
+ },
timelineGroup("event"),
timelineDetailGroup("event"),
{ legend: "Publishing", fields: [PUBLISHED_FIELD, LISTED_FIELD] },
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index a9f8819..38ffde3 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -224,6 +224,10 @@ export type EventRecord = {
links: Link[]
/** The instagram link's label, the handle. See splitLinks in shape.js. */
instagram?: string | null
+ /** Its headings listed beside the blocks (089). */
+ show_contents?: boolean
+ /** Above the link buttons; null shows none (089). */
+ links_heading?: string | null
blocks: ContentBlock[]
people: EventPerson[]
awards: EventAward[]
diff --git a/src/pages/EventDetail.tsx b/src/pages/EventDetail.tsx
index 31c03a2..b51f0b5 100644
--- a/src/pages/EventDetail.tsx
+++ b/src/pages/EventDetail.tsx
@@ -22,6 +22,8 @@ import PageShell, { type ShellSection } from '../components/PageShell.tsx'
import PageState from '../components/PageState.tsx'
import PlatformIcon from '../components/PlatformIcon.tsx'
import ContentBlocks from '../components/ContentBlocks.tsx'
+import PostContents from '../components/PostContents.tsx'
+import { headingAnchors } from '../lib/contents.ts'
import Tags from '../components/Tags.tsx'
import PeopleTiles, { type PeopleGroupInput } from '../components/PeopleTiles.tsx'
import {
@@ -89,6 +91,9 @@ export default function EventDetail() {
const accent = event.color || BRAND
const groups = peopleGroups(event.people, accent)
+ // Two headings or more make a list worth showing, as on a post.
+ const contents = event.show_contents ? headingAnchors(event.blocks).entries : []
+ const withContents = contents.length >= 2
const sections: ShellSection[] = [
{
@@ -109,40 +114,52 @@ export default function EventDetail() {
/>
)}
-
- {/* The page as a slideshow for a screen (EventPresent.tsx). */}
- {event.blocks.length > 0 && (
-
-
-
- Present
-
(opens in a new tab)
-
-
- )}
-
+ {/* The blocks take the column's whole width, beside the
+ contents list when it shows. */}
+
+ {withContents &&
}
+
+ {/* The page as a slideshow for a screen (EventPresent.tsx). */}
+ {event.blocks.length > 0 && (
+
+
+
+ Present
+
(opens in a new tab)
+
+
+ )}
+
+
{event.links.length > 0 && (
-
- {event.links.map((link) => (
-
-
- {link.label}
-
- ))}
+
+ {event.links_heading && (
+
+ {event.links_heading}
+
+ )}
+
)}
From a7495f09e5cd7c846ff6b5a8cfb6885e6ffd68a8 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Wed, 11 Nov 2026 02:48:26 -0600
Subject: [PATCH 05/33] Event page: the photo fills the column, as the blocks
do
Co-Authored-By: Claude Opus 5.5
---
src/pages/EventDetail.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pages/EventDetail.tsx b/src/pages/EventDetail.tsx
index b51f0b5..ce90497 100644
--- a/src/pages/EventDetail.tsx
+++ b/src/pages/EventDetail.tsx
@@ -110,7 +110,7 @@ export default function EventDetail() {
)}
From 8a792069984c48300dd66166ccd2af80af9acde7 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Wed, 11 Nov 2026 02:57:26 -0600
Subject: [PATCH 06/33] Events block: featured events open in full above the
cards, under a heading
Migration 090 adds heading and subheading to content_block_items. An
events block's item ticked Featured shows in full above the cards,
under its heading and subheading when set.
Co-Authored-By: Claude Opus 5.5
---
server/src/admin-schema/columns.js | 3 +
.../migrations/090_featured_event_items.sql | 15 ++++
server/src/shape.js | 11 ++-
src/components/ContentBlocks.tsx | 75 ++++++++++++-------
src/lib/adminSchema/shared.ts | 9 +++
src/lib/useContent.ts | 3 +
6 files changed, 88 insertions(+), 28 deletions(-)
create mode 100644 server/src/migrations/090_featured_event_items.sql
diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js
index f15ffa7..80e5956 100644
--- a/server/src/admin-schema/columns.js
+++ b/server/src/admin-schema/columns.js
@@ -207,6 +207,9 @@ export const blocksChild = (ownerKind) => ({
// block's venue map (088).
text("event_id"),
text("location_key"),
+ // A featured event's heading and subheading (090).
+ text("heading"),
+ text("subheading"),
],
children: [
{
diff --git a/server/src/migrations/090_featured_event_items.sql b/server/src/migrations/090_featured_event_items.sql
new file mode 100644
index 0000000..864615d
--- /dev/null
+++ b/server/src/migrations/090_featured_event_items.sql
@@ -0,0 +1,15 @@
+-- ═══════════════════════════════════════════════════════════════
+-- 090 FEATURED EVENTS IN AN EVENTS BLOCK
+--
+-- An events block's item ticked Featured (086's `featured`) shows
+-- opened in full above the cards, under its own heading and
+-- subheading, both optional:
+--
+-- heading eg. This year's keynote
+-- subheading a line under it
+--
+-- Other item kinds ignore both.
+-- ═══════════════════════════════════════════════════════════════
+
+ALTER TABLE content_block_items ADD COLUMN heading TEXT;
+ALTER TABLE content_block_items ADD COLUMN subheading TEXT;
diff --git a/server/src/shape.js b/server/src/shape.js
index f3f89cd..0afbd86 100644
--- a/server/src/shape.js
+++ b/server/src/shape.js
@@ -116,7 +116,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
const itemRows = db
.prepare(
- `SELECT i.id, i.block_id, i.day, i.kind, ${ENTRY_FIELDS}
+ `SELECT i.id, i.block_id, i.day, i.kind, i.heading, i.subheading, ${ENTRY_FIELDS}
FROM content_block_items i
LEFT JOIN v_people_public p ON p.id = i.person_id AND p.is_published = 1
WHERE i.block_id IN (${placeholders(blockIds.length)})
@@ -128,7 +128,14 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
// ride along anyway rather than branching on the block's type.
const itemsById = new Map();
for (const row of itemRows) {
- const item = { ...scheduleEntry(row), day: row.day, kind: row.kind ?? "entry", items: [] };
+ const item = {
+ ...scheduleEntry(row),
+ day: row.day,
+ kind: row.kind ?? "entry",
+ heading: row.heading,
+ subheading: row.subheading,
+ items: [],
+ };
itemsById.set(row.id, item);
byId.get(row.block_id)?.items.push(item);
}
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index 9fb8e65..8b0ebbc 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -266,8 +266,9 @@ function EventInFull({ item, accent, level }: { item: ContentBlockItem; accent:
}
/* An events block (088): its events as cards; one opened shows in
- full under them, scrolled into view. Reading mode has them all in
- full. */
+ full under them, scrolled into view. A featured one (090) is
+ already open, above the cards, under its own heading and
+ subheading. Reading mode has them all in full. */
function EventsBlock({ items, accent, level }: { items: ContentBlockItem[]; accent: string; level: 3 | 4 | 5 }) {
const [open, setOpen] = useState(null)
const panelId = useId()
@@ -277,33 +278,55 @@ function EventsBlock({ items, accent, level }: { items: ContentBlockItem[]; acce
if (open != null) panel.current?.scrollIntoView({ behavior: 'smooth', block: 'nearest' })
}, [open])
- if (reading) {
- return (
-
- {items.map((item, i) => (
-
- ))}
-
- )
- }
+ const featured = reading ? items : items.filter((item) => item.featured)
+ const cards = reading ? [] : items.filter((item) => !item.featured)
+
return (
-
- {items.map((item, i) => (
-
- setOpen(open === i ? null : i)}
- />
-
- ))}
-
-
- {open != null && items[open] &&
}
+ {featured.map((item, i) => (
+
+ ))}
+ {cards.length > 0 && (
+ <>
+
+ {cards.map((item, i) => (
+
+ setOpen(open === i ? null : i)}
+ />
+
+ ))}
+
+
+ {open != null && cards[open] && }
+
+ >
+ )}
+
+ )
+}
+
+/* A featured event: its heading and subheading, if set, then the
+ event in full, its title a level under the heading. */
+function FeaturedEvent({ item, accent, level }: { item: ContentBlockItem; accent: string; level: 3 | 4 | 5 }) {
+ if (!item.heading && !item.subheading) return
+ const Heading = `h${level}` as 'h3'
+ const color = item.event?.color || accent
+ return (
+
+
+ {item.heading && (
+
+ {item.heading}
+
+ )}
+ {item.subheading &&
{item.subheading}
}
+
)
}
diff --git a/src/lib/adminSchema/shared.ts b/src/lib/adminSchema/shared.ts
index cf1fddb..ec9c3ab 100644
--- a/src/lib/adminSchema/shared.ts
+++ b/src/lib/adminSchema/shared.ts
@@ -760,6 +760,15 @@ export const blocksChild = {
},
{ path: "featured", label: "Featured", widget: "checkbox", help: "Makes the row stand out", when: SCHEDULE_ENTRY },
{ ...TAGS_FIELD, when: SCHEDULE_ENTRY },
+ {
+ path: "featured",
+ label: "Featured",
+ widget: "checkbox",
+ help: "Shows it opened in full above the cards, under the heading and subheading below",
+ when: EVENT_ITEM,
+ },
+ { path: "heading", label: "Heading", help: "Featured only, eg. This year's keynote. Default: none", when: EVENT_ITEM },
+ { path: "subheading", label: "Subheading", help: "Featured only: a line under the heading. Default: none", full: true, when: EVENT_ITEM },
],
children: [
{
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index 38ffde3..4605ee0 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -130,6 +130,9 @@ export type ContentBlockItem = {
start_time?: string | null
end_time?: string | null
featured?: boolean
+ /** A featured event's heading and subheading (090). */
+ heading?: string | null
+ subheading?: string | null
/** A block entry's sub-items. */
items?: ContentBlockItem[]
/** Its block's tags it has, by key (087). */
From 6a0271efd99e5f98f3edb53b4ac48c0ab0ae99bc Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Wed, 11 Nov 2026 03:04:14 -0600
Subject: [PATCH 07/33] Map block: Google and Apple Maps buttons, a zoomable
picture, links land at the map's top
Migration 091 adds google_maps_url and apple_maps_url to
venue_locations, shown as buttons at the right of each location's
row. The picture zooms (1x to 4x) and scrolls in its box. A link to a
location now scrolls to the top of the map block, not the mark.
Co-Authored-By: Claude Opus 5.5
---
server/src/admin-schema/venues.js | 5 +-
.../src/migrations/091_location_map_links.sql | 10 ++
server/src/shape.js | 2 +-
src/components/MapBlock.tsx | 110 ++++++++++++++++--
src/lib/adminSchema/venues.ts | 10 ++
src/lib/useContent.ts | 3 +
6 files changed, 128 insertions(+), 12 deletions(-)
create mode 100644 server/src/migrations/091_location_map_links.sql
diff --git a/server/src/admin-schema/venues.js b/server/src/admin-schema/venues.js
index 2525229..932f433 100644
--- a/server/src/admin-schema/venues.js
+++ b/server/src/admin-schema/venues.js
@@ -1,4 +1,4 @@
-import { text, real } from "./columns.js";
+import { text, real, url } from "./columns.js";
/* ── Venues (088_venues.sql) ─────────────────────────────────────
@@ -38,6 +38,9 @@ export const venues = {
real("y"),
real("w"),
real("h"),
+ // The place in Google and Apple Maps (091).
+ url("google_maps_url"),
+ url("apple_maps_url"),
],
},
],
diff --git a/server/src/migrations/091_location_map_links.sql b/server/src/migrations/091_location_map_links.sql
new file mode 100644
index 0000000..ddeb57f
--- /dev/null
+++ b/server/src/migrations/091_location_map_links.sql
@@ -0,0 +1,10 @@
+-- ═══════════════════════════════════════════════════════════════
+-- 091 A VENUE LOCATION'S MAP LINKS
+--
+-- Each location on a venue's map can link to the same place in
+-- Google Maps and Apple Maps, shown as buttons beside it in a map
+-- block's list. Null shows no button.
+-- ═══════════════════════════════════════════════════════════════
+
+ALTER TABLE venue_locations ADD COLUMN google_maps_url TEXT;
+ALTER TABLE venue_locations ADD COLUMN apple_maps_url TEXT;
diff --git a/server/src/shape.js b/server/src/shape.js
index 0afbd86..2d31f80 100644
--- a/server/src/shape.js
+++ b/server/src/shape.js
@@ -202,7 +202,7 @@ function attachVenues(db, blocks) {
);
const locationRows = db
.prepare(
- `SELECT venue_id, location_key AS key, name, detail, x, y, w, h
+ `SELECT venue_id, location_key AS key, name, detail, x, y, w, h, google_maps_url, apple_maps_url
FROM venue_locations
WHERE venue_id IN (${placeholders(ids.length)})
ORDER BY venue_id, sort_order`,
diff --git a/src/components/MapBlock.tsx b/src/components/MapBlock.tsx
index bb704f3..036c168 100644
--- a/src/components/MapBlock.tsx
+++ b/src/components/MapBlock.tsx
@@ -9,9 +9,14 @@
they stay on their places at any width. A location is lit up
(in the accent, the rest dimmed) while its row or mark is hovered
or focused, and when the address points at it: #map--,
- the link a schedule entry's place makes (mapAnchor). That id is
- the mark's own, so Layout's jump to the anchor scrolls it into
- view and focuses it.
+ the link a schedule entry's place makes (mapAnchor). Those ids
+ sit at the block's top, so Layout's jump to the anchor brings the
+ whole map into view, not the mark at the top of the screen.
+
+ The picture zooms (the buttons over it), scrolling inside its box
+ when it's bigger than it; the marks are in percent, so they keep
+ their places. A location's Google and Apple Maps links (091) are
+ buttons at the right of its row.
MapPicture is the picture and its marks alone; the event's
presentation (EventPresent.tsx) draws it too, with no links.
@@ -23,7 +28,8 @@
when there's a map on the page to go to.
═══════════════════════════════════════════════════════════════ */
-import { createContext, useState, type CSSProperties } from 'react'
+import { createContext, useState, type CSSProperties, type ReactNode } from 'react'
+import { AppleLogo, ArrowsIn, GoogleLogo, MagnifyingGlassMinus, MagnifyingGlassPlus } from '@phosphor-icons/react'
import { Link, useLocation, type To } from 'react-router-dom'
import { mediaUrl } from '../lib/media.ts'
@@ -35,6 +41,9 @@ export const PageMaps = createContext>(new Set())
export const mapAnchor = (venueId: string, key: string) => `map-${venueId}-${key}`
+/* The picture's zoom steps, 1 the column's width. */
+const ZOOMS = [1, 1.5, 2, 3, 4]
+
const isBox = (location: VenueLocation) => location.w != null && location.h != null
export const isMarked = (location: VenueLocation) => location.x != null && location.y != null
@@ -143,7 +152,6 @@ export function MapPicture({
return link ? (
(null)
+ const [zoom, setZoom] = useState(0)
const fromHash = venue.locations.find((location) => hash === `#${mapAnchor(venue.id, location.key)}`)?.key ?? null
const active = hovered ?? fromHash
const picture = !useReadingMode() && Boolean(venue.map_image)
@@ -178,8 +187,34 @@ export default function MapBlock({ venue, accent }: { venue: Venue; accent: stri
})
return (
-
- {picture && }
+
+ {/* Where a link to a location lands: the map's top. */}
+ {venue.locations.map((location) => (
+
+ ))}
+
+ {picture && (
+
+
+
+
setZoom(zoom + 1)}>
+
+
+
setZoom(zoom - 1)}>
+
+
+ {zoom > 0 && (
+
setZoom(0)}>
+
+
+ )}
+
+
+ )}
{venue.name}
@@ -201,14 +236,15 @@ export default function MapBlock({ venue, accent }: { venue: Venue; accent: stri
const rowClass = 'flex items-start gap-3 px-2 py-1.5 text-body'
const rowStyle = on ? { background: withAlpha(accent, 12) } : undefined
return (
-
+
{isMarked(location) ? (
-
+
{row}
) : (
- {row}
+ {row}
)}
+
)
})}
@@ -217,3 +253,57 @@ export default function MapBlock({ venue, accent }: { venue: Venue; accent: stri
)
}
+
+/* A zoom button over the map picture. */
+function ZoomButton({
+ label,
+ disabled,
+ onClick,
+ children,
+}: {
+ label: string
+ disabled?: boolean
+ onClick: () => void
+ children: ReactNode
+}) {
+ return (
+
+ {children}
+
+ )
+}
+
+/* A location's Google and Apple Maps links (091), as buttons that
+ open them in a new tab. */
+function MapLinks({ location, accent }: { location: VenueLocation; accent: string }) {
+ const links = [
+ { href: location.google_maps_url, label: 'Google Maps', Icon: GoogleLogo },
+ { href: location.apple_maps_url, label: 'Apple Maps', Icon: AppleLogo },
+ ].filter((link) => link.href)
+ if (links.length === 0) return null
+ return (
+
+ {links.map(({ href, label, Icon }) => (
+
+
+
+ ))}
+
+ )
+}
diff --git a/src/lib/adminSchema/venues.ts b/src/lib/adminSchema/venues.ts
index 5b05189..f419c2e 100644
--- a/src/lib/adminSchema/venues.ts
+++ b/src/lib/adminSchema/venues.ts
@@ -66,6 +66,16 @@ export const venues = {
full: true,
help: "Click the map for a pin, or drag out a box for an area. Default: listed, not marked.",
},
+ {
+ path: "google_maps_url",
+ label: "Google Maps link",
+ help: "eg. https://maps.app.goo.gl/... Shown as a button beside it. Default: none",
+ },
+ {
+ path: "apple_maps_url",
+ label: "Apple Maps link",
+ help: "eg. https://maps.apple.com/?... Shown as a button beside it. Default: none",
+ },
],
},
],
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index 4605ee0..be9c0e4 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -82,6 +82,9 @@ export type VenueLocation = {
y?: number | null
w?: number | null
h?: number | null
+ /** The place in Google and Apple Maps (091). */
+ google_maps_url?: string | null
+ apple_maps_url?: string | null
}
/** An event an item names (088): an events block's card, or the
From e9ea75a68d62c820d218f69fce613c641f4aa86b Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Wed, 11 Nov 2026 03:20:00 -0600
Subject: [PATCH 08/33] List block: bold text and a plain detail by default,
with a Style to keep the old look
Migration 092 adds content_blocks.list_style: blank is bold text and
a detail in the body color, 'plain' the plain text and gray detail
lists had before.
Co-Authored-By: Claude Opus 5.5
---
docs/updating-data-in-code.md | 1 +
server/src/admin-schema/columns.js | 2 ++
server/src/migrations/092_list_style.sql | 13 ++++++++++++
server/src/shape.js | 3 ++-
src/components/ContentBlocks.tsx | 26 +++++++++++++++---------
src/lib/adminSchema/shared.ts | 8 ++++++++
src/lib/useContent.ts | 2 ++
7 files changed, 44 insertions(+), 11 deletions(-)
create mode 100644 server/src/migrations/092_list_style.sql
diff --git a/docs/updating-data-in-code.md b/docs/updating-data-in-code.md
index 6a629b9..8fa6a36 100644
--- a/docs/updating-data-in-code.md
+++ b/docs/updating-data-in-code.md
@@ -183,6 +183,7 @@ also in `server/src/admin-schema/` and a CHECK):
| Content blocks → Shown in (slot) | card, body | **yes** | `paragraphs()` in `server/src/shape.js` (card), `ContentBlocks.tsx` (body) |
| Content blocks → Type | heading, subheading, paragraph, list, links, quote, image, divider, video, button, callout, schedule, table, cards, people, map, events | **yes**, `BLOCK_TYPES` (with each type's description) | `ContentBlocks.tsx` (one renderer per type). Which fields each type shows is `when` on the fields in `blocksChild` (`src/lib/adminSchema/shared.ts`). |
| Content blocks → Schedule items → Type | (blank: normal entry), block, break, heading | **yes**, migration 086 | `SCHEDULE_KINDS` in `src/lib/adminSchema/shared.ts`; drawn by `ScheduleBlock.tsx` and `EventPresent.tsx` (which slides each kind gets; the presentation cuts the event's page into sections at its Heading blocks). A block's sub-items are `content_block_subitems`. A schedule's own tags (087) are `content_block_tags`, rows of the block typed in the admin (not a fixed list); entries name them by `tag_key`, made in the admin as the tag is added. A schedule's Venue (088) lends its locations (Data → Venues, `venue_locations`) to its entries' Map location, named by `location_key` the same way; an entry's Event (a workshop) fills what it leaves blank in `shape.js` (`attachEvents`). |
+| Content blocks → List → Style | (blank: bold text, normal detail), plain (plain text, gray detail) | **yes**, migration 092 | The Style field in `src/lib/adminSchema/shared.ts`; drawn by the `list` case in `ContentBlocks.tsx`. |
| Timeline → Kind (+ list filter) | milestone, event, organization, award, people | no | `KIND_NAMES` in `src/pages/sections/history/TimelineEntry.tsx` |
| Timeline → Points at (+ list filter) | event, organization, award, person, team | no | `refHref` in `src/lib/hrefs.ts` |
| Timeline → Precision (and on events/orgs) | year, month, day | no | the history page's grouping |
diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js
index 80e5956..6b37c79 100644
--- a/server/src/admin-schema/columns.js
+++ b/server/src/admin-schema/columns.js
@@ -175,6 +175,8 @@ export const blocksChild = (ownerKind) => ({
text("team_id"),
// Map and schedule blocks (088): whose map and locations.
text("venue_id"),
+ // List blocks (092): null bold text, 'plain' the old look.
+ enumeration("list_style", ["plain"]),
],
children: [
{
diff --git a/server/src/migrations/092_list_style.sql b/server/src/migrations/092_list_style.sql
new file mode 100644
index 0000000..5865aae
--- /dev/null
+++ b/server/src/migrations/092_list_style.sql
@@ -0,0 +1,13 @@
+-- ═══════════════════════════════════════════════════════════════
+-- 092 A LIST BLOCK'S STYLE
+--
+-- How a list block's items read:
+--
+-- null the item's text bold, its detail in the body color
+-- plain the text plain, the detail gray (the look before 092)
+--
+-- Other block types ignore it.
+-- ═══════════════════════════════════════════════════════════════
+
+ALTER TABLE content_blocks ADD COLUMN list_style TEXT
+ CHECK (list_style IN ('plain'));
diff --git a/server/src/shape.js b/server/src/shape.js
index 2d31f80..739e9b2 100644
--- a/server/src/shape.js
+++ b/server/src/shape.js
@@ -71,7 +71,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
const blockRows = db
.prepare(
`SELECT id, owner_id, type, text, media, href, alt, cite, captions, team_id, venue_id,
- word_motion, word_direction, word_seconds
+ word_motion, word_direction, word_seconds, list_style
FROM content_blocks
WHERE owner_kind = ? AND slot IN (?, 'both') AND owner_id IN (${placeholders(ids.length)})
ORDER BY owner_id, sort_order`,
@@ -93,6 +93,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
captions: row.captions,
team_id: row.team_id,
venue_id: row.venue_id,
+ list_style: row.list_style,
// Its rotating words' motion (084), when it has its own.
words: row.word_motion || row.word_direction || row.word_seconds
? { motion: row.word_motion, direction: row.word_direction, seconds: row.word_seconds }
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index 8b0ebbc..c3f96de 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -389,7 +389,10 @@ function Block({
)
- case 'list':
+ case 'list': {
+ // Bold text and a plain detail, unless the block is set Plain
+ // (092): plain text, gray detail.
+ const plain = block.list_style === 'plain'
return (
{(block.items ?? []).map((item, index) => (
@@ -397,20 +400,23 @@ function Block({
•
-
- {item.url ? (
-
- {item.text}
-
- ) : (
-
- )}
- {item.detail && : {item.detail} }
+
+
+ {item.url ? (
+
+ {item.text}
+
+ ) : (
+
+ )}
+
+ {item.detail && : {item.detail} }
))}
)
+ }
case 'links':
return (
diff --git a/src/lib/adminSchema/shared.ts b/src/lib/adminSchema/shared.ts
index ec9c3ab..49e70b9 100644
--- a/src/lib/adminSchema/shared.ts
+++ b/src/lib/adminSchema/shared.ts
@@ -529,6 +529,14 @@ export const blocksChild = {
when: { path: "type", value: TEXT_TYPES },
help: (row) => TEXT_HELP[row?.type],
},
+ {
+ path: "list_style",
+ label: "Style",
+ widget: "select",
+ options: [["plain", "Plain text, gray detail"]],
+ blankLabel: "Default: bold text, normal detail",
+ when: { path: "type", value: "list" },
+ },
{
path: "cite",
label: "Attribution",
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index be9c0e4..dc08f72 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -54,6 +54,8 @@ export type ContentBlock = {
team_id?: string | null
/** Who a quote is by. */
cite?: string | null
+ /** A list block's style (092): null bold text, 'plain' the old look. */
+ list_style?: 'plain' | null
/** A video block's WebVTT file, for an uploaded video (066). */
captions?: string | null
items?: ContentBlockItem[]
From bd271ef02dd59423bfbb50484f3bd1f66230271a Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Wed, 11 Nov 2026 03:23:58 -0600
Subject: [PATCH 09/33] Organizations block: the Partners page's cards, picked
one by one or every one of a kind
Migration 093 adds the 'organizations' block type (rebuilding
content_blocks for its CHECK, as 088 did), content_blocks.org_kind and
content_block_items.org_id. OrgListCards takes `nested` for a block:
no page gutter, names a level under the block's heading.
Co-Authored-By: Claude Opus 5.5
---
docs/updating-data-in-code.md | 3 +-
server/src/admin-schema/columns.js | 6 ++
.../migrations/093_organizations_block.sql | 91 +++++++++++++++++++
server/src/shape.js | 6 +-
src/components/ContentBlocks.tsx | 17 ++++
src/lib/adminSchema/shared.ts | 31 ++++++-
src/lib/useContent.ts | 5 +
src/pages/sections/OrgList-Card.tsx | 36 ++++++--
8 files changed, 182 insertions(+), 13 deletions(-)
create mode 100644 server/src/migrations/093_organizations_block.sql
diff --git a/docs/updating-data-in-code.md b/docs/updating-data-in-code.md
index 8fa6a36..9fa4888 100644
--- a/docs/updating-data-in-code.md
+++ b/docs/updating-data-in-code.md
@@ -181,9 +181,10 @@ also in `server/src/admin-schema/` and a CHECK):
| Links → Kind (on organizations, events, people, teams) | action, social, website, email | no | `splitLinks` in `server/src/shape.js` |
| Links → Platform | instagram, facebook, discord, youtube, tiktok, x, substack, spotify, linkedin | **yes**, `PLATFORMS` | `PlatformIcon.tsx` draws the icon on the button. **No CHECK and no `enumeration`**: the column is plain text, so adding one is an entry in `PLATFORMS` (`src/lib/platforms.ts`) and its icon in `src/components/PlatformIcon.tsx`, no migration. |
| Content blocks → Shown in (slot) | card, body | **yes** | `paragraphs()` in `server/src/shape.js` (card), `ContentBlocks.tsx` (body) |
-| Content blocks → Type | heading, subheading, paragraph, list, links, quote, image, divider, video, button, callout, schedule, table, cards, people, map, events | **yes**, `BLOCK_TYPES` (with each type's description) | `ContentBlocks.tsx` (one renderer per type). Which fields each type shows is `when` on the fields in `blocksChild` (`src/lib/adminSchema/shared.ts`). |
+| Content blocks → Type | heading, subheading, paragraph, list, links, quote, image, divider, video, button, callout, schedule, table, cards, people, map, events, organizations | **yes**, `BLOCK_TYPES` (with each type's description) | `ContentBlocks.tsx` (one renderer per type). Which fields each type shows is `when` on the fields in `blocksChild` (`src/lib/adminSchema/shared.ts`). |
| Content blocks → Schedule items → Type | (blank: normal entry), block, break, heading | **yes**, migration 086 | `SCHEDULE_KINDS` in `src/lib/adminSchema/shared.ts`; drawn by `ScheduleBlock.tsx` and `EventPresent.tsx` (which slides each kind gets; the presentation cuts the event's page into sections at its Heading blocks). A block's sub-items are `content_block_subitems`. A schedule's own tags (087) are `content_block_tags`, rows of the block typed in the admin (not a fixed list); entries name them by `tag_key`, made in the admin as the tag is added. A schedule's Venue (088) lends its locations (Data → Venues, `venue_locations`) to its entries' Map location, named by `location_key` the same way; an entry's Event (a workshop) fills what it leaves blank in `shape.js` (`attachEvents`). |
| Content blocks → List → Style | (blank: bold text, normal detail), plain (plain text, gray detail) | **yes**, migration 092 | The Style field in `src/lib/adminSchema/shared.ts`; drawn by the `list` case in `ContentBlocks.tsx`. |
+| Content blocks → Organizations → List | (blank: only the picked ones), partner, region, group, ministry | **yes**, migration 093 | The `org_kind` field in `src/lib/adminSchema/shared.ts`; the `organizations` case in `ContentBlocks.tsx` passes it as the kind to `OrgListCards` (`nested`); items picked by `org_id` replace it |
| Timeline → Kind (+ list filter) | milestone, event, organization, award, people | no | `KIND_NAMES` in `src/pages/sections/history/TimelineEntry.tsx` |
| Timeline → Points at (+ list filter) | event, organization, award, person, team | no | `refHref` in `src/lib/hrefs.ts` |
| Timeline → Precision (and on events/orgs) | year, month, day | no | the history page's grouping |
diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js
index 6b37c79..16f989f 100644
--- a/server/src/admin-schema/columns.js
+++ b/server/src/admin-schema/columns.js
@@ -157,6 +157,8 @@ export const blocksChild = (ownerKind) => ({
// A venue's map, and event cards (088).
"map",
"events",
+ // Organization cards (093).
+ "organizations",
],
{ required: true },
),
@@ -177,6 +179,8 @@ export const blocksChild = (ownerKind) => ({
text("venue_id"),
// List blocks (092): null bold text, 'plain' the old look.
enumeration("list_style", ["plain"]),
+ // Organizations blocks (093): the kind listed when none are picked.
+ enumeration("org_kind", ["region", "group", "partner", "ministry"]),
],
children: [
{
@@ -212,6 +216,8 @@ export const blocksChild = (ownerKind) => ({
// A featured event's heading and subheading (090).
text("heading"),
text("subheading"),
+ // An organizations block's organization (093).
+ text("org_id"),
],
children: [
{
diff --git a/server/src/migrations/093_organizations_block.sql b/server/src/migrations/093_organizations_block.sql
new file mode 100644
index 0000000..b2d6b6e
--- /dev/null
+++ b/server/src/migrations/093_organizations_block.sql
@@ -0,0 +1,91 @@
+-- ═══════════════════════════════════════════════════════════════
+-- 093 ORGANIZATIONS BLOCK
+--
+-- An 'organizations' content block shows organizations as the
+-- Partners page's cards (OrgList-Card.tsx): the ones picked as its
+-- items, in their order (content_block_items.org_id), else every
+-- published, listed one of its kind (content_blocks.org_kind), by
+-- name.
+--
+-- content_blocks.type's CHECK can't change in place, so the table
+-- is rebuilt (as in 088), then its index and owner trigger made
+-- again.
+-- ═══════════════════════════════════════════════════════════════
+
+ALTER TABLE content_block_items ADD COLUMN org_id TEXT
+ REFERENCES organizations (id) ON DELETE SET NULL;
+
+CREATE TABLE content_blocks_new (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ owner_kind TEXT NOT NULL
+ CHECK (owner_kind IN ('organization', 'event', 'person', 'team', 'blog_post', 'page_section',
+ 'newsletter')),
+ owner_id TEXT NOT NULL,
+ slot TEXT NOT NULL DEFAULT 'body' CHECK (slot IN ('card', 'body', 'both')),
+ sort_order INTEGER NOT NULL DEFAULT 0,
+
+ type TEXT NOT NULL
+ CHECK (type IN ('heading', 'subheading', 'paragraph',
+ 'list', 'links', 'quote', 'image', 'divider',
+ 'video', 'button', 'callout', 'schedule', 'table', 'cards',
+ 'people', 'tab', 'map', 'events', 'organizations')),
+ text TEXT,
+ media TEXT,
+ href TEXT,
+ alt TEXT,
+ cite TEXT,
+ team_id TEXT REFERENCES teams (id) ON DELETE SET NULL,
+ captions TEXT,
+ word_motion TEXT CHECK (word_motion IN ('slide', 'flip', 'fade', 'type', 'mirror')),
+ word_direction TEXT CHECK (word_direction IN ('top', 'bottom')),
+ word_seconds INTEGER CHECK (word_seconds BETWEEN 1 AND 20),
+ -- Map and schedule blocks: whose map, and whose locations.
+ venue_id TEXT REFERENCES venues (id) ON DELETE SET NULL,
+ -- List blocks (092): null bold text, 'plain' the old look.
+ list_style TEXT CHECK (list_style IN ('plain')),
+ -- Organizations blocks: the kind listed when none are picked.
+ org_kind TEXT CHECK (org_kind IN ('region', 'group', 'partner', 'ministry'))
+) STRICT;
+
+INSERT INTO content_blocks_new
+ (id, owner_kind, owner_id, slot, sort_order, type, text, media, href, alt, cite, team_id, captions,
+ word_motion, word_direction, word_seconds, venue_id, list_style)
+SELECT id, owner_kind, owner_id, slot, sort_order, type, text, media, href, alt, cite, team_id, captions,
+ word_motion, word_direction, word_seconds, venue_id, list_style
+ FROM content_blocks;
+
+PRAGMA legacy_alter_table = ON;
+DROP TABLE content_blocks;
+ALTER TABLE content_blocks_new RENAME TO content_blocks;
+PRAGMA legacy_alter_table = OFF;
+
+CREATE INDEX content_blocks_owner_idx
+ ON content_blocks (owner_kind, owner_id, slot, sort_order);
+
+CREATE TRIGGER content_blocks_owner_exists
+BEFORE INSERT ON content_blocks
+BEGIN
+ SELECT CASE
+ WHEN new.owner_kind = 'event'
+ AND NOT EXISTS (SELECT 1 FROM events WHERE id = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such event')
+ WHEN new.owner_kind = 'organization'
+ AND NOT EXISTS (SELECT 1 FROM organizations WHERE id = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such organization')
+ WHEN new.owner_kind = 'person'
+ AND NOT EXISTS (SELECT 1 FROM people WHERE id = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such person')
+ WHEN new.owner_kind = 'team'
+ AND NOT EXISTS (SELECT 1 FROM teams WHERE id = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such team')
+ WHEN new.owner_kind = 'blog_post'
+ AND NOT EXISTS (SELECT 1 FROM blog_posts WHERE id = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such blog post')
+ WHEN new.owner_kind = 'page_section'
+ AND NOT EXISTS (SELECT 1 FROM page_sections WHERE CAST(id AS TEXT) = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such page section')
+ WHEN new.owner_kind = 'newsletter'
+ AND NOT EXISTS (SELECT 1 FROM newsletters WHERE CAST(id AS TEXT) = new.owner_id)
+ THEN RAISE(ABORT, 'content_blocks: no such newsletter')
+ END;
+END;
diff --git a/server/src/shape.js b/server/src/shape.js
index 739e9b2..64f7c76 100644
--- a/server/src/shape.js
+++ b/server/src/shape.js
@@ -71,7 +71,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
const blockRows = db
.prepare(
`SELECT id, owner_id, type, text, media, href, alt, cite, captions, team_id, venue_id,
- word_motion, word_direction, word_seconds, list_style
+ word_motion, word_direction, word_seconds, list_style, org_kind
FROM content_blocks
WHERE owner_kind = ? AND slot IN (?, 'both') AND owner_id IN (${placeholders(ids.length)})
ORDER BY owner_id, sort_order`,
@@ -94,6 +94,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
team_id: row.team_id,
venue_id: row.venue_id,
list_style: row.list_style,
+ org_kind: row.org_kind,
// Its rotating words' motion (084), when it has its own.
words: row.word_motion || row.word_direction || row.word_seconds
? { motion: row.word_motion, direction: row.word_direction, seconds: row.word_seconds }
@@ -117,7 +118,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
const itemRows = db
.prepare(
- `SELECT i.id, i.block_id, i.day, i.kind, i.heading, i.subheading, ${ENTRY_FIELDS}
+ `SELECT i.id, i.block_id, i.day, i.kind, i.heading, i.subheading, i.org_id, ${ENTRY_FIELDS}
FROM content_block_items i
LEFT JOIN v_people_public p ON p.id = i.person_id AND p.is_published = 1
WHERE i.block_id IN (${placeholders(blockIds.length)})
@@ -135,6 +136,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
kind: row.kind ?? "entry",
heading: row.heading,
subheading: row.subheading,
+ org_id: row.org_id,
items: [],
};
itemsById.set(row.id, item);
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index c3f96de..57a11a7 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -71,6 +71,7 @@ import { SITE_NAME } from '../lib/site.ts'
import { useSmallImage } from '../lib/useSmallImage.ts'
import { useReadingMode } from '../lib/readingMode.ts'
import { WordMotion, Words } from './RotatingWords.tsx'
+import OrgListCards from '../pages/sections/OrgList-Card.tsx'
const BODY = 'var(--color-muted)'
@@ -595,6 +596,22 @@ function Block({
return
}
+ case 'organizations': {
+ // Picked ones in their order, else every listed one of its kind.
+ const ids = (block.items ?? []).map((item) => item.org_id).filter((id): id is string => Boolean(id))
+ if (ids.length === 0 && !block.org_kind) return null
+ return (
+
+ )
+ }
+
case 'people': {
const picked = (block.items ?? [])
.filter((item) => item.person)
diff --git a/src/lib/adminSchema/shared.ts b/src/lib/adminSchema/shared.ts
index 49e70b9..113332e 100644
--- a/src/lib/adminSchema/shared.ts
+++ b/src/lib/adminSchema/shared.ts
@@ -311,6 +311,7 @@ export const BLOCK_TYPES = [
["people", "People", "People tiles: a team's members, or people picked one by one as items (each with their title), or both."],
["map", "Map", "A venue's map with its locations marked and listed beside it (Data → Venues). A schedule on the same page with the same venue links its locations here."],
["events", "Events", "Event cards, eg. the workshops on offer: picture, type, date, title and card text, each linking to the event's page."],
+ ["organizations", "Organizations", "Organization cards, as on the Partners page: picked one by one as items, or every listed one of a kind."],
["divider", "Divider", "A thin line between parts."],
];
@@ -340,6 +341,8 @@ export const NOT_CARD_ITEM = { scope: "parent", path: "type", value: ["list", "l
export const PEOPLE_ITEM = { scope: "parent", path: "type", value: "people" };
/* An item that's an event card on an events block (088). */
export const EVENT_ITEM = { scope: "parent", path: "type", value: "events" };
+/* An item that's an organization on an organizations block (093). */
+export const ORG_ITEM = { scope: "parent", path: "type", value: "organizations" };
/* A venues option (the /admin/options query) as a Venue: its
locations arrive as JSON. */
@@ -529,6 +532,20 @@ export const blocksChild = {
when: { path: "type", value: TEXT_TYPES },
help: (row) => TEXT_HELP[row?.type],
},
+ {
+ path: "org_kind",
+ label: "List",
+ widget: "select",
+ options: [
+ ["partner", "Partners"],
+ ["region", "Regions"],
+ ["group", "Groups"],
+ ["ministry", "Ministries"],
+ ],
+ blankLabel: "Default: only the organizations picked below",
+ help: "Every published, listed one of this kind, by name. Organizations picked as items replace this list.",
+ when: { path: "type", value: "organizations" },
+ },
{
path: "list_style",
label: "Style",
@@ -637,7 +654,7 @@ export const blocksChild = {
key: "items",
label: "Items",
addLabel: "Add item",
- when: { path: "type", value: ["list", "links", "schedule", "cards", "people", "events"] },
+ when: { path: "type", value: ["list", "links", "schedule", "cards", "people", "events", "organizations"] },
title: (row) => [row.day, row.time || row.start_time, row.text].filter(Boolean).join(" · ") || "New item",
blank: { text: "" },
fields: [
@@ -687,12 +704,22 @@ export const blocksChild = {
help: "The event the card shows and links to. An unpublished one is left out.",
when: EVENT_ITEM,
},
+ {
+ path: "org_id",
+ label: "Organization",
+ widget: "select",
+ optionsFrom: "organizations",
+ fills: "text",
+ required: true,
+ help: "Shown as its card, in this order. An unpublished one is left out.",
+ when: ORG_ITEM,
+ },
eventField(SCHEDULE_ENTRY),
{
path: "text",
label: "Text",
required: true,
- help: "Schedules: the entry's title. Cards: the card's title. Events: the title shown, filled from the event. People: their title on the tile, eg. Speaker",
+ help: "Schedules: the entry's title. Cards: the card's title. Events: the title shown, filled from the event. People: their title on the tile, eg. Speaker. Organizations: filled from it, only the admin shows it",
},
placeField(SCHEDULE_ENTRY),
{
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index dc08f72..ebb747e 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -45,6 +45,7 @@ export type ContentBlock = {
| 'people'
| 'map'
| 'events'
+ | 'organizations'
text?: string | null
media?: string | null
href?: string | null
@@ -56,6 +57,8 @@ export type ContentBlock = {
cite?: string | null
/** A list block's style (092): null bold text, 'plain' the old look. */
list_style?: 'plain' | null
+ /** An organizations block's kind, listed when none are picked (093). */
+ org_kind?: 'region' | 'group' | 'partner' | 'ministry' | null
/** A video block's WebVTT file, for an uploaded video (066). */
captions?: string | null
items?: ContentBlockItem[]
@@ -138,6 +141,8 @@ export type ContentBlockItem = {
/** A featured event's heading and subheading (090). */
heading?: string | null
subheading?: string | null
+ /** An organizations block's organization (093). */
+ org_id?: string | null
/** A block entry's sub-items. */
items?: ContentBlockItem[]
/** Its block's tags it has, by key (087). */
diff --git a/src/pages/sections/OrgList-Card.tsx b/src/pages/sections/OrgList-Card.tsx
index fb6bb31..05837c4 100644
--- a/src/pages/sections/OrgList-Card.tsx
+++ b/src/pages/sections/OrgList-Card.tsx
@@ -19,6 +19,9 @@ import { useReadingMode } from '../../lib/readingMode.ts'
in that order
+ inside a content block (093):
+ no page gutter, names under
+ the block's heading
Where the vertical list expands in place, a card links out. The
card carries as much as fits at a glance and the organization's
@@ -123,11 +126,11 @@ function OrgCard({ org, accent, pageLabel, siteLabel, titled }) {
);
}
-function Block({ title, orgs, accent, pageLabel, siteLabel }) {
+function Block({ title, orgs, accent, pageLabel, siteLabel, nested = false }) {
if (orgs.length === 0) return null;
return (
-
+
{title && (
{title}
@@ -147,7 +150,7 @@ function Block({ title, orgs, accent, pageLabel, siteLabel }) {
accent={accent}
pageLabel={pageLabel}
siteLabel={siteLabel}
- titled={!!title}
+ titled={!!title || nested}
/>
))}
@@ -167,14 +170,30 @@ export default function OrgListCards({
siteLabel = "Visit site",
sort = byName,
empty = "Nothing to show here yet.",
+ nested = false,
+}: {
+ kind?: string | null;
+ ids?: string[];
+ title?: string;
+ groups?: Array<{ key: string; title: string; pageLabel?: string; siteLabel?: string }>;
+ groupBy?: (org: any) => unknown;
+ accent?: string;
+ pageLabel?: string;
+ siteLabel?: string;
+ sort?: ((a: any, b: any) => number) | null;
+ empty?: string;
+ nested?: boolean;
}) {
const { organizations, loading, error } = useOrganizations(kind, ids);
- const shell = children => (
-
- {children}
-
- );
+ const shell = children =>
+ nested ? (
+ {children}
+ ) : (
+
+ {children}
+
+ );
if (loading && organizations.length === 0) {
return shell(
@@ -214,6 +233,7 @@ export default function OrgListCards({
accent={accent}
pageLabel={pageLabel}
siteLabel={siteLabel}
+ nested={nested}
/>
);
}
From 06bf0334483f048108f12a6321fd1be2d2abdb9a Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Wed, 11 Nov 2026 03:32:01 -0600
Subject: [PATCH 10/33] Organizations block: its picker lists ministries too
The block picked from the `organizations` options, which leave
ministries out for pickers that link to a page. A card needs no page,
so the block has its own `block_orgs`, every kind.
Co-Authored-By: Claude Opus 5.5
---
server/src/admin-schema.js | 4 ++++
src/lib/adminSchema/shared.ts | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/server/src/admin-schema.js b/server/src/admin-schema.js
index 7378685..0846fb2 100644
--- a/server/src/admin-schema.js
+++ b/server/src/admin-schema.js
@@ -100,6 +100,10 @@ export const OPTION_QUERIES = {
// What an organization cards section can hand-pick (067).
card_orgs:
"SELECT id, name || ' (' || kind || ')' AS label FROM organizations WHERE kind IN ('partner', 'ministry') ORDER BY kind, name",
+ // What an organizations content block can pick (093): every kind,
+ // a card needing no page of its own.
+ block_orgs:
+ "SELECT id, name || ' (' || kind || ')' AS label FROM organizations ORDER BY kind, name",
event_scopes: "SELECT id, name AS label FROM event_scopes ORDER BY sort_order",
events: "SELECT id, title AS label FROM events ORDER BY starts_on DESC, title",
people: "SELECT id, display_name AS label FROM people ORDER BY sort_name, display_name",
diff --git a/src/lib/adminSchema/shared.ts b/src/lib/adminSchema/shared.ts
index 113332e..35fca8e 100644
--- a/src/lib/adminSchema/shared.ts
+++ b/src/lib/adminSchema/shared.ts
@@ -708,7 +708,7 @@ export const blocksChild = {
path: "org_id",
label: "Organization",
widget: "select",
- optionsFrom: "organizations",
+ optionsFrom: "block_orgs",
fills: "text",
required: true,
help: "Shown as its card, in this order. An unpublished one is left out.",
From 56a6e1165583b9c47de677bb116406292a574081 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Wed, 11 Nov 2026 03:42:50 -0600
Subject: [PATCH 11/33] Map block: sections of its own, shown one at a time
Migration 094 adds content_block_map_sections: a map block groups its
venue's locations for its page, eg. Main spaces, without changing the
venue. With sections the API cuts the block's venue to the locations
they hold, in their order; the list groups under their names, and
buttons (All, then each section) show one section's marks and rows.
A schedule's place links only when a map on the page shows it.
Co-Authored-By: Claude Opus 5.5
---
server/src/admin-schema/columns.js | 9 ++
server/src/migrations/094_map_sections.sql | 27 ++++
server/src/shape.js | 26 ++++
src/components/ContentBlocks.tsx | 15 ++-
src/components/MapBlock.tsx | 139 +++++++++++++++------
src/components/ScheduleBlock.tsx | 2 +-
src/lib/adminSchema/shared.ts | 20 +++
src/lib/useContent.ts | 5 +
8 files changed, 200 insertions(+), 43 deletions(-)
create mode 100644 server/src/migrations/094_map_sections.sql
diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js
index 16f989f..cfbbdd7 100644
--- a/server/src/admin-schema/columns.js
+++ b/server/src/admin-schema/columns.js
@@ -264,6 +264,15 @@ export const blocksChild = (ownerKind) => ({
bool("no_tab"),
],
},
+ {
+ // A map block's own sections of its venue's locations (094).
+ key: "map_sections",
+ table: "content_block_map_sections",
+ owner: { column: "block_id" },
+ order: "sort_order",
+ when: { column: "type", value: "map" },
+ columns: [text("name", { required: true }), text("location_keys")],
+ },
],
});
diff --git a/server/src/migrations/094_map_sections.sql b/server/src/migrations/094_map_sections.sql
new file mode 100644
index 0000000..567a2cb
--- /dev/null
+++ b/server/src/migrations/094_map_sections.sql
@@ -0,0 +1,27 @@
+-- ═══════════════════════════════════════════════════════════════
+-- 094 A MAP BLOCK'S SECTIONS
+--
+-- A map content block can group its venue's locations into
+-- sections of its own, eg. Main spaces, Small group spaces: the
+-- block's list shows them under those names, and a visitor can pick
+-- one to see only its locations on the map. They're the block's,
+-- not the venue's, so each event groups the same venue its own way.
+--
+-- With sections, the block shows only the locations they name (in
+-- the sections' order); without, every location, as before.
+--
+-- location_keys the venue's location_keys (088) it holds,
+-- comma-separated, as schedule tags are (087). A
+-- key the venue no longer has is skipped.
+-- ═══════════════════════════════════════════════════════════════
+
+CREATE TABLE content_block_map_sections (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ block_id INTEGER NOT NULL REFERENCES content_blocks (id) ON DELETE CASCADE,
+ sort_order INTEGER NOT NULL DEFAULT 0,
+ name TEXT NOT NULL,
+ location_keys TEXT
+) STRICT;
+
+CREATE INDEX content_block_map_sections_block_idx
+ ON content_block_map_sections (block_id, sort_order);
diff --git a/server/src/shape.js b/server/src/shape.js
index 64f7c76..d3c7aa2 100644
--- a/server/src/shape.js
+++ b/server/src/shape.js
@@ -187,6 +187,32 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
attachVenues(db, [...byId.values()]);
attachEvents(db, [...byId.values()], depth);
+ // A map block's sections (094): each names some of its venue's
+ // locations. With any, the block's venue is cut to the locations
+ // they name, in their order, so the page, its schedule's links
+ // and the presentation all see the same places, numbered alike.
+ const sectionRows = db
+ .prepare(
+ `SELECT block_id, name, location_keys
+ FROM content_block_map_sections
+ WHERE block_id IN (${placeholders(blockIds.length)})
+ ORDER BY block_id, sort_order`,
+ )
+ .all(...blockIds);
+ for (const row of sectionRows) {
+ const block = byId.get(row.block_id);
+ if (!block?.venue) continue;
+ const known = new Set(block.venue.locations.map((location) => location.key));
+ const keys = (row.location_keys ?? "").split(",").filter((key) => known.has(key));
+ if (keys.length) (block.map_sections ??= []).push({ name: row.name, keys });
+ }
+ for (const block of byId.values()) {
+ if (!block.map_sections) continue;
+ const byKey = new Map(block.venue.locations.map((location) => [location.key, location]));
+ const shown = [...new Set(block.map_sections.flatMap((section) => section.keys))];
+ block.venue = { ...block.venue, locations: shown.map((key) => byKey.get(key)) };
+ }
+
return out;
}
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index 57a11a7..27fa2a7 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -62,7 +62,7 @@ import type { ContentBlock, ContentBlockItem, ItemEvent } from '../lib/useConten
import { Anchor, Inline, Paragraphs, isExternalUrl } from './InlineText.tsx'
import VideoPlayer from './VideoPlayer.tsx'
import ScheduleBlock, { Avatar } from './ScheduleBlock.tsx'
-import MapBlock, { PageMaps } from './MapBlock.tsx'
+import MapBlock, { PageMaps, mapAnchor } from './MapBlock.tsx'
import { eventHref, personHref } from '../lib/hrefs.ts'
import { occurrenceLabel } from '../lib/eventSeries.ts'
import { accentText, BRAND } from '../lib/color.ts'
@@ -102,8 +102,15 @@ export default function ContentBlocks({
})
- // The venues mapped here, for a schedule's places to link to.
- const maps = new Set(blocks.flatMap((block) => (block.type === 'map' && block.venue ? [block.venue.id] : [])))
+ // The places mapped here, for a schedule's places to link to: a
+ // map block's venue's locations (only those its sections show).
+ const maps = new Set(
+ blocks.flatMap((block) =>
+ block.type === 'map' && block.venue
+ ? block.venue.locations.map((location) => mapAnchor(block.venue!.id, location.key))
+ : [],
+ ),
+ )
return (
@@ -588,7 +595,7 @@ function Block({
case 'map':
if (!block.venue) return null
- return
+ return
case 'events': {
const events = (block.items ?? []).filter((item) => item.event)
diff --git a/src/components/MapBlock.tsx b/src/components/MapBlock.tsx
index 036c168..3778e80 100644
--- a/src/components/MapBlock.tsx
+++ b/src/components/MapBlock.tsx
@@ -23,17 +23,24 @@
Reading mode (readingMode.ts) gets the list alone, no picture.
- PageMaps holds the venues that have a map block among the blocks
- drawn together (ContentBlocks), so a schedule's places link only
- when there's a map on the page to go to.
+ A block's own sections (094), eg. Main spaces, group the list
+ under their names; the API has already cut the venue to the
+ locations they hold. Buttons over the list (All, then one per
+ section) show one section alone, its marks on the map and its
+ rows in the list. A link to a location outside the section in
+ view goes back to All.
+
+ PageMaps holds the locations mapped by the blocks drawn together
+ (their anchors, ContentBlocks), so a schedule's places link only
+ when there's a map on the page showing them.
═══════════════════════════════════════════════════════════════ */
-import { createContext, useState, type CSSProperties, type ReactNode } from 'react'
+import { createContext, useEffect, useState, type CSSProperties, type ReactNode } from 'react'
import { AppleLogo, ArrowsIn, GoogleLogo, MagnifyingGlassMinus, MagnifyingGlassPlus } from '@phosphor-icons/react'
import { Link, useLocation, type To } from 'react-router-dom'
import { mediaUrl } from '../lib/media.ts'
-import type { Venue, VenueLocation } from '../lib/useContent.ts'
+import type { MapSection, Venue, VenueLocation } from '../lib/useContent.ts'
import { accentText, readableOn, withAlpha } from '../lib/color.ts'
import { useReadingMode } from '../lib/readingMode.ts'
@@ -85,10 +92,13 @@ export function MapPicture({
light,
className = '',
big = false,
+ only,
}: {
venue: Venue
accent: string
active: string | null
+ /** Marks only these locations' keys; all when unset. */
+ only?: Set
link?: (key: string) => To
light?: (key: string) => object
className?: string
@@ -100,7 +110,7 @@ export function MapPicture({
return (
- {venue.locations.filter(isMarked).map((location) => {
+ {venue.locations.filter((location) => isMarked(location) && (!only || only.has(location.key))).map((location) => {
const on = active === location.key
const dim = active != null && !on
const style: CSSProperties = isBox(location)
@@ -170,11 +180,36 @@ export function MapPicture({
)
}
-export default function MapBlock({ venue, accent }: { venue: Venue; accent: string }) {
+export default function MapBlock({
+ venue,
+ sections = [],
+ accent,
+}: {
+ venue: Venue
+ sections?: MapSection[]
+ accent: string
+}) {
const { hash, search } = useLocation()
const [hovered, setHovered] = useState
(null)
const [zoom, setZoom] = useState(0)
+ // The section in view, by index; null is All.
+ const [view, setView] = useState(null)
const fromHash = venue.locations.find((location) => hash === `#${mapAnchor(venue.id, location.key)}`)?.key ?? null
+ const viewed = view != null ? sections[view] : undefined
+
+ // A link to a place outside the section in view shows All again.
+ useEffect(() => {
+ if (fromHash && viewed && !viewed.keys.includes(fromHash)) setView(null)
+ }, [fromHash, viewed])
+
+ const byKey = new Map(venue.locations.map((location) => [location.key, location]))
+ const groups: { name?: string; locations: VenueLocation[] }[] = sections.length
+ ? (viewed ? [viewed] : sections).map((section) => ({
+ name: section.name,
+ locations: section.keys.flatMap((key) => byKey.get(key) ?? []),
+ }))
+ : [{ locations: venue.locations }]
+ const only = viewed ? new Set(viewed.keys) : undefined
const active = hovered ?? fromHash
const picture = !useReadingMode() && Boolean(venue.map_image)
@@ -197,7 +232,7 @@ export default function MapBlock({ venue, accent }: { venue: Venue; accent: stri
@@ -219,36 +254,64 @@ export default function MapBlock({ venue, accent }: { venue: Venue; accent: stri
{venue.name}
{venue.address && {venue.address}
}
-
- {venue.locations.map((location) => {
- const on = active === location.key
- const row = (
- <>
-
-
-
- {location.name}
-
- {location.detail && {location.detail} }
-
- >
- )
- const rowClass = 'flex items-start gap-3 px-2 py-1.5 text-body'
- const rowStyle = on ? { background: withAlpha(accent, 12) } : undefined
- return (
-
- {isMarked(location) ? (
-
- {row}
-
- ) : (
- {row}
- )}
-
-
- )
- })}
-
+ {sections.length > 1 && (
+
+ {[null, ...sections.map((_, i) => i)].map((i) => {
+ const selected = view === i
+ return (
+ setView(i)}
+ className="btn border px-3 py-1 text-xs transition-colors"
+ style={
+ selected
+ ? { background: accent, borderColor: accent, color: readableOn(accent) }
+ : { borderColor: withAlpha(accent, 33), color: accentText(accent) }
+ }
+ >
+ {i == null ? 'All' : sections[i].name}
+
+ )
+ })}
+
+ )}
+ {groups.map((group, g) => (
+
+ {group.name &&
{group.name}
}
+
+ {group.locations.map((location) => {
+ const on = active === location.key
+ const row = (
+ <>
+
+
+
+ {location.name}
+
+ {location.detail && {location.detail} }
+
+ >
+ )
+ const rowClass = 'flex items-start gap-3 px-2 py-1.5 text-body'
+ const rowStyle = on ? { background: withAlpha(accent, 12) } : undefined
+ return (
+
+ {isMarked(location) ? (
+
+ {row}
+
+ ) : (
+ {row}
+ )}
+
+
+ )
+ })}
+
+
+ ))}
)
diff --git a/src/components/ScheduleBlock.tsx b/src/components/ScheduleBlock.tsx
index b5c838a..daa5406 100644
--- a/src/components/ScheduleBlock.tsx
+++ b/src/components/ScheduleBlock.tsx
@@ -149,7 +149,7 @@ function Place({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
const maps = useContext(PageMaps)
const { search } = useLocation()
if (!entry.location) return null
- if (!entry.place || !maps.has(entry.place.venue_id)) return
{entry.location}
+ if (!entry.place || !maps.has(mapAnchor(entry.place.venue_id, entry.place.key))) return
{entry.location}
return (
row.name || "New section",
+ blank: { name: "" },
+ fields: [
+ { path: "name", label: "Name", required: true, help: "eg. Main spaces" },
+ {
+ path: "location_keys",
+ label: "Locations",
+ widget: "checklist",
+ optionsFrom: "mapLocations",
+ full: true,
+ emptyNote: "No locations yet: pick the block's Venue, and give it locations under Data → Venues.",
+ },
+ ],
+ },
{
key: "items",
label: "Items",
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index ebb747e..f949890 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -67,8 +67,13 @@ export type ContentBlock = {
/** A map or schedule block's venue (088). */
venue_id?: string | null
venue?: Venue | null
+ /** A map block's own sections of its venue's locations, by key
+ * (094). With any, `venue` holds only the locations they name. */
+ map_sections?: MapSection[]
}
+export type MapSection = { name: string; keys: string[] }
+
/** A venue (088): its map picture and the locations marked on it,
* each a pin (x, y) or a box (x, y, w, h), in percent. */
export type Venue = {
From a79559d290c0f54988658e48db0cb2bf948dffb8 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Wed, 11 Nov 2026 03:45:43 -0600
Subject: [PATCH 12/33] Admin preview: a map block's sections made as the API
makes them
The preview handed MapBlock the form's sections (location_keys text),
so adding one crashed the page on section.keys. It now builds them as
shape.js does: keys the venue still has, empty ones dropped, the
venue cut to them.
Co-Authored-By: Claude Opus 5.5
---
src/components/admin/fields.tsx | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/components/admin/fields.tsx b/src/components/admin/fields.tsx
index 8ff6ebe..0d35925 100644
--- a/src/components/admin/fields.tsx
+++ b/src/components/admin/fields.tsx
@@ -135,9 +135,21 @@ const PREVIEWS = {
// the person, so it's looked up in the select options (a name, no
// photo: the options carry no more).
// A venue and an item's event and map location come from the
- // options the same way (088): an event as its title only.
+ // options the same way (088): an event as its title only. A map
+ // block's sections (094) are made as the API makes them (shape.js):
+ // their keys the venue still has, the venue cut to those.
contentBlock: (row, options) => {
const venue = venueFromOption(options?.venues?.find((v) => v.id === row.venue_id));
+ const known = new Map((venue?.locations ?? []).map((l) => [l.key, l]));
+ const sections = (row.map_sections ?? [])
+ .map((section) => ({
+ name: section.name,
+ keys: (section.location_keys ?? "").split(",").filter((key) => known.has(key)),
+ }))
+ .filter((section) => section.keys.length);
+ const mapped = venue && sections.length
+ ? { ...venue, locations: [...new Set(sections.flatMap((section) => section.keys))].map((key) => known.get(key)) }
+ : venue;
const shape = (item) => {
const person = item.person_id ? options?.people?.find((p) => p.id === item.person_id) : null;
const event = item.event_id ? options?.events?.find((e) => e.id === item.event_id) : null;
@@ -151,7 +163,11 @@ const PREVIEWS = {
items: (item.items ?? []).map(shape),
};
};
- return ;
+ return (
+
+ );
},
};
From 7e21a0dd40054d79f9a7b8cb6b964f1e0267612b Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 03:41:06 -0600
Subject: [PATCH 13/33] Present: slide order, presentation settings, blocks
drawn for a screen
- Setup's Order list: drag or move any slide; saved in the address
- A heading-only section titles the slides after it, no slide of its own
- Event Presentation settings (095): background image and color, dim,
frame, accent, text color, logo
- Blocks: Presentation text and Leave out of the presentation; map
blocks get a slide per section, map only, no details, location slides
- Presented, links are plain text, people a row of round photos and
names, organizations their logos
Co-Authored-By: Claude Opus 5.5
---
docs/updating-data-in-code.md | 2 +
server/src/admin-schema/columns.js | 8 +
server/src/admin-schema/events.js | 8 +
server/src/migrations/095_presentation.sql | 56 +++
server/src/routes/content.js | 10 +
server/src/shape.js | 20 +-
src/components/ContentBlocks.tsx | 23 +-
src/components/InlineText.tsx | 8 +-
src/components/PeopleTiles.tsx | 28 +-
src/components/admin/fields.tsx | 4 +-
src/lib/adminSchema/events.ts | 59 +++-
src/lib/adminSchema/shared.ts | 59 ++++
src/lib/presenting.ts | 10 +
src/lib/useContent.ts | 31 ++
src/pages/EventPresent.tsx | 375 ++++++++++++++++++---
src/pages/sections/OrgList-Card.tsx | 19 ++
16 files changed, 652 insertions(+), 68 deletions(-)
create mode 100644 server/src/migrations/095_presentation.sql
create mode 100644 src/lib/presenting.ts
diff --git a/docs/updating-data-in-code.md b/docs/updating-data-in-code.md
index 9fa4888..27e2f17 100644
--- a/docs/updating-data-in-code.md
+++ b/docs/updating-data-in-code.md
@@ -184,6 +184,8 @@ also in `server/src/admin-schema/` and a CHECK):
| Content blocks → Type | heading, subheading, paragraph, list, links, quote, image, divider, video, button, callout, schedule, table, cards, people, map, events, organizations | **yes**, `BLOCK_TYPES` (with each type's description) | `ContentBlocks.tsx` (one renderer per type). Which fields each type shows is `when` on the fields in `blocksChild` (`src/lib/adminSchema/shared.ts`). |
| Content blocks → Schedule items → Type | (blank: normal entry), block, break, heading | **yes**, migration 086 | `SCHEDULE_KINDS` in `src/lib/adminSchema/shared.ts`; drawn by `ScheduleBlock.tsx` and `EventPresent.tsx` (which slides each kind gets; the presentation cuts the event's page into sections at its Heading blocks). A block's sub-items are `content_block_subitems`. A schedule's own tags (087) are `content_block_tags`, rows of the block typed in the admin (not a fixed list); entries name them by `tag_key`, made in the admin as the tag is added. A schedule's Venue (088) lends its locations (Data → Venues, `venue_locations`) to its entries' Map location, named by `location_key` the same way; an entry's Event (a workshop) fills what it leaves blank in `shape.js` (`attachEvents`). |
| Content blocks → List → Style | (blank: bold text, normal detail), plain (plain text, gray detail) | **yes**, migration 092 | The Style field in `src/lib/adminSchema/shared.ts`; drawn by the `list` case in `ContentBlocks.tsx`. |
+| Content blocks (an event's) → Map → Location slides | (blank: each marked location), picked (the Locations with a slide), none | **yes**, migration 095 | `PRESENT_BLOCK_FIELDS` in `src/lib/adminSchema/shared.ts`; read by `mapSlides` in `src/pages/EventPresent.tsx` |
+| Events → Presentation → Frame | (blank: the accent bar, title line and timer), border, none | **yes**, migration 095 | The `present_frame` field in `src/lib/adminSchema/events.ts`; drawn by `Player` in `src/pages/EventPresent.tsx` |
| Content blocks → Organizations → List | (blank: only the picked ones), partner, region, group, ministry | **yes**, migration 093 | The `org_kind` field in `src/lib/adminSchema/shared.ts`; the `organizations` case in `ContentBlocks.tsx` passes it as the kind to `OrgListCards` (`nested`); items picked by `org_id` replace it |
| Timeline → Kind (+ list filter) | milestone, event, organization, award, people | no | `KIND_NAMES` in `src/pages/sections/history/TimelineEntry.tsx` |
| Timeline → Points at (+ list filter) | event, organization, award, person, team | no | `refHref` in `src/lib/hrefs.ts` |
diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js
index cfbbdd7..e5831c0 100644
--- a/server/src/admin-schema/columns.js
+++ b/server/src/admin-schema/columns.js
@@ -181,6 +181,14 @@ export const blocksChild = (ownerKind) => ({
enumeration("list_style", ["plain"]),
// Organizations blocks (093): the kind listed when none are picked.
enumeration("org_kind", ["region", "group", "partner", "ministry"]),
+ // How it's presented (095): EventPresent.tsx.
+ bool("present_hide"),
+ text("present_text"),
+ bool("present_map_split"),
+ bool("present_map_no_list"),
+ bool("present_map_no_details"),
+ enumeration("present_places", ["picked", "none"]),
+ text("present_place_keys"),
],
children: [
{
diff --git a/server/src/admin-schema/events.js b/server/src/admin-schema/events.js
index 3b5e791..581ef98 100644
--- a/server/src/admin-schema/events.js
+++ b/server/src/admin-schema/events.js
@@ -69,6 +69,14 @@ export const events = {
bool("in_timeline"),
bool("show_contents"),
text("links_heading"),
+ // Its page presented (095).
+ text("present_background"),
+ text("present_background_color"),
+ int("present_dim"),
+ enumeration("present_frame", ["border", "none"]),
+ text("present_accent"),
+ text("present_text_color"),
+ text("present_logo"),
// A repeating schedule. Columns rather than a side table: the
// schedule is always exactly one per event, and the public view
diff --git a/server/src/migrations/095_presentation.sql b/server/src/migrations/095_presentation.sql
new file mode 100644
index 0000000..641896d
--- /dev/null
+++ b/server/src/migrations/095_presentation.sql
@@ -0,0 +1,56 @@
+-- ═══════════════════════════════════════════════════════════════
+-- 095 PRESENTATION SETTINGS
+--
+-- How an event's page looks presented (EventPresent.tsx), set on
+-- the event; nothing here changes the page itself.
+--
+-- On events (v_events is SELECT e.*, so no rebuild):
+-- present_background an image behind every slide
+-- present_background_color the slides' background color; with an
+-- image, laid over it at present_dim
+-- present_dim percent of the color over the image,
+-- 0 to 90; null 60
+-- present_frame null the accent bar, title line and
+-- timer; 'border' an accent border around
+-- the slide; 'none' the slide alone
+-- present_accent in place of the event's color
+-- present_text_color the slides' text; null the background
+-- color's readable one, else the site's
+-- present_logo in the slide's bottom-right corner
+--
+-- On content blocks (any owner's; only an event's are presented):
+-- present_hide left out of the presentation
+-- present_text shown presented in place of its text,
+-- eg. a shorter heading
+-- present_map_split a map: a slide per map section (094)
+-- present_map_no_list a map: no locations list beside it
+-- present_map_no_details a map: no location detail lines
+-- present_places a map: which locations get a slide of
+-- their own; null every marked one,
+-- 'picked' present_place_keys, 'none'
+-- present_place_keys the venue's location_keys (088),
+-- comma-separated
+-- ═══════════════════════════════════════════════════════════════
+
+ALTER TABLE events ADD COLUMN present_background TEXT;
+ALTER TABLE events ADD COLUMN present_background_color TEXT;
+ALTER TABLE events ADD COLUMN present_dim INTEGER
+ CHECK (present_dim BETWEEN 0 AND 90);
+ALTER TABLE events ADD COLUMN present_frame TEXT
+ CHECK (present_frame IN ('border', 'none'));
+ALTER TABLE events ADD COLUMN present_accent TEXT;
+ALTER TABLE events ADD COLUMN present_text_color TEXT;
+ALTER TABLE events ADD COLUMN present_logo TEXT;
+
+ALTER TABLE content_blocks ADD COLUMN present_hide INTEGER NOT NULL DEFAULT 0
+ CHECK (present_hide IN (0, 1));
+ALTER TABLE content_blocks ADD COLUMN present_text TEXT;
+ALTER TABLE content_blocks ADD COLUMN present_map_split INTEGER NOT NULL DEFAULT 0
+ CHECK (present_map_split IN (0, 1));
+ALTER TABLE content_blocks ADD COLUMN present_map_no_list INTEGER NOT NULL DEFAULT 0
+ CHECK (present_map_no_list IN (0, 1));
+ALTER TABLE content_blocks ADD COLUMN present_map_no_details INTEGER NOT NULL DEFAULT 0
+ CHECK (present_map_no_details IN (0, 1));
+ALTER TABLE content_blocks ADD COLUMN present_places TEXT
+ CHECK (present_places IN ('picked', 'none'));
+ALTER TABLE content_blocks ADD COLUMN present_place_keys TEXT;
diff --git a/server/src/routes/content.js b/server/src/routes/content.js
index 629192d..a8c7963 100644
--- a/server/src/routes/content.js
+++ b/server/src/routes/content.js
@@ -595,6 +595,16 @@ content.get("/events/:id", (c) => {
...shapeEvent(row, links, cards, hosts),
show_contents: row.show_contents === 1,
links_heading: row.links_heading,
+ // Its page presented (095).
+ present: {
+ background: row.present_background,
+ background_color: row.present_background_color,
+ dim: row.present_dim,
+ frame: row.present_frame,
+ accent: row.present_accent,
+ text_color: row.present_text_color,
+ logo: row.present_logo,
+ },
blocks: body,
people,
awards,
diff --git a/server/src/shape.js b/server/src/shape.js
index d3c7aa2..5870af4 100644
--- a/server/src/shape.js
+++ b/server/src/shape.js
@@ -64,6 +64,20 @@ export function loadLinks(db, ownerKind, ids) {
rather than no key, so the renderer never has to check.
───────────────────────────────────────────────────────────── */
+/* A block's presentation settings (095), or null with none set. */
+function presentOf(row) {
+ const present = {
+ hide: row.present_hide === 1,
+ text: row.present_text,
+ map_split: row.present_map_split === 1,
+ map_no_list: row.present_map_no_list === 1,
+ 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) : [],
+ };
+ return Object.values(present).some((value) => (Array.isArray(value) ? value.length : value)) ? present : null;
+}
+
export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
const out = new Map();
if (ids.length === 0) return out;
@@ -71,7 +85,9 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
const blockRows = db
.prepare(
`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_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`,
@@ -99,6 +115,8 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
words: row.word_motion || row.word_direction || row.word_seconds
? { motion: row.word_motion, direction: row.word_direction, seconds: row.word_seconds }
: null,
+ // How it's presented (095), when anything is set.
+ present: presentOf(row),
items: [],
};
byId.set(row.id, block);
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index 27fa2a7..1e6e709 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -71,7 +71,8 @@ import { SITE_NAME } from '../lib/site.ts'
import { useSmallImage } from '../lib/useSmallImage.ts'
import { useReadingMode } from '../lib/readingMode.ts'
import { WordMotion, Words } from './RotatingWords.tsx'
-import OrgListCards from '../pages/sections/OrgList-Card.tsx'
+import OrgListCards, { OrgLogoRow } from '../pages/sections/OrgList-Card.tsx'
+import { usePresenting } from '../lib/presenting.ts'
const BODY = 'var(--color-muted)'
@@ -87,6 +88,14 @@ export default function ContentBlocks({
/** Put before each heading's id: a blog post's tab (contents.ts, splitTabs). */
anchorPrefix?: string
}) {
+ const presenting = usePresenting()
+ // Presented, a block set to is left out and the rest take their
+ // Presentation text (095).
+ if (presenting && blocks) {
+ blocks = blocks
+ .filter((block) => !block.present?.hide)
+ .map((block) => (block.present?.text ? { ...block, text: block.present.text } : block))
+ }
if (!blocks?.length) return null
// Headings get ids so a post's contents (PostContents) and a shared
// link (#getting-there) can point at them.
@@ -378,6 +387,9 @@ function Block({
}) {
const text = block.text ?? ''
const reading = useReadingMode()
+ // On a screen: links are their text, people and organizations
+ // just pictures and names (095).
+ const presenting = usePresenting()
switch (block.type) {
// A blog post's tab marker (BlogPost.tsx splits the post at
@@ -410,7 +422,7 @@ function Block({
- {item.url ? (
+ {item.url && !presenting ? (
{item.text}
@@ -607,6 +619,7 @@ function Block({
// Picked ones in their order, else every listed one of its kind.
const ids = (block.items ?? []).map((item) => item.org_id).filter((id): id is string => Boolean(id))
if (ids.length === 0 && !block.org_kind) return null
+ if (presenting) return
return (
- {block.team_id && }
- {picked.length > 0 && }
+ {block.team_id && }
+ {picked.length > 0 && }
)
}
@@ -638,7 +651,7 @@ function Block({
case 'paragraph':
default:
if (!text) return null
- return block.href ? (
+ return block.href && !presenting ? (
{text}
diff --git a/src/components/InlineText.tsx b/src/components/InlineText.tsx
index 7528c3b..0c7f4f7 100644
--- a/src/components/InlineText.tsx
+++ b/src/components/InlineText.tsx
@@ -22,6 +22,7 @@ import { Fragment, type CSSProperties, type ReactNode } from 'react'
import { Link } from 'react-router-dom'
import { accentText } from '../lib/color.ts'
import { RotatingWords } from './RotatingWords.tsx'
+import { usePresenting } from '../lib/presenting.ts'
const TOKEN = /\*\*(.+?)\*\*|\*(.+?)\*|\[([^\]]+)\]\(([^)\s]+)\)|\{([^{}|\n]+(?:\|[^{}|\n]+)+)\}/g
const SAFE_URL = /^(\/(?!\/)|#|https?:\/\/|mailto:|tel:)/i
@@ -77,7 +78,8 @@ export function Anchor({
)
}
-function line(text: string, accent: string, key: string): ReactNode[] {
+/* `plain`: a link's text alone, presented (095). */
+function line(text: string, accent: string, key: string, plain = false): ReactNode[] {
const out: ReactNode[] = []
let last = 0
let n = 0
@@ -89,6 +91,7 @@ function line(text: string, accent: string, key: string): ReactNode[] {
if (words != null) out.push( word.trim())} />)
else if (bold != null) out.push({bold} )
else if (italic != null) out.push({italic} )
+ else if (label != null && plain) out.push(label)
else if (label != null && SAFE_URL.test(url)) {
out.push(
@@ -104,13 +107,14 @@ function line(text: string, accent: string, key: string): ReactNode[] {
/** Text inside another element: formatting and line breaks. */
export function Inline({ text, accent }: { text?: string | null; accent: string }) {
+ const plain = usePresenting()
const lines = (text ?? '').split('\n')
return (
<>
{lines.map((part, i) => (
{i > 0 && }
- {line(part, accent, `l${i}`)}
+ {line(part, accent, `l${i}`, plain)}
))}
>
diff --git a/src/components/PeopleTiles.tsx b/src/components/PeopleTiles.tsx
index d0371a7d..906acad 100644
--- a/src/components/PeopleTiles.tsx
+++ b/src/components/PeopleTiles.tsx
@@ -165,6 +165,8 @@ export interface PeopleTilesProps
/** The group labels' heading level, by what they sit under (3 under
* a section's h2). In reading mode the names are one level under. */
headingLevel?: 3 | 4 | 5;
+ /** Just round photos and names in a row, as presented (095). */
+ row?: boolean;
/** How long a fetched team or person is reused, in ms. */
ttl?: number;
emptyMessage?: string;
@@ -195,8 +197,10 @@ export default function PeopleTiles({
ttl = 5 * 60_000,
loadingMessage = "Loading…",
errorMessage = "Couldn't load this list right now.",
+ row = false,
...view
}: PeopleTilesProps) {
+ const View = row ? PeopleRow : PeopleTilesView;
const specs = useMemo(() => normalizeTeams(teams), [teams]);
const teamKey = specs.map((spec) => spec.id).join(",");
@@ -278,14 +282,14 @@ export default function PeopleTiles({
if (specs.length) {
if (failed) return {errorMessage}
;
if (!teamGroups) return {loadingMessage}
;
- return ;
+ return ;
}
if (slugKey) {
if (failed) return {errorMessage}
;
if (!directory) return {loadingMessage}
;
return (
- ({
...group,
@@ -297,7 +301,7 @@ export default function PeopleTiles({
}
return (
- group.people), ...(people ?? [])];
+ return (
+
+ {everyone.map((person, i) => (
+
+
+
+
+ {person.name}
+
+ ))}
+
+ );
+}
+
function Photo({ src, name }: { src?: string | null; name: string }) {
const img = useSmallImage(src);
diff --git a/src/components/admin/fields.tsx b/src/components/admin/fields.tsx
index 0d35925..fd54d40 100644
--- a/src/components/admin/fields.tsx
+++ b/src/components/admin/fields.tsx
@@ -854,7 +854,9 @@ export function Repeater({
row={row}
parentRow={parentRow}
value={row[field.path]}
- options={options}
+ // Its own lent options too: a map block's
+ // Locations with a slide (095).
+ options={spec.lends ? { ...options, ...spec.lends(row, options) } : options}
error={errors?.[`${errorPrefix}${index}.${field.path}`]}
onChange={(value) => update(index, { ...row, [field.path]: value })}
onPatch={(patch) => update(index, { ...row, ...patch })}
diff --git a/src/lib/adminSchema/events.ts b/src/lib/adminSchema/events.ts
index a4babc0..b170549 100644
--- a/src/lib/adminSchema/events.ts
+++ b/src/lib/adminSchema/events.ts
@@ -1,5 +1,8 @@
import { mediaUrl } from "../media.ts";
-import { PLACE_FIELDS, PUBLISHED_FIELD, LISTED_FIELD, timelineGroup, timelineDetailGroup, linksChild, hostsChild, blocksChild, tagsChild } from "./shared.ts";
+import { PLACE_FIELDS, PUBLISHED_FIELD, LISTED_FIELD, timelineGroup, timelineDetailGroup, linksChild, hostsChild, blocksChild, tagsChild, PRESENT_BLOCK_FIELDS } from "./shared.ts";
+
+/* An event's blocks also say how they're presented (095). */
+const eventBlocksChild = { ...blocksChild, fields: [...blocksChild.fields, ...PRESENT_BLOCK_FIELDS] };
/* ── Events ──────────────────────────────────────────────────── */
@@ -189,6 +192,58 @@ export const events = {
},
],
},
+ {
+ legend: "Presentation",
+ fields: [
+ {
+ path: "present_background",
+ label: "Background image",
+ widget: "image",
+ crop: "free",
+ resolve: mediaUrl,
+ full: true,
+ help: "Behind every slide when the page is presented, under the background color. Default: none.",
+ },
+ {
+ path: "present_background_color",
+ label: "Background color",
+ widget: "color",
+ help: "The slides' background, laid over the image at Dim. Default: the site's background.",
+ },
+ {
+ path: "present_dim",
+ label: "Dim",
+ widget: "number",
+ help: "How much of the background color covers the image, 0 to 90 percent, so the text stays readable. Default: 60.",
+ },
+ {
+ path: "present_frame",
+ label: "Frame",
+ widget: "select",
+ options: [
+ ["border", "A border around the slide"],
+ ["none", "None: the slide alone"],
+ ],
+ blankLabel: "Default: a bar on top, the title line and the timer",
+ },
+ { path: "present_accent", label: "Accent", widget: "color", help: "Default: the event's color" },
+ {
+ path: "present_text_color",
+ label: "Text color",
+ widget: "color",
+ help: "Default: readable on the background color, else the site's text colors",
+ },
+ {
+ path: "present_logo",
+ label: "Logo",
+ widget: "image",
+ folder: "logos",
+ resolve: mediaUrl,
+ full: true,
+ help: "In the bottom-right corner of every slide. Default: none.",
+ },
+ ],
+ },
timelineGroup("event"),
timelineDetailGroup("event"),
{ legend: "Publishing", fields: [PUBLISHED_FIELD, LISTED_FIELD] },
@@ -231,6 +286,6 @@ export const events = {
],
},
linksChild,
- blocksChild,
+ eventBlocksChild,
],
};
diff --git a/src/lib/adminSchema/shared.ts b/src/lib/adminSchema/shared.ts
index 2eee278..1c225b5 100644
--- a/src/lib/adminSchema/shared.ts
+++ b/src/lib/adminSchema/shared.ts
@@ -494,6 +494,65 @@ const SUB_ITEM_FIELDS = [
TAGS_FIELD,
];
+/* An event's blocks' presentation fields (095), EventPresent.tsx. */
+export const PRESENT_BLOCK_FIELDS = [
+ {
+ path: "present_hide",
+ label: "Leave out of the presentation",
+ widget: "checkbox",
+ help: "The page still shows it.",
+ },
+ {
+ path: "present_text",
+ label: "Presentation text",
+ widget: "textarea",
+ full: true,
+ when: { path: "type", value: TEXT_TYPES },
+ help: "Shown in place of the text when the page is presented, eg. a shorter heading. Default: the text.",
+ },
+ {
+ path: "present_map_split",
+ label: "A slide per section",
+ widget: "checkbox",
+ help: "Presented: each of the sections below gets its own map slide with only its locations. Default: one map slide with every location.",
+ when: { path: "type", value: "map" },
+ },
+ {
+ path: "present_map_no_list",
+ label: "Map only",
+ widget: "checkbox",
+ help: "Presented: no locations list beside the map, so the map fills the slide.",
+ when: { path: "type", value: "map" },
+ },
+ {
+ path: "present_map_no_details",
+ label: "No location details",
+ widget: "checkbox",
+ help: "Presented: each location's name only, without its detail line.",
+ when: { path: "type", value: "map" },
+ },
+ {
+ path: "present_places",
+ label: "Location slides",
+ widget: "select",
+ options: [
+ ["picked", "Only the locations picked below"],
+ ["none", "None"],
+ ],
+ blankLabel: "Default: each marked location, lit up on the map",
+ when: { path: "type", value: "map" },
+ },
+ {
+ path: "present_place_keys",
+ label: "Locations with a slide",
+ widget: "checklist",
+ optionsFrom: "mapLocations",
+ full: true,
+ when: { path: "present_places", value: "picked" },
+ emptyNote: "No locations yet: pick the block's Venue, and give it locations under Data → Venues.",
+ },
+];
+
export const blocksChild = {
key: "content_blocks",
label: "Content blocks",
diff --git a/src/lib/presenting.ts b/src/lib/presenting.ts
new file mode 100644
index 0000000..db12d8e
--- /dev/null
+++ b/src/lib/presenting.ts
@@ -0,0 +1,10 @@
+/* Whether the blocks are drawn for a presentation screen
+ (EventPresent.tsx, 095): ContentBlocks leaves out the blocks set to,
+ takes their Presentation text, and draws links as plain text,
+ people as a row of round photos and organizations as logos. */
+
+import { createContext, useContext } from 'react'
+
+export const Presenting = createContext(false)
+
+export const usePresenting = () => useContext(Presenting)
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index f949890..c26abcc 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -70,6 +70,35 @@ export type ContentBlock = {
/** A map block's own sections of its venue's locations, by key
* (094). With any, `venue` holds only the locations they name. */
map_sections?: MapSection[]
+ /** How it's presented (095); null with nothing set. */
+ present?: BlockPresent | null
+}
+
+/** A block's presentation settings (095), EventPresent.tsx. */
+export type BlockPresent = {
+ hide: boolean
+ /** In place of its text, eg. a shorter heading. */
+ text: string | null
+ /** A map: a slide per map section. */
+ map_split: boolean
+ map_no_list: boolean
+ map_no_details: boolean
+ /** A map: which locations get a slide; null every marked one. */
+ places: 'picked' | 'none' | null
+ place_keys: string[]
+}
+
+/** An event's presentation look (095). */
+export type EventPresentLook = {
+ background: string | null
+ background_color: string | null
+ /** Percent of the color over the image; null 60. */
+ dim: number | null
+ /** null the accent bar, title line and timer. */
+ frame: 'border' | 'none' | null
+ accent: string | null
+ text_color: string | null
+ logo: string | null
}
export type MapSection = { name: string; keys: string[] }
@@ -246,6 +275,8 @@ export type EventRecord = {
show_contents?: boolean
/** Above the link buttons; null shows none (089). */
links_heading?: string | null
+ /** Its page presented (095). */
+ present?: EventPresentLook
blocks: ContentBlock[]
people: EventPerson[]
awards: EventAward[]
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index 187fee2..b6b7917 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -43,11 +43,24 @@
half its seconds, scrolls to the end at "Scroll" seconds a
screenful (`screen=`), then waits the other half.
+ A section with only a heading (and subheadings or dividers) before
+ its map, schedule or events gets no text slide: its heading titles
+ the slides that follow. The setup's Order list moves any slide
+ (`order`, slide ids, see buildSlides); a slide it doesn't name
+ stays after the one it follows by default.
+
+ The event's Presentation settings (095) give the slides their
+ background, frame, colors and logo (lookTokens, Player); a block's
+ give its Presentation text, leave it out, and say how a map is
+ shown. The blocks themselves are drawn for a screen (Presenting):
+ links as their text, people as round photos and names,
+ organizations as their logos.
+
Keys while playing: arrows step, Space pauses, Escape leaves full
screen (the browser's), S goes back to the setup.
═══════════════════════════════════════════════════════════════ */
-import { ArrowsOut, CaretLeft, CaretRight, Gear, Pause, Play } from '@phosphor-icons/react'
+import { ArrowDown, ArrowUp, ArrowsOut, CaretLeft, CaretRight, DotsSixVertical, Gear, Pause, Play } from '@phosphor-icons/react'
import { createContext, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode } from 'react'
import { useParams, useSearchParams } from 'react-router-dom'
@@ -67,10 +80,13 @@ import {
import ContentBlocks, { eventLine } from '../components/ContentBlocks.tsx'
import { LocationNumber, MapPicture, isMarked, locationNumber } from '../components/MapBlock.tsx'
import { Paragraphs } from '../components/InlineText.tsx'
+import Logo from '../components/Logo.tsx'
+import { Presenting } from '../lib/presenting.ts'
import {
useEvent,
type ContentBlock,
type ContentBlockItem,
+ type EventPresentLook,
type ScheduleTag,
type Venue,
type VenueLocation,
@@ -105,6 +121,11 @@ const OWN_SLIDES = new Map([
])
/* Blocks that start a section. */
const STARTS_SECTION = new Set(['heading', 'tab'])
+/* Text that alone makes no section slide: the heading titles what
+ follows instead. */
+const FILLER = new Set(['subheading', 'divider'])
+/* Percent of the background color over the background image, unset. */
+const DIM = 60
/* Seconds a long slide takes to scroll one screenful, when unset. */
const PER_SCREEN = 8
@@ -119,7 +140,11 @@ const TEXT_WIDTH = 1000
/* `label` is the top bar's right side: the day, else the section.
The rest is what each kind draws. */
type Slide = {
+ /* Where it comes from, for the Order list (buildSlides). */
+ id: string
kind: Kind
+ /* A map's or event list's title, when not the label. */
+ title?: string
seconds: number
label: string
day?: Day
@@ -132,18 +157,28 @@ type Slide = {
venue?: Venue
location?: VenueLocation
items?: ContentBlockItem[]
+ /* A map: the locations shown, by key (all when unset), and its
+ block's Map only and No location details (095). */
+ only?: string[]
+ noList?: boolean
+ noDetails?: boolean
}
-/* A part of the page: a heading and the blocks under it. */
-type Section = { title: string; blocks: ContentBlock[] }
+/* A part of the page: a heading (`headed`, else the event's title)
+ and the blocks under it. */
+type Section = { title: string; headed: boolean; blocks: ContentBlock[] }
/* A schedule block, numbered among the page's, with its days. */
type Schedule = { n: number; days: Day[]; tags: ScheduleTag[] }
+/* Blocks left out of the presentation (095) are dropped; a left out
+ heading still starts its section, under the event's title. */
function sectionsOf(blocks: ContentBlock[], title: string): Section[] {
- const sections: Section[] = [{ title, blocks: [] }]
+ const sections: Section[] = [{ title, headed: false, blocks: [] }]
for (const block of blocks) {
- if (STARTS_SECTION.has(block.type)) sections.push({ title: block.text || title, blocks: [] })
- else sections[sections.length - 1].blocks.push(block)
+ if (STARTS_SECTION.has(block.type)) {
+ const heading = block.present?.hide ? '' : block.present?.text || block.text
+ 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)
}
@@ -170,43 +205,58 @@ function readSettings(params: URLSearchParams) {
seconds,
screen: Number.isFinite(screen) && screen > 0 ? screen : PER_SCREEN,
only: params.get('only') || null,
+ order: list(params.get('order')),
}
}
type Settings = ReturnType
type Picks = Pick
+/* An entry or sub-item with its key (key()), carried through the
+ picks and the tag filter, which copy blocks. */
+type Keyed = ContentBlockItem & { slideKey: string }
+const keyOf = (entry: ContentBlockItem) => (entry as Keyed).slideKey
+
function scheduleSlides(slides: Slide[], { n, days, tags }: Schedule, { hidden, seconds, only }: Picks) {
const kept: Day[] = []
days.forEach((all, d) => {
if (hidden.has(key(n, d))) return
- let entries = all.entries.flatMap((entry, e) => {
+ let entries: ContentBlockItem[] = all.entries.flatMap((entry, e) => {
if (hidden.has(key(n, d, e))) return []
- if (entry.kind !== 'block') return [entry]
- return [{ ...entry, items: (entry.items ?? []).filter((_, i) => !hidden.has(key(n, d, e, i))) }]
+ const slideKey = key(n, d, e)
+ if (entry.kind !== 'block') return [{ ...entry, slideKey }]
+ const items = (entry.items ?? []).flatMap((item, i) =>
+ hidden.has(key(n, d, e, i)) ? [] : [{ ...item, slideKey: key(n, d, e, i) }],
+ )
+ return [{ ...entry, slideKey, items }]
})
if (only) entries = withTag(entries, only)
if (entries.length === 0) return
kept.push({ name: all.name, entries })
const day = { ...all, entries }
const at = { day, label: day.name, tags }
- if (seconds.overview) slides.push({ kind: 'overview', seconds: seconds.overview, ...at })
+ if (seconds.overview) slides.push({ id: `o${key(n, d)}`, kind: 'overview', seconds: seconds.overview, ...at })
const media = (entry: ContentBlockItem, parent?: ContentBlockItem) => {
- if (seconds.graphic && entry.media) slides.push({ kind: 'graphic', seconds: seconds.graphic, ...at, entry, parent })
- if (seconds.map && entry.map_image) slides.push({ kind: 'map', seconds: seconds.map, ...at, entry, parent })
+ const k = keyOf(entry)
+ if (seconds.graphic && entry.media) slides.push({ id: `g${k}`, kind: 'graphic', seconds: seconds.graphic, ...at, entry, parent })
+ if (seconds.map && entry.map_image) slides.push({ id: `m${k}`, kind: 'map', seconds: seconds.map, ...at, 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, ...at, entry })
+ if (seconds.block) slides.push({ id: `k${keyOf(entry)}`, kind: 'block', seconds: seconds.block, ...at, entry })
media(entry)
for (const item of entry.items ?? []) {
- if (seconds.spotlight) slides.push({ kind: 'spotlight', seconds: seconds.spotlight, ...at, entry: item, parent: entry })
+ if (seconds.spotlight) {
+ slides.push({ id: `s${keyOf(item)}`, kind: 'spotlight', seconds: seconds.spotlight, ...at, entry: item, parent: entry })
+ }
media(item, entry)
}
continue
}
- if (seconds.spotlight && entry.kind !== 'break') slides.push({ kind: 'spotlight', seconds: seconds.spotlight, ...at, entry })
+ if (seconds.spotlight && entry.kind !== 'break') {
+ slides.push({ id: `s${keyOf(entry)}`, kind: 'spotlight', seconds: seconds.spotlight, ...at, entry })
+ }
media(entry)
}
})
@@ -215,11 +265,41 @@ function scheduleSlides(slides: Slide[], { n, days, tags }: Schedule, { hidden,
for (const tag of tags) {
if (only && tag.key !== only) continue
const tagDays = daysWithTag(kept, tag.key)
- if (tagDays.length) slides.push({ kind: 'tag', seconds: seconds.tag, label: tag.name, tag, days: tagDays, tags })
+ if (tagDays.length) slides.push({ id: `x${n}.${tag.key}`, kind: 'tag', seconds: seconds.tag, label: tag.name, tag, days: tagDays, tags })
}
}
}
+/* A map block's slides: the map (once per section with A slide per
+ section), then each location picked for a slide of its own (095).
+ `title` is the heading folded in, if any. */
+function mapSlides(slides: Slide[], block: ContentBlock, at: string, label: string, title: string | null, seconds: Picks['seconds']) {
+ const venue = block.venue!
+ const present = block.present
+ const shown = { noList: present?.map_no_list, noDetails: present?.map_no_details }
+ if (seconds.venue) {
+ const parts = present?.map_split ? (block.map_sections ?? []) : []
+ if (parts.length) {
+ parts.forEach((part, i) => {
+ slides.push({ id: `v${at}.${i}`, kind: 'venue', seconds: seconds.venue, label, venue, title: part.name, only: part.keys, ...shown })
+ })
+ } else {
+ slides.push({ id: `v${at}`, kind: 'venue', seconds: seconds.venue, label, venue, title: title ?? venue.name, ...shown })
+ }
+ }
+ if (!seconds.place || !venue.map_image || present?.places === 'none') return
+ const picked = present?.places === 'picked' ? new Set(present.place_keys) : null
+ for (const location of venue.locations.filter(isMarked)) {
+ if (picked && !picked.has(location.key)) continue
+ slides.push({ id: `p${at}.${location.key}`, kind: 'place', seconds: seconds.place, label, venue, location, ...shown })
+ }
+}
+
+/* Each slide's id says where it comes from, so a saved order still
+ finds it: t a section's text; v and p a map and its
+ locations, c and e an events list and its events, by
+ .; 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, picks: Picks): Slide[] {
const { skipped, seconds } = picks
const slides: Slide[] = []
@@ -227,29 +307,66 @@ function buildSlides(sections: Section[], schedules: Map
if (skipped.has(s)) return
const label = section.title
const text = section.blocks.filter((block) => !OWN_SLIDES.has(block.type))
- if (seconds.section && text.length) slides.push({ kind: 'section', seconds: seconds.section, label, blocks: text })
- for (const block of section.blocks) {
+ // 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 })
+ const title = section.headed && !own ? label : null
+ section.blocks.forEach((block, b) => {
+ const at = `${s}.${b}`
const schedule = schedules.get(block)
if (schedule) scheduleSlides(slides, schedule, picks)
- if (block.type === 'map' && block.venue) {
- const venue = block.venue
- if (seconds.venue) slides.push({ kind: 'venue', seconds: seconds.venue, label, venue })
- if (seconds.place && venue.map_image) {
- for (const location of venue.locations.filter(isMarked)) {
- slides.push({ kind: 'place', seconds: seconds.place, label, venue, location })
- }
- }
- }
+ if (block.type === 'map' && block.venue) mapSlides(slides, block, at, label, title, seconds)
if (block.type === 'events') {
const items = (block.items ?? []).filter((item) => item.event)
- if (seconds.cards && items.length) slides.push({ kind: 'cards', seconds: seconds.cards, label, items })
- if (seconds.event) for (const entry of items) slides.push({ kind: 'event', seconds: seconds.event, label, entry })
+ if (seconds.cards && items.length) slides.push({ id: `c${at}`, kind: 'cards', seconds: seconds.cards, label, items })
+ if (seconds.event) {
+ items.forEach((entry, i) => slides.push({ id: `e${at}.${i}`, kind: 'event', seconds: seconds.event, label, entry }))
+ }
}
- }
+ })
})
return slides
}
+/* The slides in the Order list's order: one it doesn't name stays
+ right after the slide it follows by default. */
+function ordered(slides: Slide[], order: string[] | null): Slide[] {
+ if (!order?.length) return slides
+ const rank = new Map(order.map((id, i) => [id, i]))
+ let last = -1
+ return slides
+ .map((slide, i) => {
+ const at = rank.get(slide.id)
+ if (at != null) last = at
+ return { slide, i, at: at ?? last + 0.5 }
+ })
+ .sort((a, b) => a.at - b.at || a.i - b.i)
+ .map(({ slide }) => slide)
+}
+
+/* A slide's line in the Order list. */
+function slideName(slide: Slide): string {
+ const entry = slide.entry
+ switch (slide.kind) {
+ case 'section':
+ case 'cards':
+ return slide.label
+ case 'overview':
+ return slide.day?.name || 'Schedule'
+ case 'tag':
+ return slide.tag!.name
+ case 'venue':
+ return slide.title ?? slide.venue!.name
+ case 'place':
+ return slide.location!.name
+ case 'event':
+ return entry!.text || entry!.event!.title
+ default:
+ return [slide.day?.name, entry!.time, entry!.text].filter(Boolean).join(' · ')
+ }
+}
+const KIND_LABEL = new Map(KINDS.map((kind) => [kind.key, kind.label]))
+
export default function EventPresent() {
const { id } = useParams()
const [params, setParams] = useSearchParams()
@@ -284,7 +401,8 @@ export default function EventPresent() {
)
}
- const accent = event.color || BRAND
+ const look = event.present
+ const accent = look?.accent || event.color || BRAND
const back = `/events/${encodeURIComponent(event.id)}`
if (sections.length === 0) {
@@ -304,7 +422,8 @@ export default function EventPresent() {
{
const next = new URLSearchParams(params)
@@ -332,6 +451,7 @@ export default function EventPresent() {
out.set('screen', String(next.screen))
// Not 'tag': that's the tag slides' seconds.
if (next.only) out.set('only', next.only)
+ if (next.order?.length) out.set('order', next.order.join(','))
out.set('play', '1')
setParams(out)
}}
@@ -363,7 +483,18 @@ function Setup({
const [seconds, setSeconds] = useState(settings.seconds)
const [only, setOnly] = useState(settings.only)
const [screen, setScreen] = useState(settings.screen)
- const count = buildSlides(sections, schedules, { skipped, hidden, seconds, only }).length
+ const [order, setOrder] = useState(settings.order)
+ const [dragging, setDragging] = useState(null)
+ const slides = ordered(buildSlides(sections, schedules, { skipped, hidden, seconds, only }), order)
+ const count = slides.length
+ // Moves a slide in the list, which then names every slide shown.
+ const move = (from: number, to: number) => {
+ if (to < 0 || to >= slides.length || from === to) return
+ const ids = slides.map((slide) => slide.id)
+ const [id] = ids.splice(from, 1)
+ ids.splice(to, 0, id)
+ setOrder(ids)
+ }
const tags = [...schedules.values()].flatMap((schedule) => schedule.tags)
const toggle = (set: Set, value: T) => {
@@ -529,11 +660,67 @@ function Setup({
+ {slides.length > 1 && (
+
+
+
Order
+ {order && (
+ setOrder(null)} className="text-sm text-link underline">
+ Back to the page's order
+
+ )}
+
+
+ Drag a slide, or move it with its arrows. A slide picked again later goes back after the one it follows on
+ the page.
+
+
+ {slides.map((slide, i) => (
+ setDragging(i)}
+ onDragOver={(e) => e.preventDefault()}
+ onDrop={() => {
+ if (dragging != null) move(dragging, i)
+ setDragging(null)
+ }}
+ onDragEnd={() => setDragging(null)}
+ className={`flex cursor-grab items-center gap-3 bg-raised px-3 py-2 shadow-sm ${dragging === i ? 'opacity-50' : ''}`}
+ >
+
+ {i + 1}
+ {slideName(slide)}
+ {KIND_LABEL.get(slide.kind)}
+ move(i, i - 1)}
+ disabled={i === 0}
+ aria-label={`Move ${slideName(slide)} up`}
+ className="p-1 text-muted hover:text-ink disabled:opacity-30"
+ >
+
+
+ move(i, i + 1)}
+ disabled={i === slides.length - 1}
+ aria-label={`Move ${slideName(slide)} down`}
+ className="p-1 text-muted hover:text-ink disabled:opacity-30"
+ >
+
+
+
+ ))}
+
+
+ )}
+
onPlay({ skipped, hidden, seconds, screen, only })}
+ onClick={() => onPlay({ skipped, hidden, seconds, screen, only, order })}
className="btn inline-flex items-center gap-2 px-6 py-3 disabled:opacity-50"
style={{ background: accent, color: readableOn(accent) }}
>
@@ -591,15 +778,39 @@ function PickEntry({
/* ── Player ─────────────────────────────────────────────────── */
+/* The event's Presentation colors (095) as the site's color tokens,
+ so every slide's text-ink, bg-raised and so on take them. */
+function lookTokens(look?: EventPresentLook): CSSProperties | undefined {
+ const bg = look?.background_color
+ const ink = look?.text_color || (bg ? readableOn(bg) : null)
+ if (!bg && !ink) return undefined
+ const ground = bg ?? 'var(--color-surface)'
+ return {
+ ...(bg ? { '--color-surface': bg } : {}),
+ ...(ink
+ ? {
+ '--color-ink': ink,
+ '--color-body': ink,
+ '--color-muted': `color-mix(in srgb, ${ink} 75%, ${ground})`,
+ '--color-raised': `color-mix(in srgb, ${ink} 8%, ${ground})`,
+ '--color-tint': `color-mix(in srgb, ${ink} 14%, ${ground})`,
+ '--color-tint-soft': `color-mix(in srgb, ${ink} 6%, ${ground})`,
+ }
+ : {}),
+ } as CSSProperties
+}
+
function Player({
title,
accent,
+ look,
slides,
screen,
onSetup,
}: {
title: string
accent: string
+ look?: EventPresentLook
slides: Slide[]
screen: number
onSetup: () => void
@@ -675,16 +886,35 @@ function Player({
}
const control = 'btn flex h-12 w-12 items-center justify-center bg-raised text-ink shadow-md'
+ const frame = look?.frame ?? null
+ const background = mediaUrl(look?.background)
+ const label = slide.label === title || slide.label === slide.title ? '' : slide.label
return (
-
-
- {title}
- {slide.label === title ? '' : slide.label}
-
+ {/* The background image, the background color over it at Dim. */}
+ {background && (
+
+ )}
+ {frame === 'border' && (
+
+ )}
+ {frame == null &&
}
+ {frame !== 'none' && (
+
+ {title}
+ {label}
+
+ )}
{/* Keyed by index, so every slide's entrance animation plays. */}
@@ -692,19 +922,35 @@ function Player({
value={{ wait: slide.seconds / 2, screen, paused, scrolls: (s) => setScroll({ index, seconds: s }) }}
>
-
+
+
+
{/* How long this slide has left. */}
-
+ {frame !== 'none' && (
+ )}
+
+ {look?.logo && (
+
-
+ )}
-
+
)
}
@@ -937,24 +1190,38 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
if (slide.kind === 'venue') {
const venue = slide.venue!
+ const only = slide.only
+ const locations = only ? venue.locations.filter((location) => only.includes(location.key)) : venue.locations
+ const heading = slide.title ?? venue.name
+ // Map only: the map under its title, as big as the slide holds.
+ if (slide.noList && venue.map_image) {
+ return (
+
+ {heading}
+
+
+
+
+ )
+ }
return (
{venue.map_image && (
-
+
)}
-
{venue.name}
+
{heading}
- {venue.locations.map((location, i) => (
+ {locations.map((location, i) => (
{location.name}
- {location.detail && (
+ {location.detail && !slide.noDetails && (
{location.detail}
)}
@@ -983,7 +1250,7 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
{location.name}
- {location.detail && (
+ {location.detail && !slide.noDetails && (
{location.detail}
@@ -1002,7 +1269,7 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
const items = slide.items ?? []
return (
-
{slide.label}
+
{slide.title ?? slide.label}
4 ? 'grid-cols-3' : 'grid-cols-2'}`}>
{items.map((item, i) => {
diff --git a/src/pages/sections/OrgList-Card.tsx b/src/pages/sections/OrgList-Card.tsx
index 05837c4..23601e3 100644
--- a/src/pages/sections/OrgList-Card.tsx
+++ b/src/pages/sections/OrgList-Card.tsx
@@ -159,6 +159,25 @@ function Block({ title, orgs, accent, pageLabel, siteLabel, nested = false }) {
}
+/* Just the logos, in a row: an organizations block presented (095).
+ Picked ones in their order, else every one of the kind by name. */
+export function OrgLogoRow({ kind, ids, accent = FALLBACK_COLOR }: { kind?: string | null; ids?: string[]; accent?: string }) {
+ const { organizations } = useOrganizations(kind, ids);
+ const sorted = ids?.length
+ ? ids.flatMap((id) => organizations.filter((org) => org.id === id))
+ : [...organizations].sort(byName);
+ return (
+
+ {sorted.map((org) => (
+
+ {org.name}
+
+
+ ))}
+
+ );
+}
+
export default function OrgListCards({
kind,
ids,
From b76f2a57075c8d02a72f2de1fb6264827ed11523 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 04:14:14 -0600
Subject: [PATCH 14/33] Present: dark theme settings, a Theme pick, and a
content inset
- Event Presentation, dark theme (096): background image and color,
dim, accent, text color and logo for a dark screen; blank takes the
light one
- Setup's Theme holds a screen light or dark while it plays (`theme=`)
- Inset top, right, bottom and left (097), percent of the screen, so
the slides sit inside a frame drawn in the background image; with
any set the image is stretched to the screen
Co-Authored-By: Claude Opus 5.5
---
server/src/admin-schema/events.js | 14 ++-
.../src/migrations/096_presentation_dark.sql | 24 ++++++
.../src/migrations/097_presentation_inset.sql | 20 +++++
server/src/routes/content.js | 18 ++++
src/lib/adminSchema/events.ts | 39 +++++++++
src/lib/darkTheme.ts | 15 ++++
src/lib/useContent.ts | 5 ++
src/pages/EventPresent.tsx | 86 ++++++++++++++++---
8 files changed, 209 insertions(+), 12 deletions(-)
create mode 100644 server/src/migrations/096_presentation_dark.sql
create mode 100644 server/src/migrations/097_presentation_inset.sql
create mode 100644 src/lib/darkTheme.ts
diff --git a/server/src/admin-schema/events.js b/server/src/admin-schema/events.js
index 581ef98..21dc3a9 100644
--- a/server/src/admin-schema/events.js
+++ b/server/src/admin-schema/events.js
@@ -1,4 +1,4 @@
-import { text, int, bool, date, time, enumeration, placeColumns, timelineExtension, linksChild, blocksChild, hostsChild } from "./columns.js";
+import { text, int, real, bool, date, time, enumeration, placeColumns, timelineExtension, linksChild, blocksChild, hostsChild } from "./columns.js";
import { tagsChild } from "./tags.js";
/* ── Events ──────────────────────────────────────────────────── */
@@ -77,6 +77,18 @@ export const events = {
text("present_accent"),
text("present_text_color"),
text("present_logo"),
+ // The same in the dark theme (096), null the above.
+ text("present_background_dark"),
+ text("present_background_color_dark"),
+ int("present_dim_dark"),
+ text("present_accent_dark"),
+ text("present_text_color_dark"),
+ text("present_logo_dark"),
+ // Room clear at each edge, eg. inside a frame picture (097).
+ real("present_inset_top"),
+ real("present_inset_right"),
+ real("present_inset_bottom"),
+ real("present_inset_left"),
// A repeating schedule. Columns rather than a side table: the
// schedule is always exactly one per event, and the public view
diff --git a/server/src/migrations/096_presentation_dark.sql b/server/src/migrations/096_presentation_dark.sql
new file mode 100644
index 0000000..69e2b24
--- /dev/null
+++ b/server/src/migrations/096_presentation_dark.sql
@@ -0,0 +1,24 @@
+-- ═══════════════════════════════════════════════════════════════
+-- 096 PRESENTATION SETTINGS IN THE DARK THEME
+--
+-- The same as 095's, for a screen in the dark theme (the device's
+-- setting, or the setup's Theme pick). Each one null takes the
+-- light theme's (095), so only what differs needs setting.
+--
+-- present_background_dark the image behind every slide
+-- present_background_color_dark the slides' background color
+-- present_dim_dark percent of the color over the
+-- image, 0 to 90
+-- present_accent_dark in place of the accent
+-- present_text_color_dark the slides' text
+-- present_logo_dark the bottom-right logo, eg. a
+-- light version
+-- ═══════════════════════════════════════════════════════════════
+
+ALTER TABLE events ADD COLUMN present_background_dark TEXT;
+ALTER TABLE events ADD COLUMN present_background_color_dark TEXT;
+ALTER TABLE events ADD COLUMN present_dim_dark INTEGER
+ CHECK (present_dim_dark BETWEEN 0 AND 90);
+ALTER TABLE events ADD COLUMN present_accent_dark TEXT;
+ALTER TABLE events ADD COLUMN present_text_color_dark TEXT;
+ALTER TABLE events ADD COLUMN present_logo_dark TEXT;
diff --git a/server/src/migrations/097_presentation_inset.sql b/server/src/migrations/097_presentation_inset.sql
new file mode 100644
index 0000000..5f2b043
--- /dev/null
+++ b/server/src/migrations/097_presentation_inset.sql
@@ -0,0 +1,20 @@
+-- ═══════════════════════════════════════════════════════════════
+-- 097 PRESENTATION CONTENT INSET
+--
+-- Room kept clear at each edge of a presented slide, so its content
+-- sits inside a background image that is a frame (eg. a 1920x1080
+-- picture with a border drawn in it). Percent of the screen: top
+-- and bottom of its height, left and right of its width, 0 to 45.
+-- Null is 0. With any set, the background image is stretched to the
+-- screen rather than cropped, so the frame stays where the inset
+-- expects it. Both themes share them.
+-- ═══════════════════════════════════════════════════════════════
+
+ALTER TABLE events ADD COLUMN present_inset_top REAL
+ CHECK (present_inset_top BETWEEN 0 AND 45);
+ALTER TABLE events ADD COLUMN present_inset_right REAL
+ CHECK (present_inset_right BETWEEN 0 AND 45);
+ALTER TABLE events ADD COLUMN present_inset_bottom REAL
+ CHECK (present_inset_bottom BETWEEN 0 AND 45);
+ALTER TABLE events ADD COLUMN present_inset_left REAL
+ CHECK (present_inset_left BETWEEN 0 AND 45);
diff --git a/server/src/routes/content.js b/server/src/routes/content.js
index a8c7963..140ceae 100644
--- a/server/src/routes/content.js
+++ b/server/src/routes/content.js
@@ -604,6 +604,24 @@ content.get("/events/:id", (c) => {
accent: row.present_accent,
text_color: row.present_text_color,
logo: row.present_logo,
+ // Room clear at each edge, percent of the screen (097).
+ inset: [row.present_inset_top, row.present_inset_right, row.present_inset_bottom, row.present_inset_left].some((n) => n)
+ ? {
+ top: row.present_inset_top ?? 0,
+ right: row.present_inset_right ?? 0,
+ bottom: row.present_inset_bottom ?? 0,
+ left: row.present_inset_left ?? 0,
+ }
+ : null,
+ // In the dark theme (096); null takes the above.
+ dark: {
+ background: row.present_background_dark,
+ background_color: row.present_background_color_dark,
+ dim: row.present_dim_dark,
+ accent: row.present_accent_dark,
+ text_color: row.present_text_color_dark,
+ logo: row.present_logo_dark,
+ },
},
blocks: body,
people,
diff --git a/src/lib/adminSchema/events.ts b/src/lib/adminSchema/events.ts
index b170549..2ab4407 100644
--- a/src/lib/adminSchema/events.ts
+++ b/src/lib/adminSchema/events.ts
@@ -226,6 +226,17 @@ export const events = {
],
blankLabel: "Default: a bar on top, the title line and the timer",
},
+ ...([
+ ["top", "Inset top", "of the screen's height"],
+ ["right", "Inset right", "of the screen's width"],
+ ["bottom", "Inset bottom", "of the screen's height"],
+ ["left", "Inset left", "of the screen's width"],
+ ] as const).map(([side, label, of]) => ({
+ path: `present_inset_${side}`,
+ label,
+ widget: "number",
+ help: `Room kept clear at this edge, in percent ${of} (0 to 45), eg. to keep the slides inside a frame drawn in the background image. With any inset the image is stretched to the screen, not cropped. Default: 0.`,
+ })),
{ path: "present_accent", label: "Accent", widget: "color", help: "Default: the event's color" },
{
path: "present_text_color",
@@ -244,6 +255,34 @@ export const events = {
},
],
},
+ {
+ legend: "Presentation, dark theme",
+ note: "For a screen in the dark theme (its own setting, or the Theme picked when presenting). Each one left blank uses the one above.",
+ fields: [
+ {
+ path: "present_background_dark",
+ label: "Background image",
+ widget: "image",
+ crop: "free",
+ resolve: mediaUrl,
+ full: true,
+ help: "Default: the background image above",
+ },
+ { path: "present_background_color_dark", label: "Background color", widget: "color", help: "Default: the one above, else the site's dark background" },
+ { path: "present_dim_dark", label: "Dim", widget: "number", help: "0 to 90 percent. Default: the one above" },
+ { path: "present_accent_dark", label: "Accent", widget: "color", help: "Default: the accent above" },
+ { path: "present_text_color_dark", label: "Text color", widget: "color", help: "Default: the one above" },
+ {
+ path: "present_logo_dark",
+ label: "Logo",
+ widget: "image",
+ folder: "logos",
+ resolve: mediaUrl,
+ full: true,
+ help: "eg. a light version of the logo. Default: the logo above",
+ },
+ ],
+ },
timelineGroup("event"),
timelineDetailGroup("event"),
{ legend: "Publishing", fields: [PUBLISHED_FIELD, LISTED_FIELD] },
diff --git a/src/lib/darkTheme.ts b/src/lib/darkTheme.ts
new file mode 100644
index 0000000..0ac6bc2
--- /dev/null
+++ b/src/lib/darkTheme.ts
@@ -0,0 +1,15 @@
+/* Whether the site is in its dark theme: ,
+ set before the first paint (index.html) and by ThemeToggle. A
+ hook, so a page redraws the moment it changes. */
+
+import { useSyncExternalStore } from 'react'
+
+const read = () => document.documentElement.dataset.theme === 'dark'
+
+function subscribe(onChange: () => void) {
+ const observer = new MutationObserver(onChange)
+ observer.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] })
+ return () => observer.disconnect()
+}
+
+export const useDarkTheme = (): boolean => useSyncExternalStore(subscribe, read, () => false)
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index c26abcc..071eb3a 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -99,6 +99,11 @@ export type EventPresentLook = {
accent: string | null
text_color: string | null
logo: string | null
+ /** Room clear at each edge (097): percent of the screen's height
+ * (top, bottom) and width (left, right); null none. */
+ inset?: { top: number; right: number; bottom: number; left: number } | null
+ /** In the dark theme (096); a null one takes the above. */
+ dark?: Partial>
}
export type MapSection = { name: string; keys: string[] }
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index b6b7917..7c2de3a 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -54,7 +54,9 @@
give its Presentation text, leave it out, and say how a map is
shown. The blocks themselves are drawn for a screen (Presenting):
links as their text, people as round photos and names,
- organizations as their logos.
+ their logos. In the dark theme the event's dark settings (096)
+ take the place of any they set (lookFor); the setup's Theme
+ (`theme=light|dark`) holds a screen in one theme while it plays.
Keys while playing: arrows step, Space pauses, Escape leaves full
screen (the browser's), S goes back to the setup.
@@ -94,6 +96,7 @@ import {
import { mediaUrl } from '../lib/media.ts'
import { BRAND, accentText, readableOn, withAlpha } from '../lib/color.ts'
import { documentTitle } from '../lib/site.ts'
+import { useDarkTheme } from '../lib/darkTheme.ts'
import './EventPresent.css'
/* Each kind of slide, its address key and seconds when unset. */
@@ -126,6 +129,16 @@ const STARTS_SECTION = new Set(['heading', 'tab'])
const FILLER = new Set(['subheading', 'divider'])
/* Percent of the background color over the background image, unset. */
const DIM = 60
+/* The themes a screen can be held in (`theme`). */
+const THEMES = ['light', 'dark'] as const
+
+/* The event's look in the theme shown: in the dark one, its dark
+ settings (096) over the light ones. */
+function lookFor(look: EventPresentLook | undefined, dark: boolean): EventPresentLook | undefined {
+ if (!look || !dark || !look.dark) return look
+ const picked = Object.entries(look.dark).filter(([, value]) => value != null && value !== '')
+ return { ...look, ...Object.fromEntries(picked) }
+}
/* Seconds a long slide takes to scroll one screenful, when unset. */
const PER_SCREEN = 8
@@ -206,6 +219,7 @@ function readSettings(params: URLSearchParams) {
screen: Number.isFinite(screen) && screen > 0 ? screen : PER_SCREEN,
only: params.get('only') || null,
order: list(params.get('order')),
+ theme: THEMES.find((theme) => theme === params.get('theme')) ?? null,
}
}
type Settings = ReturnType
@@ -387,6 +401,19 @@ export default function EventPresent() {
if (event) document.title = documentTitle(`${event.title}: present`)
}, [event])
+ // The setup's Theme, while playing; the device's again after.
+ const held = params.get('play') === '1' ? params.get('theme') : null
+ useEffect(() => {
+ if (held !== 'light' && held !== 'dark') return
+ const root = document.documentElement
+ const was = root.dataset.theme
+ root.dataset.theme = held
+ return () => {
+ if (was) root.dataset.theme = was
+ }
+ }, [held])
+ const dark = useDarkTheme()
+
if (!event) {
return (
(null)
const slides = ordered(buildSlides(sections, schedules, { skipped, hidden, seconds, only }), order)
const count = slides.length
@@ -567,6 +596,28 @@ function Setup({
0 leaves that kind of slide out.
+
+ Theme
+
+
+ Light or dark
+
+ The slides in this theme whatever the screen is set to. The event's Presentation, dark theme settings
+ apply in the dark one.
+
+
+ setTheme(THEMES.find((t) => t === e.target.value) ?? null)}
+ className="border border-muted/25 bg-surface px-2 py-1"
+ >
+ Default: the screen's own
+ Light
+ Dark
+
+
+
+
{tags.length > 0 && (
Tags
@@ -720,7 +771,7 @@ function Setup({
onPlay({ skipped, hidden, seconds, screen, only, order })}
+ onClick={() => onPlay({ skipped, hidden, seconds, screen, only, order, theme })}
className="btn inline-flex items-center gap-2 px-6 py-3 disabled:opacity-50"
style={{ background: accent, color: readableOn(accent) }}
>
@@ -889,15 +940,25 @@ function Player({
const frame = look?.frame ?? null
const background = mediaUrl(look?.background)
const label = slide.label === title || slide.label === slide.title ? '' : slide.label
+ // Room clear at each edge, eg. inside a frame picture (097).
+ const inset = look?.inset
return (
{/* The background image, the background color over it at Dim. */}
{background && (
-
+
)}
@@ -944,12 +1005,15 @@ function Player({
)}
{look?.logo && (
-
+
+
+
)}
Date: Thu, 12 Nov 2026 04:34:30 -0600
Subject: [PATCH 15/33] Present: the logo in the screen's corner, not inset
Co-Authored-By: Claude Opus 5.5
---
src/pages/EventPresent.tsx | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index 7c2de3a..f94039d 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -1005,12 +1005,9 @@ function Player({
)}
{look?.logo && (
+ // In the screen's corner, not inset: it sits on the frame.
From 584340b0eee770d70b0a3102ce4867f92c3b16e5 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 04:40:19 -0600
Subject: [PATCH 16/33] Present: the logo as a plain image, no dark mode plate,
full size
Co-Authored-By: Claude Opus 5.5
---
src/pages/EventPresent.tsx | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index f94039d..1a7239c 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -82,7 +82,6 @@ import {
import ContentBlocks, { eventLine } from '../components/ContentBlocks.tsx'
import { LocationNumber, MapPicture, isMarked, locationNumber } from '../components/MapBlock.tsx'
import { Paragraphs } from '../components/InlineText.tsx'
-import Logo from '../components/Logo.tsx'
import { Presenting } from '../lib/presenting.ts'
import {
useEvent,
@@ -1009,7 +1008,15 @@ function Player({
-
+ {/* A plain img, not Logo: no dark mode plate (the dark
+ theme has its own logo, 096) and the full file, not the
+ 640px copy. Hides itself if it fails to load. */}
+ (e.currentTarget.style.display = 'none')}
+ className="block h-[8vh] w-auto max-w-[16vw] object-contain"
+ />
)}
From 2282bee23cacd20e6e83fee847da458a921922d9 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 04:57:08 -0600
Subject: [PATCH 17/33] 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
---
server/src/admin-schema/columns.js | 3 +
server/src/migrations/098_present_list.sql | 18 ++++
server/src/shape.js | 5 +-
src/components/PeopleTiles.tsx | 2 +-
src/lib/adminSchema/shared.ts | 14 +++
src/lib/useContent.ts | 4 +
src/pages/EventPresent.tsx | 114 +++++++++++++++++++--
7 files changed, 152 insertions(+), 8 deletions(-)
create mode 100644 server/src/migrations/098_present_list.sql
diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js
index e5831c0..9fe002b 100644
--- a/server/src/admin-schema/columns.js
+++ b/server/src/admin-schema/columns.js
@@ -189,6 +189,9 @@ 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: [
{
diff --git a/server/src/migrations/098_present_list.sql b/server/src/migrations/098_present_list.sql
new file mode 100644
index 0000000..7851b18
--- /dev/null
+++ b/server/src/migrations/098_present_list.sql
@@ -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));
diff --git a/server/src/shape.js b/server/src/shape.js
index 5870af4..c64aa66 100644
--- a/server/src/shape.js
+++ b/server/src/shape.js
@@ -74,6 +74,8 @@ 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;
}
@@ -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,
word_motion, word_direction, word_seconds, list_style, org_kind,
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
WHERE owner_kind = ? AND slot IN (?, 'both') AND owner_id IN (${placeholders(ids.length)})
ORDER BY owner_id, sort_order`,
diff --git a/src/components/PeopleTiles.tsx b/src/components/PeopleTiles.tsx
index 906acad..262b37e 100644
--- a/src/components/PeopleTiles.tsx
+++ b/src/components/PeopleTiles.tsx
@@ -777,7 +777,7 @@ function Tile({
function PeopleRow({ groups, people }: { groups?: PeopleGroup[]; people?: Person[] }) {
const everyone = [...(groups ?? []).flatMap((group) => group.people), ...(people ?? [])];
return (
-
+
{everyone.map((person, i) => (
diff --git a/src/lib/adminSchema/shared.ts b/src/lib/adminSchema/shared.ts
index 1c225b5..cba02d3 100644
--- a/src/lib/adminSchema/shared.ts
+++ b/src/lib/adminSchema/shared.ts
@@ -551,6 +551,20 @@ 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 = {
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index 071eb3a..075a319 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -86,6 +86,10 @@ 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). */
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index 1a7239c..7e6e8d3 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -16,6 +16,13 @@
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
+ 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.) and its items
+ (l..- ) on and off.
A schedule's slides, for each day picked, in order:
overview the day's picked entries on one slide
@@ -81,7 +88,7 @@ import {
} from '../components/ScheduleBlock.tsx'
import ContentBlocks, { eventLine } from '../components/ContentBlocks.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 {
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: '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: '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
type Kind = (typeof KINDS)[number]['key']
@@ -121,6 +130,14 @@ 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 =>
+ 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. */
const STARTS_SECTION = new Set(['heading', 'tab'])
/* 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
finds it: t
a section's text; v and p a map and its
locations, c and e an events list and its events, by
- .; o, k, s, g and m a schedule's overview, block,
- spotlight, graphic and map image, and x its tag slides, by key(). */
+ .; l and i a list's overview and items (listKey);
+ 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, picks: Picks): Slide[] {
- const { skipped, seconds } = picks
+ const { skipped, seconds, hidden } = picks
const slides: Slide[] = []
sections.forEach((section, s) => {
if (skipped.has(s)) return
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.
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 })
@@ -329,6 +347,15 @@ function buildSlides(sections: Section[], schedules: Map
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)) {
+ 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') {
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 })
@@ -374,6 +401,10 @@ function slideName(slide: Slide): string {
return slide.location!.name
case 'event':
return entry!.text || entry!.event!.title
+ case 'list':
+ return slide.title ?? (slide.items ?? []).map((item) => item.text).join(', ')
+ case 'item':
+ return entry!.text
default:
return [slide.day?.name, entry!.time, entry!.text].filter(Boolean).join(' · ')
}
@@ -649,7 +680,7 @@ function Setup({
{sections.map((section, 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 (
{section.title}
@@ -659,6 +690,34 @@ function Setup({
{kinds.join(', ')}
{section.blocks.map((block, b) => {
+ // A list with slides: its overview, then its items.
+ if (block.type === 'list' && ownSlides(block)) {
+ return (
+
+ {block.present?.list_overview && (
+
setHidden(toggle(hidden, listKey(s, b)))}
+ />
+ )}
+
+ {(block.items ?? []).map((item, i) => (
+
+ setHidden(toggle(hidden, listKey(s, b, i)))}
+ />
+
+ ))}
+
+
+ )
+ }
const schedule = schedules.get(block)
if (!schedule) return null
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 (
+
+ {slide.title &&
{slide.title} }
+
+
+ {items.map((item, i) => (
+
+
+
+
+
+
+
+ ))}
+
+
+
+ )
+ }
+
const entry = slide.entry!
+ if (slide.kind === 'item') {
+ return (
+
+
+
+
+
+
+
+ {entry.detail && (
+
+
+ {entry.detail}
+
+
+ )}
+
+
+ )
+ }
+
if (slide.kind === 'event') {
const event = entry.event!
const image = mediaUrl(event.image)
From ae06cd2b4f09b208f58609b2976734e330e1c611 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 04:59:11 -0600
Subject: [PATCH 18/33] Blocks: Shown on the page, in the presentation, or both
- present_show (099) replaces present_hide: only on the page, or only
in the presentation, kept off the page and its contents list
- Blocks with the old Leave out ticked become Only on the page
Co-Authored-By: Claude Opus 5.5
---
docs/updating-data-in-code.md | 1 +
server/src/admin-schema/columns.js | 3 ++-
server/src/migrations/099_present_show.sql | 20 ++++++++++++++++++++
server/src/shape.js | 6 ++++--
src/components/ContentBlocks.tsx | 15 +++++++++------
src/lib/adminSchema/shared.ts | 13 +++++++++----
src/lib/useContent.ts | 3 +++
src/pages/EventDetail.tsx | 5 ++++-
8 files changed, 52 insertions(+), 14 deletions(-)
create mode 100644 server/src/migrations/099_present_show.sql
diff --git a/docs/updating-data-in-code.md b/docs/updating-data-in-code.md
index 27e2f17..812b9fa 100644
--- a/docs/updating-data-in-code.md
+++ b/docs/updating-data-in-code.md
@@ -184,6 +184,7 @@ also in `server/src/admin-schema/` and a CHECK):
| Content blocks → Type | heading, subheading, paragraph, list, links, quote, image, divider, video, button, callout, schedule, table, cards, people, map, events, organizations | **yes**, `BLOCK_TYPES` (with each type's description) | `ContentBlocks.tsx` (one renderer per type). Which fields each type shows is `when` on the fields in `blocksChild` (`src/lib/adminSchema/shared.ts`). |
| Content blocks → Schedule items → Type | (blank: normal entry), block, break, heading | **yes**, migration 086 | `SCHEDULE_KINDS` in `src/lib/adminSchema/shared.ts`; drawn by `ScheduleBlock.tsx` and `EventPresent.tsx` (which slides each kind gets; the presentation cuts the event's page into sections at its Heading blocks). A block's sub-items are `content_block_subitems`. A schedule's own tags (087) are `content_block_tags`, rows of the block typed in the admin (not a fixed list); entries name them by `tag_key`, made in the admin as the tag is added. A schedule's Venue (088) lends its locations (Data → Venues, `venue_locations`) to its entries' Map location, named by `location_key` the same way; an entry's Event (a workshop) fills what it leaves blank in `shape.js` (`attachEvents`). |
| Content blocks → List → Style | (blank: bold text, normal detail), plain (plain text, gray detail) | **yes**, migration 092 | The Style field in `src/lib/adminSchema/shared.ts`; drawn by the `list` case in `ContentBlocks.tsx`. |
+| Content blocks (an event's) → Shown | (blank: the page and the presentation), page, presentation | **yes**, migration 099 | `PRESENT_BLOCK_FIELDS` in `src/lib/adminSchema/shared.ts`; `ContentBlocks.tsx` leaves out a presentation-only block on the page and a page-only one presented, `sectionsOf` in `src/pages/EventPresent.tsx` too |
| Content blocks (an event's) → Map → Location slides | (blank: each marked location), picked (the Locations with a slide), none | **yes**, migration 095 | `PRESENT_BLOCK_FIELDS` in `src/lib/adminSchema/shared.ts`; read by `mapSlides` in `src/pages/EventPresent.tsx` |
| Events → Presentation → Frame | (blank: the accent bar, title line and timer), border, none | **yes**, migration 095 | The `present_frame` field in `src/lib/adminSchema/events.ts`; drawn by `Player` in `src/pages/EventPresent.tsx` |
| Content blocks → Organizations → List | (blank: only the picked ones), partner, region, group, ministry | **yes**, migration 093 | The `org_kind` field in `src/lib/adminSchema/shared.ts`; the `organizations` case in `ContentBlocks.tsx` passes it as the kind to `OrgListCards` (`nested`); items picked by `org_id` replace it |
diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js
index 9fe002b..ff4f3d1 100644
--- a/server/src/admin-schema/columns.js
+++ b/server/src/admin-schema/columns.js
@@ -182,7 +182,8 @@ export const blocksChild = (ownerKind) => ({
// Organizations blocks (093): the kind listed when none are picked.
enumeration("org_kind", ["region", "group", "partner", "ministry"]),
// How it's presented (095): EventPresent.tsx.
- bool("present_hide"),
+ // Where it shows (099): null both, the page or the presentation.
+ enumeration("present_show", ["page", "presentation"]),
text("present_text"),
bool("present_map_split"),
bool("present_map_no_list"),
diff --git a/server/src/migrations/099_present_show.sql b/server/src/migrations/099_present_show.sql
new file mode 100644
index 0000000..dba78f7
--- /dev/null
+++ b/server/src/migrations/099_present_show.sql
@@ -0,0 +1,20 @@
+-- ═══════════════════════════════════════════════════════════════
+-- 099 WHERE A BLOCK SHOWS: THE PAGE, THE PRESENTATION OR BOTH
+--
+-- present_hide (095) could only leave a block out of the
+-- presentation. present_show says where it shows instead:
+--
+-- null the page and the presentation
+-- 'page' only on the page (was present_hide = 1)
+-- 'presentation' only in the presentation (EventPresent.tsx), eg.
+-- a slide's welcome line the page doesn't need
+--
+-- present_hide is copied over, then dropped.
+-- ═══════════════════════════════════════════════════════════════
+
+ALTER TABLE content_blocks ADD COLUMN present_show TEXT
+ CHECK (present_show IN ('page', 'presentation'));
+
+UPDATE content_blocks SET present_show = 'page' WHERE present_hide = 1;
+
+ALTER TABLE content_blocks DROP COLUMN present_hide;
diff --git a/server/src/shape.js b/server/src/shape.js
index c64aa66..8c49b89 100644
--- a/server/src/shape.js
+++ b/server/src/shape.js
@@ -67,7 +67,9 @@ export function loadLinks(db, ownerKind, ids) {
/* A block's presentation settings (095), or null with none set. */
function presentOf(row) {
const present = {
- hide: row.present_hide === 1,
+ // Where it shows (099).
+ hide: row.present_show === "page",
+ only: row.present_show === "presentation",
text: row.present_text,
map_split: row.present_map_split === 1,
map_no_list: row.present_map_no_list === 1,
@@ -88,7 +90,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
.prepare(
`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_hide, present_text, present_map_split, present_map_no_list,
+ 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
FROM content_blocks
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index 1e6e709..8ffd806 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -89,12 +89,15 @@ export default function ContentBlocks({
anchorPrefix?: string
}) {
const presenting = usePresenting()
- // Presented, a block set to is left out and the rest take their
- // Presentation text (095).
- if (presenting && blocks) {
- blocks = blocks
- .filter((block) => !block.present?.hide)
- .map((block) => (block.present?.text ? { ...block, text: block.present.text } : block))
+ // Presented, a block shown only on the page is left out and the
+ // rest take their Presentation text (095, 099); on the page, a block
+ // shown only in the presentation is.
+ if (blocks) {
+ blocks = presenting
+ ? blocks
+ .filter((block) => !block.present?.hide)
+ .map((block) => (block.present?.text ? { ...block, text: block.present.text } : block))
+ : blocks.filter((block) => !block.present?.only)
}
if (!blocks?.length) return null
// Headings get ids so a post's contents (PostContents) and a shared
diff --git a/src/lib/adminSchema/shared.ts b/src/lib/adminSchema/shared.ts
index cba02d3..06c556e 100644
--- a/src/lib/adminSchema/shared.ts
+++ b/src/lib/adminSchema/shared.ts
@@ -497,10 +497,15 @@ const SUB_ITEM_FIELDS = [
/* An event's blocks' presentation fields (095), EventPresent.tsx. */
export const PRESENT_BLOCK_FIELDS = [
{
- path: "present_hide",
- label: "Leave out of the presentation",
- widget: "checkbox",
- help: "The page still shows it.",
+ path: "present_show",
+ label: "Shown",
+ widget: "select",
+ options: [
+ ["page", "Only on the page"],
+ ["presentation", "Only in the presentation"],
+ ],
+ blankLabel: "Default: on the page and in the presentation",
+ help: "Only in the presentation keeps it off the page, eg. a welcome line for the screen.",
},
{
path: "present_text",
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index 075a319..bd2fc34 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -76,7 +76,10 @@ export type ContentBlock = {
/** A block's presentation settings (095), EventPresent.tsx. */
export type BlockPresent = {
+ /** Only on the page: left out of the presentation (099). */
hide: boolean
+ /** Only in the presentation: left off the page (099). */
+ only: boolean
/** In place of its text, eg. a shorter heading. */
text: string | null
/** A map: a slide per map section. */
diff --git a/src/pages/EventDetail.tsx b/src/pages/EventDetail.tsx
index ce90497..a0ffd9b 100644
--- a/src/pages/EventDetail.tsx
+++ b/src/pages/EventDetail.tsx
@@ -92,7 +92,10 @@ export default function EventDetail() {
const accent = event.color || BRAND
const groups = peopleGroups(event.people, accent)
// Two headings or more make a list worth showing, as on a post.
- const contents = event.show_contents ? headingAnchors(event.blocks).entries : []
+ // Not a heading shown only in the presentation (099).
+ const contents = event.show_contents
+ ? headingAnchors(event.blocks.filter((block) => !block.present?.only)).entries
+ : []
const withContents = contents.length >= 2
const sections: ShellSection[] = [
From c4bb685bc04d935e721f7ef036c6dc87e5f147b3 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 05:02:06 -0600
Subject: [PATCH 19/33] 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
---
server/src/admin-schema/columns.js | 3 -
.../migrations/100_present_list_picked.sql | 10 ++
server/src/shape.js | 5 +-
src/lib/adminSchema/shared.ts | 14 ---
src/lib/useContent.ts | 4 -
src/pages/EventPresent.tsx | 102 ++++++++++--------
6 files changed, 70 insertions(+), 68 deletions(-)
create mode 100644 server/src/migrations/100_present_list_picked.sql
diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js
index ff4f3d1..5e00110 100644
--- a/server/src/admin-schema/columns.js
+++ b/server/src/admin-schema/columns.js
@@ -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: [
{
diff --git a/server/src/migrations/100_present_list_picked.sql b/server/src/migrations/100_present_list_picked.sql
new file mode 100644
index 0000000..8ee15da
--- /dev/null
+++ b/server/src/migrations/100_present_list_picked.sql
@@ -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;
diff --git a/server/src/shape.js b/server/src/shape.js
index 8c49b89..a622323 100644
--- a/server/src/shape.js
+++ b/server/src/shape.js
@@ -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`,
diff --git a/src/lib/adminSchema/shared.ts b/src/lib/adminSchema/shared.ts
index 06c556e..f469cf4 100644
--- a/src/lib/adminSchema/shared.ts
+++ b/src/lib/adminSchema/shared.ts
@@ -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 = {
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index bd2fc34..f6f5f0f 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -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). */
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index 7e6e8d3..55d8194 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -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.) and its items
- (l..- ) 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
. and
+ i.) and ticks its items on and off (`hide`,
+ l..- ).
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
, 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
-type Picks = Pick
+type Picks = Pick
/* 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, 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
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(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({
{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 (
{section.title}
@@ -690,31 +698,39 @@ function Setup({
{kinds.join(', ')}
{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 (
- {block.present?.list_overview && (
-
setHidden(toggle(hidden, listKey(s, b)))}
- />
+ List: {first}
+ setLists(toggle(lists, overviewKey(s, b)))}
+ />
+ setLists(toggle(lists, itemsKey(s, b)))}
+ />
+ {own && (
+
+ {block.items.map((item, i) => (
+
+ setHidden(toggle(hidden, listKey(s, b, i)))}
+ />
+
+ ))}
+
)}
-
- {(block.items ?? []).map((item, i) => (
-
- setHidden(toggle(hidden, listKey(s, b, i)))}
- />
-
- ))}
-
)
}
@@ -829,7 +845,7 @@ function Setup({
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) }}
>
From d58f630a8f85851ceae03ab6bd316daa9fadcb46 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 05:20:42 -0600
Subject: [PATCH 20/33] Present: events picked on the setup screen, a titles
list slide, people centered
- Setup, per events block: which events, and what's shown (list
slide, picture, type and date, presenter, page content)
- An events block's list slide: titles and presenters as rows, not
cards
- A slide of only people: title and photos centered both ways
Co-Authored-By: Claude Opus 5.5
---
src/pages/EventPresent.tsx | 157 +++++++++++++++++++++++++++----------
1 file changed, 116 insertions(+), 41 deletions(-)
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index 55d8194..1901052 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -13,9 +13,14 @@
schedule each schedule block's slides (below)
venue each map block (088): the map with its locations
place then the map once per marked location, it lit up
- 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)
+ cards each events block (088): its events' titles and
+ presenters on one slide
+ event then each event alone: picture, type and date,
+ title, its presenter and its own page's blocks (else
+ its card text)
+ The setup picks, per events block, which events (`hide`
+ e..- ) and what is shown (EVENT_PARTS, `hide`
+ e
.:).
list a list block picked for an Overview slide: its
items' text, centered
item then, picked for A slide per item, each item: its
@@ -118,7 +123,7 @@ const KINDS = [
{ key: 'tag', label: 'Tag slides', help: "Each schedule tag and everything it's on, after the days", seconds: 15 },
{ key: 'venue', label: 'Maps', help: "A map block: the venue's map with its locations", seconds: 15 },
{ 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 titles and presenters on one slide", seconds: 15 },
{ 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 },
@@ -132,6 +137,20 @@ const OWN_SLIDES = new Map([
['map', 'Map'],
['events', 'Events'],
])
+/* What an events block's slides can show, each ticked off in `hide`
+ by eventKey. */
+const EVENT_PARTS = [
+ ['overview', 'List slide'],
+ ['picture', 'Picture'],
+ ['line', 'Type and date'],
+ ['person', 'Presenter'],
+ ['content', 'Its page content'],
+] as const
+type EventPart = (typeof EVENT_PARTS)[number][0]
+/* An events block's event (by number) or part (by name) in `hide`. */
+const eventKey = (s: number, b: number, at: number | EventPart) =>
+ typeof at === 'number' ? `e${s}.${b}.${at}` : `e${s}.${b}:${at}`
+
/* 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}`
@@ -196,6 +215,8 @@ type Slide = {
only?: string[]
noList?: boolean
noDetails?: boolean
+ /* An events block's parts ticked off on the setup screen. */
+ off?: Set
}
/* A part of the page: a heading (`headed`, else the event's title)
@@ -363,10 +384,13 @@ function buildSlides(sections: Section[], schedules: Map
}
}
if (block.type === 'events') {
- 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 })
+ const off = new Set(EVENT_PARTS.map(([part]) => part).filter((part) => hidden.has(eventKey(s, b, part))))
+ const items = (block.items ?? []).flatMap((item, i) => (item.event && !hidden.has(eventKey(s, b, i)) ? [{ item, i }] : []))
+ 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) {
- items.forEach((entry, i) => slides.push({ id: `e${at}.${i}`, kind: 'event', seconds: seconds.event, label, entry }))
+ for (const { item, i } of items) slides.push({ id: `e${at}.${i}`, kind: 'event', seconds: seconds.event, label, entry: item, off })
}
}
})
@@ -734,6 +758,42 @@ function Setup({
)
}
+ // An events block: what's shown, then which events.
+ if (block.type === 'events') {
+ const events = (block.items ?? []).flatMap((item, i) => (item.event ? [{ item, i }] : []))
+ if (!events.length) return null
+ const name = (item: ContentBlockItem) => item.text || item.event!.title
+ return (
+
+
+ Events: {preview(events.map(({ item }) => name(item)).join(', '), 60)}
+
+
+ {EVENT_PARTS.map(([part, partLabel]) => (
+
setHidden(toggle(hidden, eventKey(s, b, part)))}
+ />
+ ))}
+
+
+ {events.map(({ item, i }) => (
+
+ setHidden(toggle(hidden, eventKey(s, b, i)))}
+ />
+
+ ))}
+
+
+ )
+ }
const schedule = schedules.get(block)
if (!schedule) return null
const { n, days } = schedule
@@ -1317,6 +1377,22 @@ 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: the title and their photos in the middle of the
+ // slide, both ways.
+ if (slide.blocks!.every((block) => block.type === 'people' || FILLER.has(block.type))) {
+ return (
+
+
+ {slide.label}
+
+
+
+
+
+
+
+ )
+ }
return (
{slide.label}
@@ -1409,35 +1485,30 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
}
if (slide.kind === 'cards') {
+ // The events' titles, each with its presenter, as rows.
const items = slide.items ?? []
+ const off = slide.off ?? new Set()
return (
{slide.title ?? slide.label}
- 4 ? 'grid-cols-3' : 'grid-cols-2'}`}>
- {items.map((item, i) => {
- const image = mediaUrl(item.event!.image)
- return (
-
-
- {image && }
-
- {eventLine(item.event!) && (
-
- {eventLine(item.event!)}
-
- )}
-
- {item.text || item.event!.title}
-
- {item.person && (
-
{item.person.name}
- )}
-
-
-
- )
- })}
+ ONE_COLUMN ? 'grid-cols-2' : 'grid-cols-1'}`}>
+ {items.map((item, i) => (
+
+
+
+ {item.text || item.event!.title}
+
+ {item.person && !off.has('person') && (
+ {item.person.name}
+ )}
+
+
+ ))}
@@ -1491,11 +1562,15 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
if (slide.kind === 'event') {
const event = entry.event!
- const image = mediaUrl(event.image)
- const blurb = entry.detail || event.blurb
+ // What the setup left on (EVENT_PARTS).
+ const off = slide.off ?? new Set()
+ const image = off.has('picture') ? null : mediaUrl(event.image)
+ const line = off.has('line') ? null : eventLine(event)
+ const person = off.has('person') ? null : entry.person
+ const blurb = off.has('content') ? null : entry.detail || event.blurb
// Its own page's blocks, when it has some, in place of its card
// text, zoomed for the column they're in.
- const blocks = event.blocks?.length ? event.blocks : null
+ const blocks = !off.has('content') && event.blocks?.length ? event.blocks : null
const zoom = Math.max(1, (window.innerWidth * 0.75) / TEXT_WIDTH)
return (
@@ -1505,10 +1580,10 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
)}
- {eventLine(event) && (
+ {line && (
- {eventLine(event)}
+ {line}
)}
@@ -1517,13 +1592,13 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
{entry.text || event.title}
- {entry.person && (
+ {person && (
-
+
- {entry.person.name}
- {entry.person.tagline && (
- {entry.person.tagline}
+ {person.name}
+ {person.tagline && (
+ {person.tagline}
)}
From afa95179ef57e275ca35cf698cf2782e5899d5f8 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 05:32:09 -0600
Subject: [PATCH 21/33] Present: people roles picked on setup, an events list
that fits
- Setup, per people block: each one's role or title under their name
(`titles`)
- An events list slide: presenters under the titles, columns that
flow, shrunk to fit rather than scrolled (Fit)
Co-Authored-By: Claude Opus 5.5
---
src/components/ContentBlocks.tsx | 4 +-
src/components/PeopleTiles.tsx | 11 ++++-
src/lib/useContent.ts | 3 ++
src/pages/EventPresent.tsx | 83 +++++++++++++++++++++++++-------
4 files changed, 79 insertions(+), 22 deletions(-)
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index 8ffd806..36286bb 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -642,8 +642,8 @@ function Block({
if (!block.team_id && picked.length === 0) return null
return (
- {block.team_id &&
}
- {picked.length > 0 &&
}
+ {block.team_id &&
}
+ {picked.length > 0 &&
}
)
}
diff --git a/src/components/PeopleTiles.tsx b/src/components/PeopleTiles.tsx
index 262b37e..c01ccd5 100644
--- a/src/components/PeopleTiles.tsx
+++ b/src/components/PeopleTiles.tsx
@@ -167,6 +167,8 @@ export interface PeopleTilesProps
headingLevel?: 3 | 4 | 5;
/** Just round photos and names in a row, as presented (095). */
row?: boolean;
+ /** In the row, each one's role or title under their name. */
+ titles?: boolean;
/** How long a fetched team or person is reused, in ms. */
ttl?: number;
emptyMessage?: string;
@@ -198,9 +200,13 @@ export default function PeopleTiles({
loadingMessage = "Loading…",
errorMessage = "Couldn't load this list right now.",
row = false,
+ titles = false,
...view
}: PeopleTilesProps) {
- const View = row ? PeopleRow : PeopleTilesView;
+ const View = useMemo(
+ () => (row ? (props) => : PeopleTilesView),
+ [row, titles],
+ );
const specs = useMemo(() => normalizeTeams(teams), [teams]);
const teamKey = specs.map((spec) => spec.id).join(",");
@@ -774,7 +780,7 @@ function Tile({
/* Everyone in the groups, then the people, as round photos over
their names, left to right: a people block presented (095). */
-function PeopleRow({ groups, people }: { groups?: PeopleGroup[]; people?: Person[] }) {
+function PeopleRow({ groups, people, titles = false }: { groups?: PeopleGroup[]; people?: Person[]; titles?: boolean }) {
const everyone = [...(groups ?? []).flatMap((group) => group.people), ...(people ?? [])];
return (
@@ -784,6 +790,7 @@ function PeopleRow({ groups, people }: { groups?: PeopleGroup[]; people?: Person
{person.name}
+ {titles && person.title && {person.title} }
))}
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index f6f5f0f..b95c9d5 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -76,6 +76,9 @@ export type ContentBlock = {
/** A block's presentation settings (095), EventPresent.tsx. */
export type BlockPresent = {
+ /** A people block: each one's role or title under their name, as
+ * the Present setup picks (not stored). */
+ titles?: boolean
/** Only on the page: left out of the presentation (099). */
hide: boolean
/** Only in the presentation: left off the page (099). */
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index 1901052..71dc296 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -28,7 +28,8 @@
A list picked for neither is part of its section's text. The
setup picks them per list (`lists`, o. and
i.) and ticks its items on and off (`hide`,
- l..- ).
+ l
..- ). A people block shows each one's role
+ or title when the setup ticks it (`titles`,
.).
A schedule's slides, for each day picked, in order:
overview the day's picked entries on one slide
@@ -99,6 +100,7 @@ import { Presenting } from '../lib/presenting.ts'
import {
useEvent,
type ContentBlock,
+ type BlockPresent,
type ContentBlockItem,
type EventPresentLook,
type ScheduleTag,
@@ -262,11 +264,12 @@ function readSettings(params: URLSearchParams) {
only: params.get('only') || null,
order: list(params.get('order')),
lists: new Set(list(params.get('lists')) ?? []),
+ titles: new Set(list(params.get('titles')) ?? []),
theme: THEMES.find((theme) => theme === params.get('theme')) ?? null,
}
}
type Settings = ReturnType
-type Picks = Pick
+type Picks = Pick
/* An entry or sub-item with its key (key()), carried through the
picks and the tag filter, which copy blocks. */
@@ -359,12 +362,17 @@ 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, picks: Picks): Slide[] {
- const { skipped, seconds, hidden, lists } = picks
+ const { skipped, seconds, hidden, lists, titles } = picks
const slides: Slide[] = []
sections.forEach((section, s) => {
if (skipped.has(s)) return
const label = section.title
- const text = section.blocks.filter((block, b) => !ownSlides(block, lists, s, b))
+ const text = section.blocks.flatMap((block, b) => {
+ if (ownSlides(block, lists, s, b)) return []
+ // A people block picked to show roles and titles.
+ if (block.type === 'people' && titles.has(`${s}.${b}`)) return [{ ...block, present: { ...block.present, titles: true } as BlockPresent }]
+ return [block]
+ })
// 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 })
@@ -541,6 +549,7 @@ export default function EventPresent() {
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(','))
+ if (next.titles.size) out.set('titles', [...next.titles].join(','))
out.set('play', '1')
setParams(out)
}}
@@ -575,8 +584,9 @@ function Setup({
const [order, setOrder] = useState(settings.order)
const [theme, setTheme] = useState(settings.theme)
const [lists, setLists] = useState(settings.lists)
+ const [titles, setTitles] = useState(settings.titles)
const [dragging, setDragging] = useState(null)
- const slides = ordered(buildSlides(sections, schedules, { skipped, hidden, seconds, only, lists }), order)
+ const slides = ordered(buildSlides(sections, schedules, { skipped, hidden, seconds, only, lists, titles }), order)
const count = slides.length
// Moves a slide in the list, which then names every slide shown.
const move = (from: number, to: number) => {
@@ -758,6 +768,19 @@ function Setup({
)
}
+ // A people block: their roles and titles, or not.
+ if (block.type === 'people') {
+ return (
+
+
setTitles(toggle(titles, `${s}.${b}`))}
+ />
+
+ )
+ }
// An events block: what's shown, then which events.
if (block.type === 'events') {
const events = (block.items ?? []).flatMap((item, i) => (item.event ? [{ item, i }] : []))
@@ -905,7 +928,7 @@ function Setup({
onPlay({ skipped, hidden, seconds, screen, only, order, theme, lists })}
+ onClick={() => onPlay({ skipped, hidden, seconds, screen, only, order, theme, lists, titles })}
className="btn inline-flex items-center gap-2 px-6 py-3 disabled:opacity-50"
style={{ background: accent, color: readableOn(accent) }}
>
@@ -1253,6 +1276,32 @@ function Scroll({ center = false, className = '', children }: {
)
}
+/* A slide's part shrunk to fit the room it has, never scrolled:
+ zoomed down until its content is no taller than its box (a few
+ passes, since text narrower in zoom wraps less). */
+function Fit({ className = '', children }: { className?: string; children: ReactNode }) {
+ const box = useRef(null)
+ const inner = useRef(null)
+ useLayoutEffect(() => {
+ const outer = box.current
+ const content = inner.current
+ if (!outer || !content) return
+ let zoom = 1
+ content.style.zoom = '1'
+ for (let pass = 0; pass < 4; pass++) {
+ const tall = content.getBoundingClientRect().height
+ if (tall <= outer.clientHeight + 1) break
+ zoom *= outer.clientHeight / tall
+ content.style.zoom = String(zoom)
+ }
+ }, [])
+ return (
+
+ )
+}
+
/* A slide's big title. */
function SlideTitle({ children, color }: { children: ReactNode; color: string }) {
return (
@@ -1485,32 +1534,30 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
}
if (slide.kind === 'cards') {
- // The events' titles, each with its presenter, as rows.
+ // The events' titles, each with its presenter under it, in
+ // columns that flow (no row lined up with its neighbor's), shrunk
+ // to fit rather than scrolled.
const items = slide.items ?? []
const off = slide.off ?? new Set()
return (
{slide.title ?? slide.label}
-
- ONE_COLUMN ? 'grid-cols-2' : 'grid-cols-1'}`}>
+
+ ONE_COLUMN ? 'columns-2' : ''}`}>
{items.map((item, i) => (
-
-
-
+
+
+
{item.text || item.event!.title}
{item.person && !off.has('person') && (
- {item.person.name}
+ {item.person.name}
)}
))}
-
+
)
}
From c46a61222632ee23e2fc65781147972b9e9e6027 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 05:47:35 -0600
Subject: [PATCH 22/33] Present: callout slides, Select all and Deselect all on
the setup
- Setup, per callout block: a slide of its own, centered under the
subheading above it (else the section's heading); Callouts seconds
- Select all and Deselect all over each list of the setup's checkboxes
Co-Authored-By: Claude Opus 5.5
---
src/pages/EventPresent.tsx | 136 ++++++++++++++++++++++++++++++++++++-
1 file changed, 133 insertions(+), 3 deletions(-)
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index 71dc296..35e382d 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -30,6 +30,11 @@
i.) and ticks its items on and off (`hide`,
l..- ). A people block shows each one's role
or title when the setup ticks it (`titles`,
.).
+ callout a callout block the setup picks for a slide of its
+ own (`lists`, q.): its text centered
+ under its heading (the subheading above it in the
+ section, else the section's), out of the section's
+ text slide
A schedule's slides, for each day picked, in order:
overview the day's picked entries on one slide
@@ -129,6 +134,7 @@ const KINDS = [
{ 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 },
+ { key: 'callout', label: 'Callouts', help: 'A callout picked for a slide of its own, centered under its heading', seconds: 12 },
] as const
type Kind = (typeof KINDS)[number]['key']
@@ -156,13 +162,17 @@ const eventKey = (s: number, b: number, at: number | EventPart) =>
/* 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 callout's pick in `lists`: a slide of its own. */
+const calloutKey = (s: number, b: number) => `q${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. */
+ for an Overview slide or A slide per item, a callout picked for its
+ own slide), else null. */
const ownSlides = (block: ContentBlock, lists: Set, s: number, b: number): string | null =>
OWN_SLIDES.get(block.type) ??
- (block.type === 'list' && (lists.has(overviewKey(s, b)) || lists.has(itemsKey(s, b))) ? 'List' : null)
+ (block.type === 'list' && (lists.has(overviewKey(s, b)) || lists.has(itemsKey(s, b))) ? 'List' : null) ??
+ (block.type === 'callout' && lists.has(calloutKey(s, b)) ? 'Callout' : null)
/* Blocks that start a section. */
const STARTS_SECTION = new Set(['heading', 'tab'])
@@ -382,6 +392,12 @@ function buildSlides(sections: Section[], schedules: Map
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 === 'callout' && seconds.callout && ownSlides(block, lists, s, b)) {
+ // Under the subheading above it in the section, else the section's heading.
+ const above = section.blocks.slice(0, b).reverse().find((other) => other.type === 'subheading')
+ const heading = (above && (above.present?.text || above.text)) || label
+ slides.push({ id: `q${at}`, kind: 'callout', seconds: seconds.callout, label, title: heading, blocks: [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 && lists.has(overviewKey(s, b)) && items.length) {
@@ -443,6 +459,8 @@ function slideName(slide: Slide): string {
return slide.title ?? (slide.items ?? []).map((item) => item.text).join(', ')
case 'item':
return entry!.text
+ case 'callout':
+ return `${slide.title}: ${preview(slide.blocks?.[0]?.text, 40)}`
default:
return [slide.day?.name, entry!.time, entry!.text].filter(Boolean).join(' · ')
}
@@ -718,7 +736,8 @@ function Setup({
Sections
- The page's parts, each starting at a Heading block.
+ The page's parts, each starting at a Heading block.
+ s)} off={skipped} onChange={setSkipped} className="mb-4" />
{sections.map((section, s) => {
const on = !skipped.has(s)
@@ -751,6 +770,15 @@ function Setup({
checked={lists.has(itemsKey(s, b))}
onToggle={() => setLists(toggle(lists, itemsKey(s, b)))}
/>
+ {own && (
+
listKey(s, b, i))}
+ off={hidden}
+ onChange={setHidden}
+ enabled={on}
+ className="pl-7"
+ />
+ )}
{own && (
{block.items.map((item, i) => (
@@ -768,6 +796,19 @@ function Setup({
)
}
+ // A callout: a slide of its own, or the section's text.
+ if (block.type === 'callout' && block.text) {
+ return (
+
+
setLists(toggle(lists, calloutKey(s, b)))}
+ />
+
+ )
+ }
// A people block: their roles and titles, or not.
if (block.type === 'people') {
return (
@@ -791,6 +832,12 @@ function Setup({
Events: {preview(events.map(({ item }) => name(item)).join(', '), 60)}
+ eventKey(s, b, part))}
+ off={hidden}
+ onChange={setHidden}
+ enabled={on}
+ />
{EVENT_PARTS.map(([part, partLabel]) => (
))}
+ eventKey(s, b, i))}
+ off={hidden}
+ onChange={setHidden}
+ enabled={on}
+ className="pl-7"
+ />
{events.map(({ item, i }) => (
@@ -822,6 +876,9 @@ function Setup({
const { n, days } = schedule
return (
+ {days.length > 1 && (
+
key(n, d))} off={hidden} onChange={setHidden} enabled={on} />
+ )}
{days.map((day, d) => (
setHidden(toggle(hidden, key(n, d)))}
/>
+ key(n, d, e))}
+ off={hidden}
+ onChange={setHidden}
+ enabled={on && !hidden.has(key(n, d))}
+ className="mt-2 pl-7"
+ />
{day.entries.map((entry, e) => (
@@ -841,6 +905,14 @@ function Setup({
onToggle={() => setHidden(toggle(hidden, key(n, d, e)))}
/>
{entry.kind === 'block' && entry.items?.length ? (
+ <>
+ key(n, d, e, i))}
+ off={hidden}
+ onChange={setHidden}
+ enabled={on && !hidden.has(key(n, d)) && !hidden.has(key(n, d, e))}
+ className="mt-2 pl-7"
+ />
{entry.items.map((item, i) => (
@@ -853,6 +925,7 @@ function Setup({
))}
+ >
) : null}
))}
@@ -947,6 +1020,42 @@ function Setup({
)
}
+/* Select all and Deselect all for a list of the setup's checkboxes,
+ each ticked off while its key is in `off`. */
+function AllNone({
+ keys,
+ off,
+ onChange,
+ enabled = true,
+ className = '',
+}: {
+ keys: T[]
+ off: Set
+ onChange: (next: Set) => void
+ enabled?: boolean
+ className?: string
+}) {
+ const set = (on: boolean) => {
+ const next = new Set(off)
+ for (const k of keys) {
+ if (on) next.delete(k)
+ else next.add(k)
+ }
+ onChange(next)
+ }
+ const button = 'text-link underline disabled:no-underline disabled:opacity-50'
+ return (
+
+ !off.has(k))} onClick={() => set(true)} className={button}>
+ Select all
+
+ off.has(k))} onClick={() => set(false)} className={button}>
+ Deselect all
+
+
+ )
+}
+
/* One checkbox on the setup screen: a schedule entry (its time and
kind beside it) or a day (`label`, `strong`). */
const KIND_NOTE = { block: 'Block', break: 'Break', heading: 'Heading' } as const
@@ -1562,6 +1671,27 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
)
}
+ if (slide.kind === 'callout') {
+ // The callout's tinted box, its text large, in the middle of the
+ // slide under its heading.
+ const block = slide.blocks![0]
+ return (
+
+
+ {slide.title}
+
+
+
+
+
+ )
+ }
+
if (slide.kind === 'list') {
const items = slide.items ?? []
return (
From c26e6624068270d8acddf3f704ae4283f4fda8c4 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 05:49:27 -0600
Subject: [PATCH 23/33] Present: a callout slide without its tint and bar
Co-Authored-By: Claude Opus 5.5
---
src/pages/EventPresent.tsx | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index 35e382d..da19123 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -1672,18 +1672,15 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
}
if (slide.kind === 'callout') {
- // The callout's tinted box, its text large, in the middle of the
- // slide under its heading.
+ // The callout's text large, in the middle of the slide under its
+ // heading: no tint or bar, the slide is the callout.
const block = slide.blocks![0]
return (
{slide.title}
-
From a0eb9d7e495df00995236d16cb324513ec33f80a Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 05:58:49 -0600
Subject: [PATCH 24/33] Image block: a Size (small, medium, large), centered
- image_size (101): blank the column's full width, else up to 20, 32
or 48rem, centered and never wider than the column
Co-Authored-By: Claude Opus 5.5
---
docs/updating-data-in-code.md | 1 +
server/src/admin-schema/columns.js | 2 ++
server/src/migrations/101_image_size.sql | 15 +++++++++++++++
server/src/shape.js | 3 ++-
src/components/ContentBlocks.tsx | 5 ++++-
src/lib/adminSchema/shared.ts | 13 +++++++++++++
src/lib/useContent.ts | 2 ++
7 files changed, 39 insertions(+), 2 deletions(-)
create mode 100644 server/src/migrations/101_image_size.sql
diff --git a/docs/updating-data-in-code.md b/docs/updating-data-in-code.md
index 812b9fa..ccdf11b 100644
--- a/docs/updating-data-in-code.md
+++ b/docs/updating-data-in-code.md
@@ -183,6 +183,7 @@ also in `server/src/admin-schema/` and a CHECK):
| Content blocks → Shown in (slot) | card, body | **yes** | `paragraphs()` in `server/src/shape.js` (card), `ContentBlocks.tsx` (body) |
| Content blocks → Type | heading, subheading, paragraph, list, links, quote, image, divider, video, button, callout, schedule, table, cards, people, map, events, organizations | **yes**, `BLOCK_TYPES` (with each type's description) | `ContentBlocks.tsx` (one renderer per type). Which fields each type shows is `when` on the fields in `blocksChild` (`src/lib/adminSchema/shared.ts`). |
| Content blocks → Schedule items → Type | (blank: normal entry), block, break, heading | **yes**, migration 086 | `SCHEDULE_KINDS` in `src/lib/adminSchema/shared.ts`; drawn by `ScheduleBlock.tsx` and `EventPresent.tsx` (which slides each kind gets; the presentation cuts the event's page into sections at its Heading blocks). A block's sub-items are `content_block_subitems`. A schedule's own tags (087) are `content_block_tags`, rows of the block typed in the admin (not a fixed list); entries name them by `tag_key`, made in the admin as the tag is added. A schedule's Venue (088) lends its locations (Data → Venues, `venue_locations`) to its entries' Map location, named by `location_key` the same way; an entry's Event (a workshop) fills what it leaves blank in `shape.js` (`attachEvents`). |
+| Content blocks → Image → Size | (blank: the column's full width), small (20rem), medium (32rem), large (48rem) | **yes**, migration 101 | The `image_size` field in `src/lib/adminSchema/shared.ts`; `IMAGE_SIZE` in `ContentBlocks.tsx` sets the widths |
| Content blocks → List → Style | (blank: bold text, normal detail), plain (plain text, gray detail) | **yes**, migration 092 | The Style field in `src/lib/adminSchema/shared.ts`; drawn by the `list` case in `ContentBlocks.tsx`. |
| Content blocks (an event's) → Shown | (blank: the page and the presentation), page, presentation | **yes**, migration 099 | `PRESENT_BLOCK_FIELDS` in `src/lib/adminSchema/shared.ts`; `ContentBlocks.tsx` leaves out a presentation-only block on the page and a page-only one presented, `sectionsOf` in `src/pages/EventPresent.tsx` too |
| Content blocks (an event's) → Map → Location slides | (blank: each marked location), picked (the Locations with a slide), none | **yes**, migration 095 | `PRESENT_BLOCK_FIELDS` in `src/lib/adminSchema/shared.ts`; read by `mapSlides` in `src/pages/EventPresent.tsx` |
diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js
index 5e00110..bb911c8 100644
--- a/server/src/admin-schema/columns.js
+++ b/server/src/admin-schema/columns.js
@@ -179,6 +179,8 @@ export const blocksChild = (ownerKind) => ({
text("venue_id"),
// List blocks (092): null bold text, 'plain' the old look.
enumeration("list_style", ["plain"]),
+ // Image blocks (101): null full width, else a narrower size.
+ enumeration("image_size", ["small", "medium", "large"]),
// Organizations blocks (093): the kind listed when none are picked.
enumeration("org_kind", ["region", "group", "partner", "ministry"]),
// How it's presented (095): EventPresent.tsx.
diff --git a/server/src/migrations/101_image_size.sql b/server/src/migrations/101_image_size.sql
new file mode 100644
index 0000000..5000b55
--- /dev/null
+++ b/server/src/migrations/101_image_size.sql
@@ -0,0 +1,15 @@
+-- ═══════════════════════════════════════════════════════════════
+-- 101 AN IMAGE BLOCK'S SIZE
+--
+-- How wide an image block shows, centered in the column:
+--
+-- null the column's full width (as before)
+-- small up to 20rem
+-- medium up to 32rem
+-- large up to 48rem
+--
+-- Never wider than the column. Other block types ignore it.
+-- ═══════════════════════════════════════════════════════════════
+
+ALTER TABLE content_blocks ADD COLUMN image_size TEXT
+ CHECK (image_size IN ('small', 'medium', 'large'));
diff --git a/server/src/shape.js b/server/src/shape.js
index a622323..adb5e66 100644
--- a/server/src/shape.js
+++ b/server/src/shape.js
@@ -87,7 +87,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
const blockRows = db
.prepare(
`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, image_size, org_kind,
present_show, present_text, present_map_split, present_map_no_list,
present_map_no_details, present_places, present_place_keys
FROM content_blocks
@@ -112,6 +112,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
team_id: row.team_id,
venue_id: row.venue_id,
list_style: row.list_style,
+ image_size: row.image_size,
org_kind: row.org_kind,
// Its rotating words' motion (084), when it has its own.
words: row.word_motion || row.word_direction || row.word_seconds
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index 36286bb..6764ba7 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -76,6 +76,9 @@ import { usePresenting } from '../lib/presenting.ts'
const BODY = 'var(--color-muted)'
+/* An image block's Size (101): its widest, centered. */
+const IMAGE_SIZE = { small: 'max-w-[20rem]', medium: 'max-w-[32rem]', large: 'max-w-[48rem]' } as const
+
export default function ContentBlocks({
blocks,
accent = BRAND,
@@ -579,7 +582,7 @@ function Block({
/>
)
return (
-
+
{block.href ? {img} : img}
diff --git a/src/lib/adminSchema/shared.ts b/src/lib/adminSchema/shared.ts
index f469cf4..5f63bcd 100644
--- a/src/lib/adminSchema/shared.ts
+++ b/src/lib/adminSchema/shared.ts
@@ -659,6 +659,19 @@ export const blocksChild = {
when: { path: "type", value: "video" },
help: "A WebVTT (.vtt) file, for an uploaded video; YouTube, Vimeo and Facebook show their own. Default: none.",
},
+ {
+ path: "image_size",
+ label: "Size",
+ widget: "select",
+ options: [
+ ["small", "Small (up to 20rem)"],
+ ["medium", "Medium (up to 32rem)"],
+ ["large", "Large (up to 48rem)"],
+ ],
+ blankLabel: "Default: the column's full width",
+ help: "A smaller one is centered. Never wider than the column.",
+ when: { path: "type", value: "image" },
+ },
{
path: "alt",
label: "Alt text",
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index b95c9d5..3daaef8 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -57,6 +57,8 @@ export type ContentBlock = {
cite?: string | null
/** A list block's style (092): null bold text, 'plain' the old look. */
list_style?: 'plain' | null
+ /** An image block's size (101): null the column's width. */
+ image_size?: 'small' | 'medium' | 'large' | null
/** An organizations block's kind, listed when none are picked (093). */
org_kind?: 'region' | 'group' | 'partner' | 'ministry' | null
/** A video block's WebVTT file, for an uploaded video (066). */
From a59702b7f35fe56c4ae1cb039ac1ad657cb93638 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 06:04:48 -0600
Subject: [PATCH 25/33] Present: a section's pictures left or right of its
text, fitted
- Setup, per section with pictures and text: Pictures in the text,
left of it or right of it (`pictures`), in a column beside the rest
- That slide shrinks to fit (Fit), measured again as pictures load
Co-Authored-By: Claude Opus 5.5
---
src/pages/EventPresent.tsx | 108 ++++++++++++++++++++++++++++++++-----
1 file changed, 95 insertions(+), 13 deletions(-)
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index da19123..6fb705b 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -30,6 +30,9 @@
i.) and ticks its items on and off (`hide`,
l..- ). A people block shows each one's role
or title when the setup ticks it (`titles`,
.).
+ A section with pictures (image blocks) and other text can have the
+ setup put its pictures in a column left or right of the rest
+ (`pictures`, :left|right), the slide shrunk to fit.
callout a callout block the setup picks for a slide of its
own (`lists`, q.): its text centered
under its heading (the subheading above it in the
@@ -174,6 +177,11 @@ const ownSlides = (block: ContentBlock, lists: Set, s: number, b: number
(block.type === 'list' && (lists.has(overviewKey(s, b)) || lists.has(itemsKey(s, b))) ? 'List' : null) ??
(block.type === 'callout' && lists.has(calloutKey(s, b)) ? 'Callout' : null)
+/* Where a section's pictures can go beside its text. */
+const SIDES = ['left', 'right'] as const
+type Side = (typeof SIDES)[number]
+const isPicture = (block: ContentBlock) => block.type === 'image'
+
/* Blocks that start a section. */
const STARTS_SECTION = new Set(['heading', 'tab'])
/* Text that alone makes no section slide: the heading titles what
@@ -219,6 +227,8 @@ type Slide = {
days?: Day[]
tags?: ScheduleTag[]
blocks?: ContentBlock[]
+ /* A section's pictures in a column beside its text (the setup). */
+ pictures?: Side
venue?: Venue
location?: VenueLocation
items?: ContentBlockItem[]
@@ -275,11 +285,17 @@ function readSettings(params: URLSearchParams) {
order: list(params.get('order')),
lists: new Set(list(params.get('lists')) ?? []),
titles: new Set(list(params.get('titles')) ?? []),
+ pictures: new Map(
+ (list(params.get('pictures')) ?? []).flatMap((pick) => {
+ const [at, side] = pick.split(':')
+ return SIDES.includes(side as Side) ? [[Number(at), side as Side] as const] : []
+ }),
+ ),
theme: THEMES.find((theme) => theme === params.get('theme')) ?? null,
}
}
type Settings = ReturnType
-type Picks = Pick
+type Picks = Pick
/* An entry or sub-item with its key (key()), carried through the
picks and the tag filter, which copy blocks. */
@@ -372,7 +388,7 @@ 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, picks: Picks): Slide[] {
- const { skipped, seconds, hidden, lists, titles } = picks
+ const { skipped, seconds, hidden, lists, titles, pictures } = picks
const slides: Slide[] = []
sections.forEach((section, s) => {
if (skipped.has(s)) return
@@ -385,7 +401,11 @@ function buildSlides(sections: Section[], schedules: Map
})
// 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 })
+ if (seconds.section && own) {
+ // Pictures beside the text, when picked and there are both.
+ const side = text.some(isPicture) && text.some((block) => !isPicture(block)) ? pictures.get(s) : undefined
+ slides.push({ id: `t${s}`, kind: 'section', seconds: seconds.section, label, blocks: text, pictures: side })
+ }
const title = section.headed && !own ? label : null
section.blocks.forEach((block, b) => {
const at = `${s}.${b}`
@@ -568,6 +588,7 @@ export default function EventPresent() {
if (next.theme) out.set('theme', next.theme)
if (next.lists.size) out.set('lists', [...next.lists].join(','))
if (next.titles.size) out.set('titles', [...next.titles].join(','))
+ if (next.pictures.size) out.set('pictures', [...next.pictures].map(([at, side]) => `${at}:${side}`).join(','))
out.set('play', '1')
setParams(out)
}}
@@ -603,8 +624,9 @@ function Setup({
const [theme, setTheme] = useState(settings.theme)
const [lists, setLists] = useState(settings.lists)
const [titles, setTitles] = useState(settings.titles)
+ const [pictures, setPictures] = useState(settings.pictures)
const [dragging, setDragging] = useState(null)
- const slides = ordered(buildSlides(sections, schedules, { skipped, hidden, seconds, only, lists, titles }), order)
+ const slides = ordered(buildSlides(sections, schedules, { skipped, hidden, seconds, only, lists, titles, pictures }), order)
const count = slides.length
// Moves a slide in the list, which then names every slide shown.
const move = (from: number, to: number) => {
@@ -750,6 +772,29 @@ function Setup({
{section.title}
{kinds.join(', ')}
+ {/* Pictures and other text: where the pictures go. */}
+ {section.blocks.some(isPicture) &&
+ section.blocks.some((block, b) => !isPicture(block) && !ownSlides(block, lists, s, b)) && (
+
+ Pictures
+ {
+ const next = new Map(pictures)
+ const side = SIDES.find((one) => one === e.target.value)
+ if (side) next.set(s, side)
+ else next.delete(s)
+ setPictures(next)
+ }}
+ className="border border-muted/25 bg-surface px-2 py-1 text-sm"
+ >
+ Default: in the text, as on the page
+ Left of the text
+ Right of the text
+
+
+ )}
{section.blocks.map((block, b) => {
// A list: its own slides if picked, then its items.
if (block.type === 'list' && block.items?.length) {
@@ -1001,7 +1046,7 @@ function Setup({
onPlay({ skipped, hidden, seconds, screen, only, order, theme, lists, titles })}
+ onClick={() => onPlay({ skipped, hidden, seconds, screen, only, order, theme, lists, titles, pictures })}
className="btn inline-flex items-center gap-2 px-6 py-3 disabled:opacity-50"
style={{ background: accent, color: readableOn(accent) }}
>
@@ -1387,7 +1432,8 @@ function Scroll({ center = false, className = '', children }: {
/* A slide's part shrunk to fit the room it has, never scrolled:
zoomed down until its content is no taller than its box (a few
- passes, since text narrower in zoom wraps less). */
+ passes, since text narrower in zoom wraps less). Again whenever
+ its size changes, eg. a picture loading. */
function Fit({ className = '', children }: { className?: string; children: ReactNode }) {
const box = useRef(null)
const inner = useRef(null)
@@ -1395,14 +1441,20 @@ function Fit({ className = '', children }: { className?: string; children: React
const outer = box.current
const content = inner.current
if (!outer || !content) return
- let zoom = 1
- content.style.zoom = '1'
- for (let pass = 0; pass < 4; pass++) {
- const tall = content.getBoundingClientRect().height
- if (tall <= outer.clientHeight + 1) break
- zoom *= outer.clientHeight / tall
- content.style.zoom = String(zoom)
+ const fit = () => {
+ let zoom = 1
+ content.style.zoom = '1'
+ for (let pass = 0; pass < 4; pass++) {
+ const tall = content.getBoundingClientRect().height
+ if (tall <= outer.clientHeight + 1) break
+ zoom *= outer.clientHeight / tall
+ content.style.zoom = String(zoom)
+ }
}
+ fit()
+ const watch = new ResizeObserver(fit)
+ watch.observe(content)
+ return () => watch.disconnect()
}, [])
return (
@@ -1551,6 +1603,36 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
)
}
+ // Pictures in a column beside the text, shrunk to fit the slide.
+ if (slide.pictures) {
+ const pics = (
+
+
+
+ )
+ const rest = (
+
+ !isPicture(block))} accent={accent} />
+
+ )
+ const left = slide.pictures === 'left'
+ return (
+
+
{slide.label}
+
+
+
+ {left ? pics : rest}
+ {left ? rest : pics}
+
+
+
+
+ )
+ }
return (
{slide.label}
From f46deac3cc889775c8215aa38ba6bd1079a775d8 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 06:40:40 -0600
Subject: [PATCH 26/33] Image block: a dark theme picture; presented pictures
centered
- media_dark (102): shown in place of the image while the site is
dark, the block's alt text and caption shared
- Present: pictures beside text centered on the slide's height, and a
section of only pictures centered both ways
Co-Authored-By: Claude Opus 5.5
---
server/src/admin-schema/columns.js | 2 ++
server/src/migrations/102_image_dark.sql | 13 +++++++++++++
server/src/shape.js | 3 ++-
src/components/ContentBlocks.tsx | 5 ++++-
src/lib/adminSchema/shared.ts | 10 ++++++++++
src/lib/useContent.ts | 2 ++
src/pages/EventPresent.tsx | 14 ++++++++------
7 files changed, 41 insertions(+), 8 deletions(-)
create mode 100644 server/src/migrations/102_image_dark.sql
diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js
index bb911c8..d7d1672 100644
--- a/server/src/admin-schema/columns.js
+++ b/server/src/admin-schema/columns.js
@@ -164,6 +164,8 @@ export const blocksChild = (ownerKind) => ({
),
text("text"),
text("media"),
+ // Image blocks (102): shown in place of media in the dark theme.
+ text("media_dark"),
url("href"),
text("alt"),
text("cite"),
diff --git a/server/src/migrations/102_image_dark.sql b/server/src/migrations/102_image_dark.sql
new file mode 100644
index 0000000..a4f457f
--- /dev/null
+++ b/server/src/migrations/102_image_dark.sql
@@ -0,0 +1,13 @@
+-- ═══════════════════════════════════════════════════════════════
+-- 102 AN IMAGE BLOCK'S DARK THEME PICTURE
+--
+-- media_dark shown in place of media while the site is in its
+-- dark theme (the visitor's setting, or a presentation
+-- held dark), eg. a chart or a logo drawn light on
+-- dark. Null shows media in both themes.
+--
+-- Image blocks only; other types ignore it. Its alt text and caption
+-- are the block's, so it should show the same thing.
+-- ═══════════════════════════════════════════════════════════════
+
+ALTER TABLE content_blocks ADD COLUMN media_dark TEXT;
diff --git a/server/src/shape.js b/server/src/shape.js
index adb5e66..1e78ef2 100644
--- a/server/src/shape.js
+++ b/server/src/shape.js
@@ -86,7 +86,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
const blockRows = db
.prepare(
- `SELECT id, owner_id, type, text, media, href, alt, cite, captions, team_id, venue_id,
+ `SELECT id, owner_id, type, text, media, media_dark, href, alt, cite, captions, team_id, venue_id,
word_motion, word_direction, word_seconds, list_style, image_size, org_kind,
present_show, present_text, present_map_split, present_map_no_list,
present_map_no_details, present_places, present_place_keys
@@ -105,6 +105,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
type: row.type,
text: row.text,
media: row.media,
+ media_dark: row.media_dark,
href: row.href,
alt: row.alt,
cite: row.cite,
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index 6764ba7..c99eb3a 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -73,6 +73,7 @@ import { useReadingMode } from '../lib/readingMode.ts'
import { WordMotion, Words } from './RotatingWords.tsx'
import OrgListCards, { OrgLogoRow } from '../pages/sections/OrgList-Card.tsx'
import { usePresenting } from '../lib/presenting.ts'
+import { useDarkTheme } from '../lib/darkTheme.ts'
const BODY = 'var(--color-muted)'
@@ -396,6 +397,8 @@ function Block({
// On a screen: links are their text, people and organizations
// just pictures and names (095).
const presenting = usePresenting()
+ // An image block's dark theme picture (102).
+ const dark = useDarkTheme()
switch (block.type) {
// A blog post's tab marker (BlogPost.tsx splits the post at
@@ -560,7 +563,7 @@ function Block({
)
case 'image': {
- const src = mediaUrl(block.media)
+ const src = mediaUrl((dark && block.media_dark) || block.media)
if (!src) return null
// The reader leaves out a picture with no alt, and its link with it.
if (reading && block.href && !block.alt) {
diff --git a/src/lib/adminSchema/shared.ts b/src/lib/adminSchema/shared.ts
index 5f63bcd..24c2fae 100644
--- a/src/lib/adminSchema/shared.ts
+++ b/src/lib/adminSchema/shared.ts
@@ -659,6 +659,16 @@ export const blocksChild = {
when: { path: "type", value: "video" },
help: "A WebVTT (.vtt) file, for an uploaded video; YouTube, Vimeo and Facebook show their own. Default: none.",
},
+ {
+ path: "media_dark",
+ label: "Dark theme image",
+ widget: "image",
+ crop: "free",
+ resolve: mediaUrl,
+ full: true,
+ when: { path: "type", value: "image" },
+ help: "Shown in place of the image while the site is dark, eg. a chart drawn light on dark. Same alt text and caption. Default: the image above in both themes.",
+ },
{
path: "image_size",
label: "Size",
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index 3daaef8..663b439 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -57,6 +57,8 @@ export type ContentBlock = {
cite?: string | null
/** A list block's style (092): null bold text, 'plain' the old look. */
list_style?: 'plain' | null
+ /** An image block's picture for the dark theme (102). */
+ media_dark?: string | null
/** An image block's size (101): null the column's width. */
image_size?: 'small' | 'medium' | 'large' | null
/** An organizations block's kind, listed when none are picked (093). */
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index 6fb705b..20ceb56 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -1434,7 +1434,7 @@ function Scroll({ center = false, className = '', children }: {
zoomed down until its content is no taller than its box (a few
passes, since text narrower in zoom wraps less). Again whenever
its size changes, eg. a picture loading. */
-function Fit({ className = '', children }: { className?: string; children: ReactNode }) {
+function Fit({ center = false, className = '', children }: { center?: boolean; className?: string; children: ReactNode }) {
const box = useRef(null)
const inner = useRef(null)
useLayoutEffect(() => {
@@ -1457,8 +1457,10 @@ function Fit({ className = '', children }: { className?: string; children: React
return () => watch.disconnect()
}, [])
return (
-
-
{children}
+
)
}
@@ -1587,9 +1589,9 @@ 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: the title and their photos in the middle of the
+ // Only people or pictures: the title and them in the middle of the
// slide, both ways.
- if (slide.blocks!.every((block) => block.type === 'people' || FILLER.has(block.type))) {
+ if (slide.blocks!.every((block) => block.type === 'people' || isPicture(block) || FILLER.has(block.type))) {
return (
@@ -1620,7 +1622,7 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
{slide.label}
-
+
Date: Thu, 12 Nov 2026 06:42:40 -0600
Subject: [PATCH 27/33] Present: Copy link for the setup's current choices
- addressFor builds the playing address from the choices, for Play
and the new Copy link at the bottom of the setup
Co-Authored-By: Claude Opus 5.5
---
src/pages/EventPresent.tsx | 69 ++++++++++++++++++++++++++++----------
1 file changed, 51 insertions(+), 18 deletions(-)
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index 20ceb56..51c194c 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -84,7 +84,7 @@
screen (the browser's), S goes back to the setup.
═══════════════════════════════════════════════════════════════ */
-import { ArrowDown, ArrowUp, ArrowsOut, CaretLeft, CaretRight, DotsSixVertical, Gear, Pause, Play } from '@phosphor-icons/react'
+import { ArrowDown, ArrowUp, ArrowsOut, CaretLeft, CaretRight, Check, DotsSixVertical, Gear, LinkSimple, Pause, Play } from '@phosphor-icons/react'
import { createContext, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode } from 'react'
import { useParams, useSearchParams } from 'react-router-dom'
@@ -577,25 +577,31 @@ export default function EventPresent() {
onPlay={(next) => {
// Full screen needs the click itself, so it's asked for here.
document.documentElement.requestFullscreen?.().catch(() => {})
- const out = new URLSearchParams()
- if (next.skipped.size) out.set('skip', [...next.skipped].sort((a, b) => a - b).join(','))
- if (next.hidden.size) out.set('hide', [...next.hidden].join(','))
- for (const kind of KINDS) out.set(kind.key, String(next.seconds[kind.key]))
- out.set('screen', String(next.screen))
- // Not 'tag': that's the tag slides' seconds.
- 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(','))
- if (next.titles.size) out.set('titles', [...next.titles].join(','))
- if (next.pictures.size) out.set('pictures', [...next.pictures].map(([at, side]) => `${at}:${side}`).join(','))
- out.set('play', '1')
- setParams(out)
+ setParams(addressFor(next))
}}
/>
)
}
+/* The setup's choices as the address's query, playing (`play=1`):
+ what Play goes to and Copy link copies. readSettings reads it. */
+function addressFor(next: Settings): URLSearchParams {
+ const out = new URLSearchParams()
+ if (next.skipped.size) out.set('skip', [...next.skipped].sort((a, b) => a - b).join(','))
+ if (next.hidden.size) out.set('hide', [...next.hidden].join(','))
+ for (const kind of KINDS) out.set(kind.key, String(next.seconds[kind.key]))
+ out.set('screen', String(next.screen))
+ // Not 'tag': that's the tag slides' seconds.
+ 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(','))
+ if (next.titles.size) out.set('titles', [...next.titles].join(','))
+ if (next.pictures.size) out.set('pictures', [...next.pictures].map(([at, side]) => `${at}:${side}`).join(','))
+ out.set('play', '1')
+ return out
+}
+
/* ── Setup ──────────────────────────────────────────────────── */
function Setup({
@@ -626,6 +632,17 @@ function Setup({
const [titles, setTitles] = useState(settings.titles)
const [pictures, setPictures] = useState(settings.pictures)
const [dragging, setDragging] = useState(null)
+ const [copied, setCopied] = useState<'yes' | 'failed' | null>(null)
+ const picked: Settings = { skipped, hidden, seconds, screen, only, order, theme, lists, titles, pictures }
+ // The address that starts a screen with these choices, playing.
+ const copyLink = () => {
+ const link = `${window.location.origin}${window.location.pathname}?${addressFor(picked)}`
+ navigator.clipboard
+ .writeText(link)
+ .then(() => setCopied('yes'))
+ .catch(() => setCopied('failed'))
+ window.setTimeout(() => setCopied(null), 2500)
+ }
const slides = ordered(buildSlides(sections, schedules, { skipped, hidden, seconds, only, lists, titles, pictures }), order)
const count = slides.length
// Moves a slide in the list, which then names every slide shown.
@@ -655,8 +672,8 @@ function Setup({
{title}
- Pick what to show and for how long, then Play. It loops until you stop it. Bookmark the address after
- pressing Play to start a screen the same way next time.
+ Pick what to show and for how long, then Play. It loops until you stop it. Copy link (at the bottom) gives
+ an address that starts a screen with these choices, playing, eg. to bookmark on a signage device.
@@ -1046,7 +1063,7 @@ function Setup({
onPlay({ skipped, hidden, seconds, screen, only, order, theme, lists, titles, pictures })}
+ onClick={() => onPlay(picked)}
className="btn inline-flex items-center gap-2 px-6 py-3 disabled:opacity-50"
style={{ background: accent, color: readableOn(accent) }}
>
@@ -1056,6 +1073,22 @@ function Setup({
{count === 0 ? 'Nothing picked to show.' : `${count} slide${count === 1 ? '' : 's'} in the loop`}
+
+ {copied === 'yes' ? (
+
+ ) : (
+
+ )}
+ {copied === 'yes' ? 'Copied' : 'Copy link'}
+
+
+ {copied === 'failed' ? "Couldn't copy: press Play, then copy the address bar." : ''}
+
Back to the event
From b2ef69215597d7e0c580b957600d0cb7b57c5447 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 06:48:53 -0600
Subject: [PATCH 28/33] Present: featured events lit on the list slide;
schedule row fixes
- An events list slide tints, bars and stars its featured events
- A schedule block's sub-items sit a little in, not under the title
- An entry with no place, person or tags no longer shows a stray 0
Co-Authored-By: Claude Opus 5.5
---
src/pages/EventPresent.tsx | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index 51c194c..8fa7d7b 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -1539,7 +1539,8 @@ function SlideMap({ venue, accent, active, vh, only }: {
)
}
-/* An overview's rows: each entry, a block's sub-items under it.
+/* An overview's rows: each entry, a block's sub-items under it, a
+ little in from it with their own times in a column.
`start` is the first row's place in the slide's entrance. */
function OverviewEntries({ entries, accent, start = 1 }: { entries: ContentBlockItem[]; accent: string; start?: number }) {
return (
@@ -1549,7 +1550,7 @@ function OverviewEntries({ entries, accent, start = 1 }: { entries: ContentBlock
{entry.kind === 'block' && entry.items?.length ? (
-
+
{entry.items.map((item, j) => (
@@ -1602,7 +1603,8 @@ function OverviewLine({ entry, accent, sub = false }: { entry: ContentBlockItem;
)}
{entry.text}
- {(entry.location || entry.person || entry.tags?.length) && (
+ {/* Boolean: a bare 0 (no tags) would show as text. */}
+ {Boolean(entry.location || entry.person || entry.tags?.length) && (
{entry.location && {entry.location} }
{entry.person && {entry.person.name} }
@@ -1771,9 +1773,19 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
ONE_COLUMN ? 'columns-2' : ''}`}>
{items.map((item, i) => (
-
+
+ {item.featured && (
+
+
+
+ )}
{item.text || item.event!.title}
{item.person && !off.has('person') && (
From b286cbddbfd46f4a92fb74c9b8722e218001badc Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 06:57:38 -0600
Subject: [PATCH 29/33] 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
---
src/pages/EventPresent.tsx | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index 8fa7d7b..1a30c98 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -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
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
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 (
From 3aef3b1c34caa19635f3efde877d3b62f2315af4 Mon Sep 17 00:00:00 2001
From: Zaldimmar
Date: Thu, 12 Nov 2026 06:59:58 -0600
Subject: [PATCH 30/33] Present: dividers left off the slides
Co-Authored-By: Claude Opus 5.5
---
src/components/ContentBlocks.tsx | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index c99eb3a..ab992ed 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -93,13 +93,14 @@ export default function ContentBlocks({
anchorPrefix?: string
}) {
const presenting = usePresenting()
- // Presented, a block shown only on the page is left out and the
- // rest take their Presentation text (095, 099); on the page, a block
- // shown only in the presentation is.
+ // Presented, a block shown only on the page is left out, so is a
+ // divider (a slide has its own edges), and the rest take their
+ // Presentation text (095, 099); on the page, a block shown only in
+ // the presentation is.
if (blocks) {
blocks = presenting
? blocks
- .filter((block) => !block.present?.hide)
+ .filter((block) => !block.present?.hide && block.type !== 'divider')
.map((block) => (block.present?.text ? { ...block, text: block.present.text } : block))
: blocks.filter((block) => !block.present?.only)
}
From 5eebc20c4efe0a2ae3d8d3042d287047d561b3dd Mon Sep 17 00:00:00 2001
From: Aidan Dona
Date: Fri, 13 Nov 2026 09:51:27 -0600
Subject: [PATCH 31/33] Present: a remote, a phone at /remote/ drives a
presenting screen
The screen shows a code on its setup and with its controls. Anyone with
it can step, pause and jump through the slides, send the screen back to
its setup, or change the setup and play it there. Server-sent events,
held in memory (routes/present.js); X-Accel-Buffering: no, so nginx
needs no block of its own.
Co-Authored-By: Claude Opus 5.5
---
CLAUDE.md | 1 +
server/src/admin-schema/sitePages.js | 4 +-
server/src/index.js | 8 +-
server/src/pageMeta.js | 3 +
server/src/routes/present.js | 151 ++++++++++++++++
src/App.tsx | 10 ++
src/lib/api.ts | 2 +-
src/lib/useScreenRemote.ts | 88 ++++++++++
src/pages/EventPresent.tsx | 110 ++++++++++--
src/pages/PresentRemote.tsx | 250 +++++++++++++++++++++++++++
10 files changed, 604 insertions(+), 23 deletions(-)
create mode 100644 server/src/routes/present.js
create mode 100644 src/lib/useScreenRemote.ts
create mode 100644 src/pages/PresentRemote.tsx
diff --git a/CLAUDE.md b/CLAUDE.md
index eb258a1..4f51c98 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -35,6 +35,7 @@ In dev, Vite proxies `/api` to the target set in `vite.config.ts`, so the API mu
- Analytics: self-hosted Plausible, proxied by nginx at `/pa/`. The API adds its script to every page (`analyticsTag` in `server/src/pageMeta.js`), counting under the hostname of `site.json`'s `url`, so each deployment reports as itself. Nothing in `index.html` or the app. Daily and weekly reports go to Discord when Panel → Site settings → Reports turns them on and `PLAUSIBLE_API_KEY` and `DISCORD_WEBHOOK_URL` are set (`server/src/analyticsReport.js`): `docs/analytics-reports.md`. Short links `/go/` (Data → Links/redirects, `server/src/routes/redirects.js`) count clicks, report each to Plausible as a pageview and add the link's UTM tags: `docs/redirects.md`.
- Page HTML goes through the API, which fills in each page's title, description, preview image and structured data (`server/src/pageMeta.js`), and serves `/sitemap.xml`. It reads `SITE_CONFIG` (site.json) and `SITE_INDEX` (the built index.html), with Panel → Site settings (the `site_settings` table) laid over site.json, and serves `/robots.txt` from the same merge. nginx setup: `docs/seo.md`.
- Video clips (Tools, admins and up): yt-dlp downloads our YouTube/Facebook videos into `CLIPS_DIR`, ffmpeg cuts them; one job at a time, files swept after a day (`server/src/clips.js`). Needs yt-dlp and ffmpeg on the VPS: `docs/video-clips.md`.
+- Present remote: a presenting screen (`/events/:id/present`) shows a code; a phone at `/remote/` steps, pauses, jumps and changes its setup, anyone with the code (`server/src/routes/present.js`, `src/pages/PresentRemote.tsx`). Server-sent events held in memory (one process); the API sends `X-Accel-Buffering: no`, so nginx needs no block of its own.
- Newsletter countdown pictures: `/api/countdown/:id.png` (`server/src/routes/countdown.js`), drawn with sharp when an email is opened; it uses the VPS's fonts, so install Poppins there (eg. into `/usr/local/share/fonts`, then `fc-cache`) or it falls back to a plain sans. The social bar's icons are static files in `public/email/`.
- Word import: Blog posts → Import from Word turns a .docx into an unpublished post (headings, paragraphs, lists, tables, links); nginx needs a block for `/api/admin/import/docx` with an 11m body limit: `docs/importing.md`.
- Speed: nginx must gzip JS/CSS/JSON/SVG and speak HTTP/2; page HTML is `no-cache`; uploads get a `-640.webp` small copy made at upload and at boot: `docs/performance.md`.
diff --git a/server/src/admin-schema/sitePages.js b/server/src/admin-schema/sitePages.js
index def70c6..0117871 100644
--- a/server/src/admin-schema/sitePages.js
+++ b/server/src/admin-schema/sitePages.js
@@ -214,11 +214,11 @@ const sectionsChild = {
export const CORE_PAGES = { home: "/", give: "/give", feedback: "/feedback", request: "/request", qr: "/qr", privacy: "/privacy", terms: "/terms" };
/* Addresses a page can't take: the admin, the API, the uploads, the
- records' own pages and the account pages. */
+ records' own pages, the account pages and the remote. */
const RESERVED = [
"admin", "api", "uploads", "assets", "pa", "go",
"events", "regions", "groups", "partners", "organizations", "teams", "awards", "people", "blog", "directory",
- "sign-in", "account", "sitemap.xml", "robots.txt",
+ "sign-in", "account", "remote", "sitemap.xml", "robots.txt",
];
/* After a save: the address is one a page may have. */
diff --git a/server/src/index.js b/server/src/index.js
index 51c369e..a273f03 100644
--- a/server/src/index.js
+++ b/server/src/index.js
@@ -43,6 +43,7 @@ import imports from "./routes/import.js";
import files from "./routes/files.js";
import countdown from "./routes/countdown.js";
import redirects from "./routes/redirects.js";
+import present from "./routes/present.js";
import { CLIPS_DIR, startClipWorker } from "./clips.js";
import { UPLOADS_DIR, writeMissingThumbs } from "./media.js";
import { logSafe, requireStaff, startSessionSweeper } from "./auth.js";
@@ -137,7 +138,7 @@ app.use(
so each is capped well above its longest real body (a 5000
character message) and far below nginx's limit. */
const smallBody = bodyLimit({ maxSize: 64 * 1024, onError: (c) => c.json({ error: "That's too long." }, 413) });
-for (const path of ["/api/csp-report", "/api/feedback", "/api/auth/login", "/api/account/accept", "/api/account/claim", "/api/account/profile"]) app.use(path, smallBody);
+for (const path of ["/api/csp-report", "/api/feedback", "/api/auth/login", "/api/account/accept", "/api/account/claim", "/api/account/profile", "/api/present/*"]) app.use(path, smallBody);
/* What the policy above would have blocked. Browsers post these on
their own; a short line per report is plenty to go on. */
@@ -202,6 +203,11 @@ app.use("/api/countdown/*", rateLimit({ windowMs: 60_000, max: 600 }));
app.route("/api", countdown);
// Tighter limit on the write path than anything else gets.
+// A presenting screen and its remotes, by the screen's code
+// (routes/present.js): a cap far above tapping, far below guessing.
+app.use("/api/present/*", rateLimit({ windowMs: 60_000, max: 300 }));
+app.route("/api", present);
+
app.use("/api/feedback", rateLimit({ windowMs: 60_000, max: 5 }));
app.route("/api/feedback", feedback);
// Requests carry files: fewer again.
diff --git a/server/src/pageMeta.js b/server/src/pageMeta.js
index 9540502..06daa23 100644
--- a/server/src/pageMeta.js
+++ b/server/src/pageMeta.js
@@ -413,6 +413,9 @@ export function metaFor(db, rawPath, user = null) {
// in particular, so never indexed or in the sitemap.
if (ACCOUNT_PAGES[pathname]) return { ...meta, title: titled(site, ACCOUNT_PAGES[pathname]), noindex: true };
+ // A presenting screen's remote (src/pages/PresentRemote.tsx).
+ if (/^\/remote(\/|$)/.test(pathname)) return { ...meta, title: titled(site, "Remote"), noindex: true };
+
// A page of the site (site_pages): hidden is Not found below
// viewer; disabled stays out of search.
const page = pageAt(db, pathname);
diff --git a/server/src/routes/present.js b/server/src/routes/present.js
new file mode 100644
index 0000000..a99af38
--- /dev/null
+++ b/server/src/routes/present.js
@@ -0,0 +1,151 @@
+/* ═══════════════════════════════════════════════════════════════
+ PRESENT REMOTE: a phone drives a presenting screen by its code
+
+ A screen (src/pages/EventPresent.tsx) opens /present/screen, a
+ stream that first says its code and key, then carries commands.
+ It posts what it shows (state) with the key. A remote
+ (src/pages/PresentRemote.tsx) opens /present/:code, a stream of
+ that state, and posts commands. Anyone with the code can drive
+ the screen: the code is the only lock, so it's long enough not to
+ guess at the rate limit set where this is mounted.
+
+ In memory only: one process, and a restart only makes each screen
+ reconnect (keeping its code when no one took it) and post its
+ state again. A screen gone for SWEEP_AFTER is forgotten.
+ ═══════════════════════════════════════════════════════════════ */
+
+import { randomBytes, randomInt } from "node:crypto";
+import { Hono } from "hono";
+import { streamSSE } from "hono/streaming";
+
+const present = new Hono();
+
+// No 0/O, 1/I/L: read off a screen across a room.
+const LETTERS = "ABCDEFGHJKMNPQRSTUVWXYZ23456789";
+const CODE = /^[A-Z0-9]{6}$/;
+const PING_EVERY = 25_000; // under nginx's 60 second read timeout
+const SWEEP_AFTER = 10 * 60_000;
+const COMMANDS = ["next", "prev", "pause", "resume", "go", "setup", "start"];
+
+// A screen's state before it first says.
+const NOTHING_YET = { event: "", title: "", query: "", playing: false, paused: false, index: 0, slides: [] };
+
+// code → { key, state, screen (its stream, or null), gone (ms), remotes (streams) }
+const screens = new Map();
+
+setInterval(() => {
+ const now = Date.now();
+ for (const [code, s] of screens) {
+ if (!s.screen && s.remotes.size === 0 && now - s.gone > SWEEP_AFTER) screens.delete(code);
+ }
+}, 60_000).unref();
+
+function newCode() {
+ for (;;) {
+ const code = Array.from({ length: 6 }, () => LETTERS[randomInt(LETTERS.length)]).join("");
+ // SCREEN would be the screen's own stream's address.
+ if (!screens.has(code) && code !== "SCREEN") return code;
+ }
+}
+
+const send = (stream, event, data) => stream.writeSSE({ event, data: JSON.stringify(data) }).catch(() => {});
+
+function tellRemotes(s) {
+ for (const remote of s.remotes) send(remote, "state", { connected: !!s.screen, ...s.state });
+}
+
+// Holds a stream open, pinging, until the other end goes.
+function hold(stream, onGone) {
+ return new Promise((resolve) => {
+ const ping = setInterval(() => stream.write(": ping\n\n").catch(() => {}), PING_EVERY);
+ stream.onAbort(() => {
+ clearInterval(ping);
+ onGone();
+ resolve();
+ });
+ });
+}
+
+/* A screen's stream. It asks for the code it had (code and key) and
+ gets it back unless that's wrong or another screen holds it now. */
+present.get("/present/screen", (c) => {
+ let code = c.req.query("code");
+ const key = c.req.query("key");
+ let s = screens.get(code);
+ if (!s || s.key !== key || s.screen) {
+ code = newCode();
+ s = { key: randomBytes(16).toString("hex"), state: NOTHING_YET, screen: null, gone: 0, remotes: new Set() };
+ screens.set(code, s);
+ }
+ // Tells nginx to pass each event on as it's written.
+ c.header("X-Accel-Buffering", "no");
+ return streamSSE(c, async (stream) => {
+ s.screen = stream;
+ await send(stream, "hello", { code, key: s.key });
+ tellRemotes(s);
+ await hold(stream, () => {
+ if (s.screen !== stream) return;
+ s.screen = null;
+ s.gone = Date.now();
+ tellRemotes(s);
+ });
+ });
+});
+
+/* What the screen shows, for its remotes: shown as text there, so
+ only capped here. */
+present.post("/present/:code/state", async (c) => {
+ const s = screens.get(c.req.param("code"));
+ const body = await c.req.json().catch(() => null);
+ if (!s || !body || body.key !== s.key) return c.json({ error: "Not found" }, 404);
+ const text = (v, max) => (typeof v === "string" ? v.slice(0, max) : "");
+ const count = (v) => (Number.isInteger(v) && v >= 0 ? v : 0);
+ s.state = {
+ event: text(body.event, 200),
+ title: text(body.title, 300),
+ query: text(body.query, 4000),
+ playing: body.playing === true,
+ paused: body.paused === true,
+ index: count(body.index),
+ slides: Array.isArray(body.slides) ? body.slides.slice(0, 500).map((name) => text(name, 150)) : [],
+ };
+ tellRemotes(s);
+ return c.body(null, 204);
+});
+
+// A remote's stream: the screen's state now and each time it changes.
+present.get("/present/:code", (c) => {
+ const s = screens.get(c.req.param("code").toUpperCase());
+ if (!s) return c.json({ error: "No screen has that code." }, 404);
+ c.header("X-Accel-Buffering", "no");
+ return streamSSE(c, async (stream) => {
+ s.remotes.add(stream);
+ await send(stream, "state", { connected: !!s.screen, ...s.state });
+ await hold(stream, () => s.remotes.delete(stream));
+ });
+});
+
+/* A command for the screen: next, prev, pause, resume, go (to
+ `index`), setup (back to its setup) or start (playing `query`, the
+ setup's choices as EventPresent's address reads them). */
+present.post("/present/:code/command", async (c) => {
+ const code = c.req.param("code").toUpperCase();
+ const s = CODE.test(code) ? screens.get(code) : null;
+ if (!s) return c.json({ error: "No screen has that code." }, 404);
+ if (!s.screen) return c.json({ error: "The screen isn't connected right now." }, 409);
+ const body = await c.req.json().catch(() => null);
+ if (!body || !COMMANDS.includes(body.do)) return c.json({ error: "Unknown command." }, 400);
+ const command = { do: body.do };
+ if (body.do === "go") {
+ if (!Number.isInteger(body.index) || body.index < 0) return c.json({ error: "Which slide?" }, 400);
+ command.index = body.index;
+ }
+ if (body.do === "start") {
+ if (typeof body.query !== "string" || body.query.length > 4000) return c.json({ error: "That setup is too long." }, 400);
+ command.query = body.query;
+ }
+ await send(s.screen, "command", command);
+ return c.body(null, 204);
+});
+
+export default present;
diff --git a/src/App.tsx b/src/App.tsx
index c9c295e..d0f0de7 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -68,6 +68,7 @@ const PersonDetail = lazyPage(() => import("./pages/PersonDetail.tsx"))
const BlogPost = lazyPage(() => import("./pages/BlogPost.tsx"))
const DirectoryPage = lazyPage(() => import("./pages/DirectoryPage.tsx"))
const EventPresent = lazyPage(() => import("./pages/EventPresent.tsx"))
+const PresentRemote = lazyPage(() => import("./pages/PresentRemote.tsx"))
/*Admin Pages*/
const AdminLayout = lazyPage(() => import("./pages/admin/AdminLayout.tsx"))
@@ -119,6 +120,15 @@ export default function App() {
}
/>
+ {/* A phone driving a presenting screen, by its code. */}
+
+
+
+ }
+ />
diff --git a/src/lib/api.ts b/src/lib/api.ts
index 1302bda..6308a61 100644
--- a/src/lib/api.ts
+++ b/src/lib/api.ts
@@ -18,7 +18,7 @@
import { visionColor } from "./color.ts";
-const BASE = import.meta.env?.VITE_API_BASE ?? "/api";
+export const BASE = import.meta.env?.VITE_API_BASE ?? "/api";
const DEFAULT_TTL = 60_000;
/* A draft's preview (server/src/drafts.js): a tab opened from the
diff --git a/src/lib/useScreenRemote.ts b/src/lib/useScreenRemote.ts
new file mode 100644
index 0000000..0e68c82
--- /dev/null
+++ b/src/lib/useScreenRemote.ts
@@ -0,0 +1,88 @@
+/* A presenting screen's link to its remotes (server/src/routes/
+ present.js, src/pages/PresentRemote.tsx): the code to show, the
+ commands as they come, and `report` for what the screen shows.
+ The code and its key are kept in this browser, so a reload or a
+ restart of the server keeps the same code. */
+
+import { useCallback, useEffect, useRef, useState } from 'react'
+
+import { BASE, post } from './api.ts'
+
+export type RemoteCommand = {
+ do: 'next' | 'prev' | 'pause' | 'resume' | 'go' | 'setup' | 'start'
+ index?: number
+ query?: string
+}
+
+export type ScreenState = {
+ event: string
+ title: string
+ // EventPresent's address query: the setup's choices.
+ query: string
+ playing: boolean
+ paused: boolean
+ index: number
+ // Each slide's name, in order.
+ slides: string[]
+}
+
+const STORE = 'present-remote'
+const RETRY = 3000
+
+export function useScreenRemote(onCommand: (command: RemoteCommand) => void) {
+ const [code, setCode] = useState(null)
+ const link = useRef<{ code: string; key: string } | null>(null)
+ const last = useRef(null)
+ const handler = useRef(onCommand)
+ handler.current = onCommand
+
+ const send = (state: ScreenState) => {
+ const l = link.current
+ if (l) post(`/present/${l.code}/state`, { key: l.key, ...state }).catch(() => {})
+ }
+
+ useEffect(() => {
+ let source: EventSource | null = null
+ let retry = 0
+ const open = () => {
+ let saved: Record = {}
+ try {
+ saved = JSON.parse(localStorage.getItem(STORE) ?? '{}')
+ } catch {
+ // Nothing kept: the server gives a new code.
+ }
+ source = new EventSource(`${BASE}/present/screen?${new URLSearchParams(saved)}`)
+ source.addEventListener('hello', (e) => {
+ link.current = JSON.parse((e as MessageEvent).data)
+ setCode(link.current!.code)
+ try {
+ localStorage.setItem(STORE, JSON.stringify(link.current))
+ } catch {
+ // Kept for this visit only.
+ }
+ if (last.current) send(last.current)
+ })
+ source.addEventListener('command', (e) => handler.current(JSON.parse((e as MessageEvent).data)))
+ // Reopened by hand, so it asks for its code again.
+ source.onerror = () => {
+ source?.close()
+ link.current = null
+ retry = window.setTimeout(open, RETRY)
+ }
+ }
+ open()
+ return () => {
+ window.clearTimeout(retry)
+ source?.close()
+ }
+ }, [])
+
+ const report = useCallback((state: ScreenState) => {
+ // Unchanged, eg. the page drawn again for something else.
+ if (JSON.stringify(state) === JSON.stringify(last.current)) return
+ last.current = state
+ send(state)
+ }, [])
+
+ return { code, report }
+}
diff --git a/src/pages/EventPresent.tsx b/src/pages/EventPresent.tsx
index 1a30c98..57c53eb 100644
--- a/src/pages/EventPresent.tsx
+++ b/src/pages/EventPresent.tsx
@@ -82,9 +82,14 @@
Keys while playing: arrows step, Space pauses, Escape leaves full
screen (the browser's), S goes back to the setup.
+
+ Remote: the screen has a code (useScreenRemote), shown on the setup
+ and with the controls. A phone at /remote/ (PresentRemote.tsx)
+ steps, pauses and jumps through the slides, and changes the setup
+ with this page's own Setup, which plays on the screen.
═══════════════════════════════════════════════════════════════ */
-import { ArrowDown, ArrowUp, ArrowsOut, CaretLeft, CaretRight, Check, DotsSixVertical, Gear, LinkSimple, Pause, Play } from '@phosphor-icons/react'
+import { ArrowDown, ArrowUp, ArrowsOut, CaretLeft, CaretRight, Check, DotsSixVertical, Gear, LinkSimple, Pause, Play, DeviceMobile } from '@phosphor-icons/react'
import { createContext, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode } from 'react'
import { useParams, useSearchParams } from 'react-router-dom'
@@ -120,6 +125,7 @@ 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 { useScreenRemote, type RemoteCommand, type ScreenState } from '../lib/useScreenRemote.ts'
import './EventPresent.css'
/* Each kind of slide, its address key and seconds when unset. */
@@ -244,13 +250,13 @@ type Slide = {
/* A part of the page: a heading (`headed`, else the event's title)
and the blocks under it. */
-type Section = { title: string; headed: boolean; blocks: ContentBlock[] }
+export type Section = { title: string; headed: boolean; blocks: ContentBlock[] }
/* A schedule block, numbered among the page's, with its days. */
-type Schedule = { n: number; days: Day[]; tags: ScheduleTag[] }
+export type Schedule = { n: number; days: Day[]; tags: ScheduleTag[] }
/* Blocks left out of the presentation (095) are dropped; a left out
heading still starts its section, under the event's title. */
-function sectionsOf(blocks: ContentBlock[], title: string): Section[] {
+export function sectionsOf(blocks: ContentBlock[], title: string): Section[] {
const sections: Section[] = [{ title, headed: false, blocks: [] }]
for (const block of blocks) {
if (STARTS_SECTION.has(block.type)) {
@@ -270,7 +276,7 @@ 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) {
+export function readSettings(params: URLSearchParams) {
const seconds = Object.fromEntries(
KINDS.map((kind) => {
const value = Number(params.get(kind.key) ?? kind.seconds)
@@ -296,7 +302,7 @@ function readSettings(params: URLSearchParams) {
theme: THEMES.find((theme) => theme === params.get('theme')) ?? null,
}
}
-type Settings = ReturnType
+export type Settings = ReturnType
type Picks = Pick
/* An entry or sub-item with its key (key()), carried through the
@@ -502,15 +508,29 @@ export default function EventPresent() {
const { data: event, loading, error, notFound, reload } = useEvent(id)
const sections = useMemo(() => (event ? sectionsOf(event.blocks ?? [], event.title) : []), [event])
- const schedules = useMemo(() => {
- const out = new Map()
- for (const block of event?.blocks ?? []) {
- if (block.type !== 'schedule') continue
- const days = groupByDay(block.items ?? [])
- if (days.length) out.set(block, { n: out.size, days, tags: block.tags ?? [] })
- }
- return out
- }, [event])
+ const schedules = useMemo(() => schedulesOf(event?.blocks ?? []), [event])
+ const playing = params.get('play') === '1'
+
+ // A remote's commands: the setup's here, the slides' the Player's.
+ const [command, setCommand] = useState(null)
+ const remote = useScreenRemote((c) => {
+ if (c.do === 'setup') {
+ setParams((was) => {
+ const next = new URLSearchParams(was)
+ next.delete('play')
+ return next
+ })
+ } else if (c.do === 'start') {
+ const next = new URLSearchParams(c.query)
+ next.set('play', '1')
+ setParams(next)
+ } else setCommand({ ...c })
+ })
+ const report = (state: Pick) =>
+ event && remote.report({ event: event.id, title: event.title, query: params.toString(), playing, ...state })
+ useEffect(() => {
+ if (!playing) report({ paused: false, index: 0, slides: [] })
+ })
useEffect(() => {
if (event) document.title = documentTitle(`${event.title}: present`)
@@ -559,7 +579,7 @@ export default function EventPresent() {
}
const settings = readSettings(params)
- if (params.get('play') === '1') {
+ if (playing) {
return (