From de6d70a0d0e8927375b9d45cb8a10a3d8b5a0232 Mon Sep 17 00:00:00 2001 From: Zaldimmar Date: Tue, 6 Oct 2026 04:14:48 -0500 Subject: [PATCH 1/8] Event cards: clip sideways only, so the past events button isn't cut off on hover Co-Authored-By: Claude Opus 5.5 --- src/pages/sections/EventList-Cards.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/sections/EventList-Cards.tsx b/src/pages/sections/EventList-Cards.tsx index 5d866c9..2091695 100644 --- a/src/pages/sections/EventList-Cards.tsx +++ b/src/pages/sections/EventList-Cards.tsx @@ -592,7 +592,7 @@ export default function EventListCards({ } return ( -
+
{mixed && ( Date: Tue, 6 Oct 2026 04:28:45 -0500 Subject: [PATCH 2/8] Side nav: size the pill as the pill it is, not an ellipse rounded-full draws straight sides with round ends, but its height was worked out for an ellipse, so a narrow window made it about three times the list's height, running down over the content. Co-Authored-By: Claude Opus 5.5 --- src/components/PageShell.tsx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/components/PageShell.tsx b/src/components/PageShell.tsx index 096f007..65f4676 100644 --- a/src/components/PageShell.tsx +++ b/src/components/PageShell.tsx @@ -107,16 +107,17 @@ export function Section({ section }: { section: ShellSection }) { const circleSize = (box: { width: number; height: number }) => Math.min(Math.max(box.width * 1.5, box.height * 1.1), 22 * 16); -/* The height an ellipse `width` wide needs to take in a box reaching +/* The height a pill `width` wide (rounded-full: straight sides, round + ends of radius r = width / 2) needs to take in a box reaching `across` and `down` from its center (or a corner it's centered on): - (across / a)^2 + (down / b)^2 <= 1. Equal to the width when a circle - that wide would do; taller when the list is too tall for one. A - box as wide as the ellipse can't be taken in, so it stops at 95% - (about three times the box's height). */ + the corner must sit inside an end's circle, so the straight part + reaches down - sqrt(r^2 - across^2). Equal to the width when a + circle that wide would do; taller when the list is too tall for + one. A box as wide as the pill can't be taken in, so it stops at 95%. */ const coverHeight = (width: number, across: number, down: number) => { - const a = width / 2; - const ratio = Math.min(across / a, 0.95); - return Math.max(width, (2 * down) / Math.sqrt(1 - ratio * ratio)); + const r = width / 2; + const ratio = Math.min(across / r, 0.95); + return Math.max(width, 2 * (down - r * Math.sqrt(1 - ratio * ratio) + r)); }; /* How far the list sits in from the column's top and left: the @@ -184,7 +185,7 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P // The shape at rest: a circle centered on the list (a little left, // never left of the heading's center), CIRCLE_EDGE clear of the - // section's edge, made an ellipse as tall as it takes when the list + // section's edge, made a pill as tall as it takes when the list // is too tall for the circle (10 sections of two-line titles). // The shape at a given width: its center as near the list's as the // section's edge allows (it may run off the screen's left edge), and @@ -244,7 +245,7 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P // far corner. Never wider than the column (it'd show a cut edge at // the content): held narrower by the window, it stays centered on // the header's edge (so below it, it only ever curves inward) and - // becomes an ellipse, as tall as it takes to take the list in. + // becomes a pill, as tall as it takes to take the list in. const circleBox = (() => { if (!listBox || !rest) return null; if (stuck) { From 96b96c3e6c94c2f986a35652786cde439209aaed Mon Sep 17 00:00:00 2001 From: Zaldimmar Date: Tue, 6 Oct 2026 04:31:19 -0500 Subject: [PATCH 3/8] Group map: state hover, state subheadings, entry cards, scroll on click only Hovering a tile outlines that state in ink while its region stays lit. The list groups each region's groups under their state's subheading, each entry a raised card, and leaves out the region's list of states (its map note stays). The list no longer follows hover; clicking a state jumps to its subheading (or its region when it has no groups), and clicking a legend region to that region. Co-Authored-By: Claude Opus 5.5 --- src/pages/sections/OrgList-Map.tsx | 208 +++++++++++++++-------------- 1 file changed, 111 insertions(+), 97 deletions(-) diff --git a/src/pages/sections/OrgList-Map.tsx b/src/pages/sections/OrgList-Map.tsx index 0f5bdeb..02badc8 100644 --- a/src/pages/sections/OrgList-Map.tsx +++ b/src/pages/sections/OrgList-Map.tsx @@ -1,5 +1,5 @@ import { CaretRight, MagnifyingGlass, X } from '@phosphor-icons/react'; -import { Fragment, useEffect, useMemo, useRef, useState } from "react"; +import { Fragment, useMemo, useRef, useState } from "react"; import { useCommunity } from "../../lib/useCommunity.ts"; import { useOrganization } from "../../lib/useContent.ts"; import { Link } from "react-router-dom"; @@ -157,6 +157,7 @@ function Tile({ count = 0, selected, hovered, + hoveredArea, setSelected, setHovered, onPick, @@ -168,19 +169,23 @@ function Tile({ const ids = slices.map(s => s.regionId); const active = ids.includes(selected) || ids.includes(hovered); const dimmed = selected && !ids.includes(selected); + // The state under the pointer, outlined in ink over its region's + // color, so both read at once. + const here = hoveredArea === code; const clipId = `clip-${code}`; // Solid, never see-through: a tile with no groups, or one dimmed // while another region is picked, is its color mixed toward the // page's rather than faded, so the backdrop doesn't show through. - const strength = dimmed ? (count ? 35 : 15) : count ? 100 : active ? 50 : 28; + const strength = dimmed ? (count ? 35 : 15) : count ? 100 : here ? 70 : active ? 50 : 28; const tileFill = (color: string) => `color-mix(in srgb, ${color} ${strength}%, var(--color-surface))`; // Clicking a shared tile cycles through its regions and then // clears, so every slice is reachable without a second control. const cycle = () => { - onPick?.(code); const at = ids.indexOf(selected); - setSelected(at === ids.length - 1 ? null : ids[at + 1]); + const next = at === ids.length - 1 ? null : ids[at + 1]; + onPick?.(code, next); + setSelected(next); }; const name = `${AREA_NAMES[code] || code}: ${slices.map(s => s.name).join(" / ")}${ @@ -193,14 +198,14 @@ function Tile({ return ( setHovered(primary.regionId)} + onMouseEnter={() => setHovered(primary.regionId, code)} onMouseLeave={() => setHovered(null)} {...(count ? { role: "button", tabIndex: 0, "aria-label": name, - onFocus: () => setHovered(primary.regionId), + onFocus: () => setHovered(primary.regionId, code), onBlur: () => setHovered(null), onKeyDown: (e) => { if (e.key !== "Enter" && e.key !== " ") return; @@ -241,9 +246,9 @@ function Tile({ width={width} height={size} fill="none" - stroke={active ? colorOf(primary) : "var(--color-surface)"} - strokeOpacity={active ? 1 : 0.55} - strokeWidth={active ? 4 : 2} + stroke={here ? "var(--color-ink)" : active ? colorOf(primary) : "var(--color-surface)"} + strokeOpacity={active || here ? 1 : 0.55} + strokeWidth={here ? 6 : active ? 4 : 2} className="transition-all duration-200" /> @@ -304,11 +309,14 @@ function RegionMap({ slices, groupCounts, ...props }: any) { ); } -function LegendButton({ region, selected, setSelected, hovered, setHovered }) { +function LegendButton({ region, selected, setSelected, hovered, setHovered, onPickRegion }) { const on = selected === region.id || hovered === region.id; return (
)}
); @@ -865,26 +893,20 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) { const [selected, setSelected] = useState(null); const [hovered, setHovered] = useState(null); + const [hoveredArea, setHoveredArea] = useState(null); const [openId, setOpenId] = useState(null); // no card open on arrival const [query, setQuery] = useState(""); const reading = useReadingMode(); - // The list scrolls itself to whatever the map or legend points at. + // The list scrolls itself to whatever the map or legend is clicked + // on (never on hover: it would jump around as the pointer crosses). const listRef = useRef(null); const regionRefs = useRef({}); - const groupRefs = useRef({}); + const stateRefs = useRef({}); - // Where the latest hover came from. The list follows the map and - // the legend, but hovering the list itself must not move it: the - // row would slide out from under the pointer. - const hoverFromList = useRef(false); - const hoverOnMap = id => { - hoverFromList.current = false; - setHovered(id); - }; - const hoverInList = id => { - hoverFromList.current = true; + const hoverOn = (id, code = null) => { setHovered(id); + setHoveredArea(code); }; const scrollListTo = el => { @@ -896,30 +918,21 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) { box.scrollTo({ top: el.offsetTop - 8, behavior: scrollBehavior() }); }; - // Hovering or selecting a region on the map or legend brings its - // block into view. After a hover in the list, nothing scrolls: not - // on the way in, and not back to the selection on the way out. - useEffect(() => { - if (hoverFromList.current) return; - const id = hovered || selected; - if (id) scrollListTo(regionRefs.current[id]); - }, [hovered, selected]); + const pickRegion = id => scrollListTo(regionRefs.current[id]); - // Clicking a tile jumps to its first group when it has one, - // otherwise to the region it belongs to. - const pickArea = code => { - const group = groups.find(c => c.area_code === code); - if (group && groupRefs.current[group.id]) { - return scrollListTo(groupRefs.current[group.id]); - } - const region = regionsForArea(code)[0]; - if (region) scrollListTo(regionRefs.current[region.id]); + // Clicking a tile jumps to the state's subheading under the region + // it selects when the state has groups there, otherwise to that + // region. Clicked back to no selection: the state under whichever + // region has its groups, else its first region. + const pickArea = (code, regionId) => { + const id = regionId ?? groups.find(c => c.area_code === code)?.region_id ?? regionsForArea(code)[0]?.id; + if (!id) return; + scrollListTo(stateRefs.current[`${id}:${code}`] ?? regionRefs.current[id]); }; /* The list column, built only when what it shows changes: hovering a map tile or legend entry changes `hovered`, which no row reads, - so hundreds of groups aren't drawn again for every tile crossed. - hoverInList only touches a ref and a state setter, both stable. */ + so hundreds of groups aren't drawn again for every tile crossed. */ const list = useMemo(() => { const match = matcher(query); const block = (region, indent) => { @@ -930,13 +943,13 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) { key={region.id} region={region} groups={inRegion} - subtext={subtextFor(region)} + subtext={region.map_note} indent={indent} regionRefs={regionRefs} - groupRefs={groupRefs} + stateRefs={stateRefs} selected={selected} setSelected={setSelected} - setHovered={hoverInList} + setHovered={setHovered} /> ); }; @@ -976,7 +989,7 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) { )} ); - }, [domestic, international, virtual, groupsIn, subtextFor, selected, query]); + }, [domestic, international, virtual, groupsIn, selected, query]); const shell = children => (
@@ -1023,7 +1036,7 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) { ); } - const shared = { selected, setSelected, hovered, setHovered: hoverOnMap }; + const shared = { selected, setSelected, hovered, hoveredArea, setHovered: hoverOn }; const onMapIds = new Set(regionAreas.map(a => a.region_id)); return ( @@ -1046,6 +1059,7 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) { domestic={domestic} international={international} onMapIds={onMapIds} + onPickRegion={pickRegion} {...shared} />

From 07c15ce96d251dca5d45c7577b54821e35353ceb Mon Sep 17 00:00:00 2001 From: Zaldimmar Date: Tue, 6 Oct 2026 04:47:25 -0500 Subject: [PATCH 4/8] Schedule presentation and map images for schedule entries (migration 069) A schedule block on an event page has a Present button, opening /events//present in a new tab: a setup screen (days, entries, seconds for each kind of slide) and then an endless full screen slideshow of day overviews, entry spotlights with their person, graphics and map images, its settings kept in the address so a signage screen can bookmark it. Schedule entries take a Map image (069), shown in the fold-out in place of the Google map and as a slide in the presentation. Co-Authored-By: Claude Opus 5.5 --- server/src/admin-schema/columns.js | 1 + .../src/migrations/069_schedule_map_image.sql | 10 + server/src/pageMeta.js | 15 + server/src/seed-showcase.js | 2 +- server/src/shape.js | 3 +- src/App.tsx | 10 + src/components/ContentBlocks.tsx | 22 +- src/components/ScheduleBlock.tsx | 66 ++- src/lib/adminSchema/shared.ts | 9 + src/lib/useContent.ts | 2 + src/pages/EventDetail.tsx | 2 +- src/pages/SchedulePresent.css | 40 ++ src/pages/SchedulePresent.tsx | 550 ++++++++++++++++++ 13 files changed, 710 insertions(+), 22 deletions(-) create mode 100644 server/src/migrations/069_schedule_map_image.sql create mode 100644 src/pages/SchedulePresent.css create mode 100644 src/pages/SchedulePresent.tsx diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js index bb96ef9..4673345 100644 --- a/server/src/admin-schema/columns.js +++ b/server/src/admin-schema/columns.js @@ -183,6 +183,7 @@ export const blocksChild = (ownerKind) => ({ text("media"), text("media_alt"), text("map"), + text("map_image"), ], }, ], diff --git a/server/src/migrations/069_schedule_map_image.sql b/server/src/migrations/069_schedule_map_image.sql new file mode 100644 index 0000000..25c5e36 --- /dev/null +++ b/server/src/migrations/069_schedule_map_image.sql @@ -0,0 +1,10 @@ +-- ═══════════════════════════════════════════════════════════════ +-- 069 SCHEDULE MAP IMAGE +-- +-- A schedule entry's own map picture (an upload), eg. a drawn map of +-- the camp with the room marked. Shown in the entry's fold-out in +-- place of the Google map, and as a slide in the schedule +-- presentation (/events//present). +-- ═══════════════════════════════════════════════════════════════ + +ALTER TABLE content_block_items ADD COLUMN map_image TEXT; diff --git a/server/src/pageMeta.js b/server/src/pageMeta.js index 3fbe257..2d9bc72 100644 --- a/server/src/pageMeta.js +++ b/server/src/pageMeta.js @@ -400,6 +400,21 @@ export function metaFor(db, rawPath) { return { ...meta, title: titled(site, page.title), description: plainText(page.description) ?? meta.description }; } + // An event's schedule presentation (SchedulePresent.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$/); + if (present) { + let id; + try { + id = decodeURIComponent(present[1]); + } catch { + return notFound(meta); + } + const event = eventMeta(site, db, id, { ...meta, canonical: `${origin(site)}/events/${present[1]}` }); + return event.status === 200 ? { ...event, noindex: true, jsonLd: null } : event; + } + const match = pathname.match(/^\/(events|regions|groups|partners|organizations|teams|awards|people|blog|directory)\/([^/]+)$/); if (!match) return notFound(meta); diff --git a/server/src/seed-showcase.js b/server/src/seed-showcase.js index 6b66af4..26ee185 100644 --- a/server/src/seed-showcase.js +++ b/server/src/seed-showcase.js @@ -91,7 +91,7 @@ const SCHEDULE = [ { text: "The weekend at a glance. Tap an entry for more." }, [ { day: "Friday", time: "4:00pm", text: "Arrivals and check-in", location: "Front desk" }, - { 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" }, + { 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: "Saturday", time: "9:00am", text: "Workshops", location: "Classrooms", person_id: "showcase-member-2", detail: "Pick one of three", url: "/blog/content-block-showcase" }, { day: "Saturday", time: "7:00pm", text: "Talent night", location: "Main 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" }, diff --git a/server/src/shape.js b/server/src/shape.js index 51acb01..4548776 100644 --- a/server/src/shape.js +++ b/server/src/shape.js @@ -101,7 +101,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") { const itemRows = db .prepare( `SELECT i.block_id, i.text, i.detail, i.url, - i.day, i.time, i.location, i.description, i.media, i.media_alt, i.map, + i.day, i.time, i.location, i.description, i.media, i.media_alt, i.map, i.map_image, p.id AS person_id, p.display_name AS person_name, p.photo AS person_photo, p.tagline AS person_tagline FROM content_block_items i @@ -126,6 +126,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") { media: row.media, media_alt: row.media_alt, map: row.map, + map_image: row.map_image, person: row.person_id ? { id: row.person_id, diff --git a/src/App.tsx b/src/App.tsx index af3fa83..5f3fc56 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -70,6 +70,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")) /*Admin Pages*/ const AdminLayout = lazyPage(() => import("./pages/admin/AdminLayout.tsx")) @@ -113,6 +114,15 @@ export default function App() { } /> } /> + {/* A schedule as a slideshow for a screen: full screen, no Layout. */} + + + + } + /> diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx index d0f6cbf..e432181 100644 --- a/src/components/ContentBlocks.tsx +++ b/src/components/ContentBlocks.tsx @@ -62,10 +62,14 @@ export default function ContentBlocks({ blocks, accent = BRAND, className = '', + presentAt, }: { blocks?: ContentBlock[] | null accent?: string className?: 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 @@ -81,10 +85,22 @@ export default function ContentBlocks({ return level }) + let schedules = 0 + const presentHrefs = blocks.map((block) => + presentAt && block.type === 'schedule' ? `${presentAt}?block=${schedules++}` : undefined, + ) + return (

{blocks.map((block, index) => ( - + ))}
) @@ -154,11 +170,13 @@ 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() @@ -359,7 +377,7 @@ function Block({ case 'schedule': if (!block.items?.length) return null - return + return case 'people': { const picked = (block.items ?? []) diff --git a/src/components/ScheduleBlock.tsx b/src/components/ScheduleBlock.tsx index 5458b7c..733a11d 100644 --- a/src/components/ScheduleBlock.tsx +++ b/src/components/ScheduleBlock.tsx @@ -15,7 +15,11 @@ A row folds out when it has anything more to show: a description, a graphic, a map, or a person (their photo, tagline and a link to their page). The map is Google's key-free embed of - the place typed in, with a link out to the full map. + the place typed in, with a link out to the full map; an entry's + own map image (069) shows instead, the link out kept. + + On an event page a Present button opens the schedule as a + slideshow for a screen (SchedulePresent.tsx). Tabs follow the ARIA tab pattern: arrow keys move between them. @@ -24,7 +28,7 @@ it, no map frame (ReadingSchedule). ═══════════════════════════════════════════════════════════════ */ -import { CaretDown } from '@phosphor-icons/react' +import { CaretDown, Presentation } from '@phosphor-icons/react' import { Fragment, useId, useState, type KeyboardEvent, type ReactNode } from 'react' import { Link } from 'react-router-dom' @@ -40,9 +44,9 @@ import { useReadingMode } from '../lib/readingMode.ts' const BODY = 'var(--color-muted)' const WEEKDAYS = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] -type Day = { name: string; entries: ContentBlockItem[] } +export type Day = { name: string; entries: ContentBlockItem[] } -function groupByDay(items: ContentBlockItem[]): Day[] { +export function groupByDay(items: ContentBlockItem[]): Day[] { const days: Day[] = [] for (const item of items) { const name = item.day?.trim() ?? '' @@ -67,12 +71,15 @@ function todayIndex(days: Day[]): number { return found >= 0 ? found : 0 } +/* An entry's own map image says what it maps. */ +export const mapAlt = (entry: ContentBlockItem) => `Map: ${entry.map?.trim() || entry.location || entry.text}` + const mapEmbed = (place: string) => `https://maps.google.com/maps?q=${encodeURIComponent(place)}&output=embed&maptype=satellite` const mapLink = (place: string) => `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(place)}` -function Avatar({ person, size }: { person: NonNullable; size: string }) { +export function Avatar({ person, size }: { person: NonNullable; size: string }) { const img = useSmallImage(mediaUrl(person.photo)) return !img.failed ? ( @@ -93,7 +100,8 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) { const panelId = useId() const graphic = mediaUrl(entry.media) const place = entry.map?.trim() - const more = Boolean(entry.description || graphic || place || entry.person) + const mapImage = mediaUrl(entry.map_image) + const more = Boolean(entry.description || graphic || place || mapImage || entry.person) const title = entry.url ? ( @@ -181,9 +189,11 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) { {graphic && {entry.media_alt} - {place && ( + {(place || mapImage) && (
- {showMap ? ( + {mapImage ? ( + {mapAlt(entry)} + ) : showMap && place ? (