From f65664217e573ff8d9837bfa14bf8a21d9140477 Mon Sep 17 00:00:00 2001 From: Zaldimmar Date: Thu, 1 Oct 2026 03:28:03 -0500 Subject: [PATCH 01/17] Details & Contact as blocks, not a preset; the side nav sits in the margin instead of shifting the sections Migration 058 turns the organization_details preset into the section's own blocks and drops it from page_sections' CHECK. The side nav is placed in the left margin beside the 72rem content, from 88rem screens up, so sections stay where they'd be without it. Co-Authored-By: Claude Opus 5.5 --- docs/updating-data-in-code.md | 2 +- server/src/admin-schema/sitePages.js | 1 - server/src/migrations/058_contact_blocks.sql | 73 ++++++++++++++++++++ src/components/PageShell.tsx | 31 +++++---- src/data/organizationDetails.ts | 3 +- src/lib/adminSchema/sitePages.ts | 3 +- src/pages/SitePage.tsx | 31 --------- 7 files changed, 95 insertions(+), 49 deletions(-) create mode 100644 server/src/migrations/058_contact_blocks.sql diff --git a/docs/updating-data-in-code.md b/docs/updating-data-in-code.md index 5e6fa46..7798117 100644 --- a/docs/updating-data-in-code.md +++ b/docs/updating-data-in-code.md @@ -30,7 +30,7 @@ what a dropdown in the admin editor says. | A record: an event, organization, person, team, award, timeline entry | the database | editing it in the admin | | The front page's words, photos, bands, stats and paths | the database | Admin → Pages → Front page | | Blog posts, and the Community page's blog settings (headings, pins, feeds) | the database | Admin → Data → Blog posts, and Admin → Pages → Community | -| The sections of Retreats, Community, Resources, Organization and History: titles, blurbs, accents, their content blocks and presets (the blog, groups map, regions, partners, events, timeline, NGU's details) | the database | Admin → Pages → the page. A section title is 30 characters at most (it's listed in the side nav); a front page heading fits about 60. Preset names: `PRESETS` in `src/lib/adminSchema/sitePages.ts`, what each draws: `PRESETS` in `src/pages/SitePage.tsx` | +| The sections of Retreats, Community, Resources, Organization and History: titles, blurbs, accents, their content blocks and presets (the blog, groups map, regions, partners, events, timeline) | the database | Admin → Pages → the page. A section title is 30 characters at most (it's listed in the side nav); a front page heading fits about 60. Preset names: `PRESETS` in `src/lib/adminSchema/sitePages.ts`, what each draws: `PRESETS` in `src/pages/SitePage.tsx` | | The **label** a dropdown shows in the admin | code | [one file](#renaming-what-a-dropdown-shows) | | The **list of allowed values** behind a fixed dropdown | database CHECK + code | [a migration and three files](#adding-removing-or-renaming-a-stored-value) | | Navigation, colors, the site banner, history decades, the map grid | code | [the file named below](#other-content-that-lives-in-code) | diff --git a/server/src/admin-schema/sitePages.js b/server/src/admin-schema/sitePages.js index 99edd3f..d8c57e0 100644 --- a/server/src/admin-schema/sitePages.js +++ b/server/src/admin-schema/sitePages.js @@ -30,7 +30,6 @@ const sectionsChild = { "partner_list", "events", "timeline", - "organization_details", ]), text("scope_id"), enumeration("event_type", ["retreat", "class", "workshop", "meeting", "other"]), diff --git a/server/src/migrations/058_contact_blocks.sql b/server/src/migrations/058_contact_blocks.sql new file mode 100644 index 0000000..3dfdf4a --- /dev/null +++ b/server/src/migrations/058_contact_blocks.sql @@ -0,0 +1,73 @@ +-- ═══════════════════════════════════════════════════════════════ +-- 058 DETAILS & CONTACT AS BLOCKS +-- +-- The Organization page's Details & Contact section was a preset +-- (organization_details) drawing NGU's address, tax ID and email +-- from code. It's ordinary content now, edited like any section's: +-- each section that used the preset gets those details as blocks +-- (the address, the nonprofit line with the tax ID, an email +-- button), and the preset leaves page_sections' CHECK. +-- +-- page_sections is rebuilt for that CHECK, keeping its ids (its +-- blocks are owned by them), with its index and cleanup trigger. +-- ═══════════════════════════════════════════════════════════════ + +INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text, href) +SELECT 'page_section', CAST(s.id AS TEXT), 'body', b.sort_order, b.type, b.text, b.href + FROM page_sections s + CROSS JOIN ( + SELECT 1000 AS sort_order, 'paragraph' AS type, + '1901 NW Blue Parkway' || char(10) || 'Unity Village, MO 64065' || char(10) || + '*(Physical address, not for mail)*' AS text, + NULL AS href + UNION ALL + SELECT 1001, 'paragraph', + 'Next Generation of Unity is a qualified 501(c)(3) nonprofit organization. Tax ID: 33-2819320.', NULL + UNION ALL + SELECT 1002, 'button', 'info@nextgenerationofunity.org', 'mailto:info@nextgenerationofunity.org' + ) b + WHERE s.preset = 'organization_details'; + +UPDATE page_sections SET preset = NULL WHERE preset = 'organization_details'; + +CREATE TABLE page_sections_new ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + page_id TEXT NOT NULL REFERENCES site_pages (id) ON DELETE CASCADE, + sort_order INTEGER NOT NULL DEFAULT 0, + anchor TEXT NOT NULL + CONSTRAINT "A section's URL ID can use only lowercase letters, numbers and hyphens, eg. leadership." + CHECK (anchor <> '' AND anchor NOT GLOB '*[^a-z0-9-]*'), + title TEXT NOT NULL + CONSTRAINT "A section title can be 30 characters at most (it's listed in the page's side nav)." + CHECK (length(title) <= 30), + blurb TEXT, + accent TEXT CHECK (accent IN ('teal', 'deep', 'green', 'amber')), + preset TEXT CHECK (preset IN ('community_blog', 'group_map', 'region_list', 'partner_list', + 'events', 'timeline')), + -- An events preset's filter and first view. + scope_id TEXT REFERENCES event_scopes (id) ON DELETE SET NULL, + event_type TEXT CHECK (event_type IN ('retreat', 'class', 'workshop', 'meeting', 'other')), + view TEXT CHECK (view IN ('carousel', 'grid', 'map')), + UNIQUE (page_id, anchor) +) STRICT; + +INSERT INTO page_sections_new + (id, page_id, sort_order, anchor, title, blurb, accent, preset, scope_id, event_type, view) +SELECT id, page_id, sort_order, anchor, title, blurb, accent, preset, scope_id, event_type, view + FROM page_sections; + +PRAGMA legacy_alter_table = ON; +DROP TABLE page_sections; +ALTER TABLE page_sections_new RENAME TO page_sections; +PRAGMA legacy_alter_table = OFF; + +CREATE INDEX page_sections_page_idx ON page_sections (page_id, sort_order); + + +-- ── Triggers last (see CLAUDE.md, Migrations) ── + +CREATE TRIGGER page_sections_cleanup +AFTER DELETE ON page_sections +BEGIN + DELETE FROM content_blocks WHERE owner_kind = 'page_section' AND owner_id = CAST(old.id AS TEXT); +END; diff --git a/src/components/PageShell.tsx b/src/components/PageShell.tsx index 411095c..1b0918c 100644 --- a/src/components/PageShell.tsx +++ b/src/components/PageShell.tsx @@ -5,10 +5,14 @@ heading with a blurb and rule. Sections paint no background of their own: the page's (PageBackdrop.tsx) runs behind all of them. - `sideNav` adds an "On this page" column at the left from lg up, the + `sideNav` adds an "On this page" list in the left margin, the admin editors' own (SectionNav), sticky under the header, listing - the sections with the one being read lit. Below lg the menu lists - the sections instead. + the sections with the one being read lit. It sits beside the + sections rather than taking a column from them, so they stay where + they'd be without it; it shows once the margin beside the 72rem + content is wide enough for it (88rem screens up, titles wrapping + onto a second line). Narrower, the header's dropdowns list the + sections instead. Whatever goes inside a section is passed as `content`, the shell doesn't care what it is. @@ -105,12 +109,9 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P if (typeof title === "string") document.title = documentTitle(title); }, [title]); - // The thin solid banner between sections. With the side nav it runs - // the page's full width, under the nav column, rather than stopping - // at the content's edge. - const banner = (accent: string) => ( -
- ); + // The thin solid banner between sections, the page's full width + // (behind the side nav). + const banner = (accent: string) =>
; const bands = sections.map((section, i) => (
{banner(section.accent)} @@ -132,13 +133,17 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
{sideNav ? ( -
- {bands} From c0ae48b064aac9e1dc742645b02b8454610ef23d Mon Sep 17 00:00:00 2001 From: Zaldimmar Date: Thu, 1 Oct 2026 03:37:06 -0500 Subject: [PATCH 04/17] Version v1.10.8 Co-Authored-By: Claude Opus 5.5 --- src/lib/version.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/version.ts b/src/lib/version.ts index 07f42c7..79668fb 100644 --- a/src/lib/version.ts +++ b/src/lib/version.ts @@ -7,4 +7,4 @@ box or a build banner can read the same value later. ═══════════════════════════════════════════════════════════════ */ -export const SITE_VERSION = "NGU-Web.v1.10.7"; +export const SITE_VERSION = "NGU-Web.v1.10.8"; From 857506abb74e8f53edb6878d07458aacf822dc57 Mon Sep 17 00:00:00 2001 From: Zaldimmar Date: Thu, 1 Oct 2026 03:41:06 -0500 Subject: [PATCH 05/17] Side nav circle: its own sticky layer behind the section lines, clipped at the nav column The circle centers on the list's measured box, so it stays on the nav at any width, and the column clips it (overflow: clip, which keeps the sticky layers sticking) so it never covers content. Co-Authored-By: Claude Opus 5.5 --- src/components/PageShell.tsx | 62 ++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 9 deletions(-) diff --git a/src/components/PageShell.tsx b/src/components/PageShell.tsx index 00104af..cf5f4b2 100644 --- a/src/components/PageShell.tsx +++ b/src/components/PageShell.tsx @@ -38,7 +38,7 @@ /> ═══════════════════════════════════════════════════════════════ */ -import { useEffect, type ReactNode } from "react"; +import { useEffect, useRef, useState, type ReactNode } from "react"; import { documentTitle } from "../lib/site.ts"; import { accentText, BRAND } from '../lib/color.ts' @@ -101,7 +101,32 @@ export function Section({ section }: { section: ShellSection }) { ); } +/* The side nav's circle: half again the list's width (or a little + more than its height, if taller), at most 22rem. */ +const circleSize = (box: { width: number; height: number }) => + Math.min(Math.max(box.width * 1.5, box.height * 1.1), 22 * 16); + +/* Where the side nav sticks, and how far its list sits in from the + column's top and left (pt-8, pl-4): the circle centers on that. */ +const STICK = "calc(var(--header-h, 5rem) + 1rem)"; +const LIST_TOP = 32; +const LIST_LEFT = 16; + export default function PageShell({ title, intro, sections, sideNav = false }: PageShellProps) { + // The list's measured box, so its circle can center on it from a + // layer of its own (below). + const listRef = useRef(null); + const [listBox, setListBox] = useState<{ width: number; height: number } | null>(null); + useEffect(() => { + const el = listRef.current; + if (!el) return; + const ro = new ResizeObserver(([entry]) => + setListBox({ width: entry.borderBoxSize[0].inlineSize, height: entry.borderBoxSize[0].blockSize }), + ); + ro.observe(el); + return () => ro.disconnect(); + }, [sideNav]); + // The tab's title as the visitor moves around. The first load's // comes from the server (pageMeta.js), which also sets the page's // description and preview for search and link sharing. @@ -134,19 +159,38 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P {sideNav ? (
- {/* The margin left of the content (72rem, its text 1.5rem in). */} + {/* The margin left of the content (72rem, its text 1.5rem in), + clipping anything wider so the circle never reaches the + content. clip, not hidden: hidden would make it a scroll + container, and the sticky layers in it would stop + sticking. */}