Events 3.7.2 + Website 1.6.1: no duplicate events after a reseed; "Events site" in the header

A reseed gives every event a new id without listing the old ones in the
feed's `deleted`, and consumers only fetched ?updatedSince= after the first
sync, so the old copies stayed beside the new ones.

- Both: the 15-minute feed poll and "Sync now" fetch the whole list and
  drop copies that aren't in it; the fetch after event.changed stays
  incremental.
- Events set-demo.js keeps FeedEntry and marks its live entries removed,
  resets the links' lastGoodAt, then publishes the new feed, sends
  event.changed and fetches the linked products' events back in.
- Website loadDemo lists the old published events in FeedRemoval and sends
  event.changed after publishing.
- Website header: links to the church's other sites read "Events site"
  with an external-link icon, not a second "Events".

Checked: Website backend tests (133), Events backend tests (802), both
typechecks, Website frontend build. set-demo.js not run end to end (no
local database).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-27 15:35:38 +02:00
co-authored by Claude Opus 5.5
parent a75d2f7b46
commit 7f681c9e81
24 changed files with 211 additions and 29 deletions
+10 -4
View File
@@ -1,20 +1,23 @@
/**
* Each template's header (WEBSITE-1.0-PLAN §3, "Headers"), with its options from the Header style
* setting. Every header collapses to a Menu button on phones (a <details>, so it works without
* JavaScript). Links to the church's other sites (Events, App) sit next to the pages (§9).
* JavaScript). Links to the church's other sites sit next to the pages (§9), as "Events site" with an
* external-link icon (1.6.1), so they aren't mistaken for this site's own Events page.
*/
import Link from "next/link";
import { ExternalLink } from "lucide-react";
import { productLinks } from "@crosscode/ui";
import { ScrollSolid } from "./ScrollSolid";
import { cx } from "./parts";
import type { Published } from "./types";
type Item = { label: string; href: string; current: boolean };
/** `external`: one of the church's other sites (1.6.1), marked so it isn't mistaken for a page here. */
type Item = { label: string; href: string; current: boolean; external?: boolean };
function items(site: Published, path: string): { nav: Item[]; visit: Item | null } {
const pages = site.snapshot.pages;
const nav: Item[] = pages.filter((p) => p.inNav).map((p) => ({ label: p.navLabel, href: p.path, current: p.path === path }));
for (const l of site.church ? productLinks(site.church.links, "website") : []) nav.push({ label: l.label, href: l.href, current: false });
for (const l of site.church ? productLinks(site.church.links, "website") : []) nav.push({ label: `${l.label} site`, href: l.href, current: false, external: true });
const v = pages.find((p) => p.kind === "visit");
return { nav, visit: v ? { label: v.navLabel, href: v.path, current: v.path === path } : null };
}
@@ -36,7 +39,10 @@ function Links({ nav, className, linkClass }: { nav: Item[]; className?: string;
<ul className={className}>
{nav.map((n) => (
<li key={n.href}>
<a href={n.href} aria-current={n.current ? "page" : undefined} className={cx("no-underline hover:underline underline-offset-8", n.current && "underline", linkClass)}>{n.label}</a>
<a href={n.href} aria-current={n.current ? "page" : undefined} title={n.external ? "Our separate site" : undefined} className={cx("no-underline hover:underline underline-offset-8", n.current && "underline", n.external && "inline-flex items-center gap-1", linkClass)}>
{n.label}
{n.external && <ExternalLink className="h-[0.85em] w-[0.85em] shrink-0 opacity-70" aria-hidden />}
</a>
</li>
))}
</ul>