From 50ac065c7d3ee3534795d0b70a7f50f78dbeadf8 Mon Sep 17 00:00:00 2001 From: m Date: Mon, 4 May 2026 13:48:53 +0200 Subject: [PATCH] feat(t-paliad-110): mount unified EventsPage on /deadlines + /appointments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-3 of the Fristen+Termine unification. Both routes now serve the shared shell built by renderEvents() — the per-type pages (deadlines.tsx / appointments.tsx and their client bundles) are deleted entirely. Hydration is baked at build time, not at request time: build.ts emits events-deadlines.html and events-appointments.html, each carrying an inline `window.__PALIAD_EVENTS__={"defaultType":"…"}` script in . The Go handlers ServeFile the matching artefact, no placeholder swap needed (cleaner than the dashboard pattern for a single static flag). Sidebar entries unchanged — "Fristen" still points at /deadlines, "Termine" at /appointments. Both highlight correctly because each artefact passes the matching currentPath into . Detail / new / calendar pages stay type-specific (out of scope per task brief). Old endpoints /api/deadlines + /api/appointments remain live for the calendars, project-detail panes, and CalDAV consumers. Net: -981 lines (drops the duplicated chrome of the two old pages in favour of one shared shell). go build/vet/test ./... clean. bun run build clean. --- frontend/build.ts | 13 +- frontend/src/appointments.tsx | 130 -------- frontend/src/client/appointments.ts | 270 --------------- frontend/src/client/deadlines.ts | 421 ------------------------ frontend/src/deadlines.tsx | 141 -------- frontend/src/events.tsx | 19 +- internal/handlers/appointments_pages.go | 4 +- internal/handlers/deadlines_pages.go | 6 +- 8 files changed, 23 insertions(+), 981 deletions(-) delete mode 100644 frontend/src/appointments.tsx delete mode 100644 frontend/src/client/appointments.ts delete mode 100644 frontend/src/client/deadlines.ts delete mode 100644 frontend/src/deadlines.tsx diff --git a/frontend/build.ts b/frontend/build.ts index 6a45127..5d816d4 100644 --- a/frontend/build.ts +++ b/frontend/build.ts @@ -15,12 +15,10 @@ import { renderCourts } from "./src/courts"; import { renderProjects } from "./src/projects"; import { renderProjectsNew } from "./src/projects-new"; import { renderProjectsDetail } from "./src/projects-detail"; -import { renderDeadlines } from "./src/deadlines"; import { renderEvents } from "./src/events"; import { renderDeadlinesNew } from "./src/deadlines-new"; import { renderDeadlinesDetail } from "./src/deadlines-detail"; import { renderDeadlinesCalendar } from "./src/deadlines-calendar"; -import { renderAppointments } from "./src/appointments"; import { renderAppointmentsNew } from "./src/appointments-new"; import { renderAppointmentsDetail } from "./src/appointments-detail"; import { renderAppointmentsCalendar } from "./src/appointments-calendar"; @@ -240,12 +238,10 @@ async function build() { join(import.meta.dir, "src/client/projects.ts"), join(import.meta.dir, "src/client/projects-new.ts"), join(import.meta.dir, "src/client/projects-detail.ts"), - join(import.meta.dir, "src/client/deadlines.ts"), join(import.meta.dir, "src/client/events.ts"), join(import.meta.dir, "src/client/deadlines-new.ts"), join(import.meta.dir, "src/client/deadlines-detail.ts"), join(import.meta.dir, "src/client/deadlines-calendar.ts"), - join(import.meta.dir, "src/client/appointments.ts"), join(import.meta.dir, "src/client/appointments-new.ts"), join(import.meta.dir, "src/client/appointments-detail.ts"), join(import.meta.dir, "src/client/appointments-calendar.ts"), @@ -350,16 +346,15 @@ async function build() { await Bun.write(join(DIST, "projects.html"), renderProjects()); await Bun.write(join(DIST, "projects-new.html"), renderProjectsNew()); await Bun.write(join(DIST, "projects-detail.html"), renderProjectsDetail()); - await Bun.write(join(DIST, "deadlines.html"), renderDeadlines()); - // t-paliad-110 — shared EventsPage shell. Two HTML outputs (events-deadlines - // / events-appointments) so each route gets a Sidebar/BottomNav highlighted - // for the matching nav entry; the Go handler injects defaultType at runtime. + // t-paliad-110 — shared EventsPage shell. Two HTML outputs + // (events-deadlines / events-appointments) so each route gets a + // Sidebar/BottomNav highlighted for the matching nav entry; the + // defaultType is baked into each artefact via inline hydration. await Bun.write(join(DIST, "events-deadlines.html"), renderEvents("/deadlines")); await Bun.write(join(DIST, "events-appointments.html"), renderEvents("/appointments")); await Bun.write(join(DIST, "deadlines-new.html"), renderDeadlinesNew()); await Bun.write(join(DIST, "deadlines-detail.html"), renderDeadlinesDetail()); await Bun.write(join(DIST, "deadlines-calendar.html"), renderDeadlinesCalendar()); - await Bun.write(join(DIST, "appointments.html"), renderAppointments()); await Bun.write(join(DIST, "appointments-new.html"), renderAppointmentsNew()); await Bun.write(join(DIST, "appointments-detail.html"), renderAppointmentsDetail()); await Bun.write(join(DIST, "appointments-calendar.html"), renderAppointmentsCalendar()); diff --git a/frontend/src/appointments.tsx b/frontend/src/appointments.tsx deleted file mode 100644 index 4b79d0e..0000000 --- a/frontend/src/appointments.tsx +++ /dev/null @@ -1,130 +0,0 @@ -import { h } from "./jsx"; -import { Sidebar } from "./components/Sidebar"; -import { BottomNav } from "./components/BottomNav"; -import { Footer } from "./components/Footer"; -import { PWAHead } from "./components/PWAHead"; - -export function renderAppointments(): string { - return "" + ( - - - - - - - - - Termine — Paliad - - - - - - -
-
-
-
-
-
-

Termine

-

- Verhandlungen, Besprechungen, Beratungen — persönlich oder aktenbezogen. -

-
- -
-
- -
- - - -
- -
-
- - - - - - - - - - -
-
- - - -
- - - - - - - - - - - -
- BeginnTitelProjektOrtTyp
-
- - - - -
-
-
- -