feat: redesign portal UI with Sakani UI and add release notes
Replace the hand-rolled Tailwind/shadcn look with Sakani UI across the editorial area, the admin area and all signed-out pages. - AppShell (Sakani Sidebar + TopBar) for /redaktion and /admin, with a mobile drawer, theme toggle, sign-out, legal links and a "Was ist neu" button; PublicShell for login, registration, password, 2FA and errors. - Shared primitives (Button, Card, Input, PageHeader) now render Sakani; components/ui/sakani.tsx is the client boundary for Server Components (Sakani ships no "use client") and adds FormSelect (native form value) and DataTable (element cells from the server). - Legacy CSS variables map onto Sakani tokens; globals.css shrinks from ~2200 to ~700 lines. Geist replaces Inter. recharts/lucide-react dropped (charts via Sakani BarChart). - Release notes popup per area, shown once per version (localStorage) and reopenable from the sidebar; native <dialog> for focus trapping. - Fixes found while testing: TOTP field reused the typed password in clear text, modal dialogs sat top-left, invisible unchecked checkboxes in dark mode. - Parallel run: compose.parallel.yaml, AUTO_RULE_SYNC_DISABLED switch and docs/operations.md §8 (start, rollback, cutover). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
453bece72c
commit
9e938e4d07
79 files changed
+2266
-4316
No files matched your search
@@ -0,0 +1,106 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
import { Button } from "@sakaniui/react";
|
||||
import { IconCheck } from "@sakaniui/react/icons";
|
||||
|
||||
// Bump RELEASE.version for the next release and replace the notes: every user
|
||||
// then sees the popup once more. ponytail: only the latest release is kept;
|
||||
// add a history list when users ask for older notes.
|
||||
export const RELEASE = {
|
||||
version: "2.0",
|
||||
title: "Neues Design",
|
||||
notes: {
|
||||
redaktion: [
|
||||
"Neues, ruhigeres Design – hell oder dunkel, umschaltbar oben rechts.",
|
||||
"Navigation links in einer Seitenleiste, auf dem Handy über das Menü-Symbol.",
|
||||
"Suche und Filter nach Format und Jahr übersichtlich in einem Feld.",
|
||||
"Nutzungen und Abrechnungen zeigen ihren Status farbig (Offen, Abgerechnet …).",
|
||||
"Der Download-Dialog erscheint jetzt mittig im Bild.",
|
||||
"Impressum, Datenschutz und Nutzungsbedingungen finden Sie unten links.",
|
||||
],
|
||||
admin: [
|
||||
"Neues Design mit Seitenleiste für alle Admin-Bereiche, hell oder dunkel.",
|
||||
"Dashboard mit Umsatz des Monats und Download-Diagramm der letzten 30 Tage.",
|
||||
"Redaktionen als Karten mit Status, Preis und offenem Betrag.",
|
||||
"Albumrechte mit Vorschaubild; zugewiesene Alben sind grün markiert.",
|
||||
"Abrechnung als Tabelle mit Auswahl, Status und Summe auf einen Blick.",
|
||||
"Hinweise, Audit-Protokoll und Anmeldung im neuen Layout.",
|
||||
],
|
||||
},
|
||||
} as const;
|
||||
|
||||
export type ReleaseArea = keyof typeof RELEASE.notes;
|
||||
|
||||
const seenKey = (area: ReleaseArea) => `release-notes-seen:${area}`;
|
||||
|
||||
// Per browser, not per account: a courtesy popup, not a record of consent.
|
||||
function readSeen(area: ReleaseArea): string | null {
|
||||
try {
|
||||
return window.localStorage.getItem(seenKey(area));
|
||||
} catch {
|
||||
return RELEASE.version; // storage blocked: don't nag on every page load
|
||||
}
|
||||
}
|
||||
|
||||
function markSeen(area: ReleaseArea) {
|
||||
try {
|
||||
window.localStorage.setItem(seenKey(area), RELEASE.version);
|
||||
} catch {
|
||||
/* storage blocked — nothing to persist */
|
||||
}
|
||||
}
|
||||
|
||||
// Native <dialog>.showModal() instead of Sakani's Modal: it traps focus, makes
|
||||
// the page inert and handles Escape; Sakani's Modal left focus on the page.
|
||||
export function ReleaseNotesDialog({
|
||||
area,
|
||||
open,
|
||||
onOpenChange,
|
||||
}: Readonly<{ area: ReleaseArea; open: boolean; onOpenChange: (open: boolean) => void }>) {
|
||||
const ref = useRef<HTMLDialogElement>(null);
|
||||
|
||||
// Open once per version, after hydration (localStorage is client-only).
|
||||
useEffect(() => {
|
||||
if (readSeen(area) !== RELEASE.version) onOpenChange(true);
|
||||
}, [area, onOpenChange]);
|
||||
|
||||
useEffect(() => {
|
||||
const dialog = ref.current;
|
||||
if (!dialog) return;
|
||||
if (open && !dialog.open) dialog.showModal();
|
||||
if (!open && dialog.open) dialog.close();
|
||||
}, [open]);
|
||||
|
||||
// Runs for the button, Escape and dialog.close() alike.
|
||||
function handleClose() {
|
||||
markSeen(area);
|
||||
onOpenChange(false);
|
||||
}
|
||||
|
||||
return (
|
||||
<dialog ref={ref} aria-labelledby="release-notes-title" className="usage-dialog max-w-lg" onClose={handleClose}>
|
||||
<div className="flex flex-col gap-5 p-6">
|
||||
<header className="flex flex-col gap-1">
|
||||
<p className="text-xs font-medium uppercase tracking-wider text-[var(--color-fg-muted)]">
|
||||
Version {RELEASE.version} – {RELEASE.title}
|
||||
</p>
|
||||
<h2 id="release-notes-title" className="text-xl font-semibold">Was ist neu?</h2>
|
||||
</header>
|
||||
<ul className="flex flex-col gap-3 text-sm">
|
||||
{RELEASE.notes[area].map((note) => (
|
||||
<li key={note} className="flex gap-3">
|
||||
<IconCheck aria-hidden="true" className="mt-0.5 shrink-0 text-[var(--color-success-fg)]" size={16} />
|
||||
<span>{note}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<div className="flex justify-end">
|
||||
<Button autoFocus onClick={() => ref.current?.close()} type="button">
|
||||
Verstanden
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user