From 94e2fc00240a6d83f3abb2ceca48e9b33f2de8e3 Mon Sep 17 00:00:00 2001 From: m Date: Wed, 22 Apr 2026 23:34:52 +0200 Subject: [PATCH] feat(changelog): What's New page with sidebar badge Adds a hardcoded changelog (internal/changelog) served via GET /api/changelog and /api/changelog/unseen-count?since=, a /changelog page that renders entries newest-first, and a sidebar "Neuigkeiten" link with a lime badge showing the count of unseen entries since the caller's last visit (localStorage stamp). - internal/changelog: Entry struct, 11 pre-populated entries covering everything shipped so far (Dashboard, Projects/Deadlines/Appointments, CalDAV, Checklists v2, Glossary, Courts, Invitations, Settings, Paliad rename, and the changelog itself). - Handler: public via auth-gated protected mux. Lexicographic string compare treats YYYY-MM-DD entries and ISO 8601 cutoffs symmetrically. - Sidebar: new sidebar-changelog link before the Einladen button; the badge is populated by a fetch on every page load, suppressed on /changelog itself to avoid flash, and cleared on visit by stamping localStorage in changelog.ts's DOMContentLoaded handler. - i18n: DE + EN keys for nav, page chrome, and tag labels. - Unit tests for sort order, copy semantics, and same-day cutoff. Task: t-paliad-027 --- frontend/build.ts | 3 + frontend/src/changelog.tsx | 41 ++++++++ frontend/src/client/changelog-seen.ts | 15 +++ frontend/src/client/changelog.ts | 89 ++++++++++++++++ frontend/src/client/i18n.ts | 20 ++++ frontend/src/client/sidebar.ts | 28 +++++ frontend/src/components/Sidebar.tsx | 6 ++ frontend/src/styles/global.css | 110 +++++++++++++++++++ internal/changelog/changelog.go | 146 ++++++++++++++++++++++++++ internal/changelog/changelog_test.go | 45 ++++++++ internal/handlers/changelog.go | 31 ++++++ internal/handlers/handlers.go | 3 + 12 files changed, 537 insertions(+) create mode 100644 frontend/src/changelog.tsx create mode 100644 frontend/src/client/changelog-seen.ts create mode 100644 frontend/src/client/changelog.ts create mode 100644 internal/changelog/changelog.go create mode 100644 internal/changelog/changelog_test.go create mode 100644 internal/handlers/changelog.go diff --git a/frontend/build.ts b/frontend/build.ts index d4f5faa..eb3413f 100644 --- a/frontend/build.ts +++ b/frontend/build.ts @@ -26,6 +26,7 @@ import { renderAppointmentsCalendar } from "./src/appointments-calendar"; import { renderSettings } from "./src/settings"; import { renderDashboard } from "./src/dashboard"; import { renderOnboarding } from "./src/onboarding"; +import { renderChangelog } from "./src/changelog"; const DIST = join(import.meta.dir, "dist"); @@ -63,6 +64,7 @@ async function build() { join(import.meta.dir, "src/client/settings.ts"), join(import.meta.dir, "src/client/dashboard.ts"), join(import.meta.dir, "src/client/onboarding.ts"), + join(import.meta.dir, "src/client/changelog.ts"), ], outdir: join(DIST, "assets"), naming: "[name].js", @@ -110,6 +112,7 @@ async function build() { await Bun.write(join(DIST, "settings.html"), renderSettings()); await Bun.write(join(DIST, "dashboard.html"), renderDashboard()); await Bun.write(join(DIST, "onboarding.html"), renderOnboarding()); + await Bun.write(join(DIST, "changelog.html"), renderChangelog()); console.log("Build complete \u2192 dist/"); } diff --git a/frontend/src/changelog.tsx b/frontend/src/changelog.tsx new file mode 100644 index 0000000..5a8246c --- /dev/null +++ b/frontend/src/changelog.tsx @@ -0,0 +1,41 @@ +import { h } from "./jsx"; +import { Sidebar } from "./components/Sidebar"; +import { Footer } from "./components/Footer"; + +export function renderChangelog(): string { + return "" + ( + + + + + Neuigkeiten — Paliad + + + + + +
+
+
+
+

Neuigkeiten

+

+ Was sich in Paliad in letzter Zeit getan hat. +

+
+ +
    + + +
+
+
+ +