Halte die gewaehlte Inhaltsliste beim Oeffnen und mache Typ sowie das Logo auf dunkler Flaeche aus der Lieferung erkennbar.
Deploy Development / deploy (push) Successful in 25s
Test Suite / pytest-backend (push) Successful in 56s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 8s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-17 15:50:05 +02:00
1 parent dc8a9c2db6
commit 97bffc6175
71 files changed
+572 -142

No files matched your search

+4 -13
View File
@@ -356,14 +356,6 @@ export function CaseDetail() {
}
}, [record, id, rawScope, overview, chapterId, params, setParams, navigate]);
useEffect(() => {
if (!record || record.id !== id || !entryId || overview) return;
const binding = (record.bindings || []).find((item) => item.id === entryId);
if (!binding) return;
const nextChapter = binding.chapter_id || "";
if ((chapterId || "") !== nextChapter) writeSelection(params, setParams, "direct", nextChapter);
}, [record, id, entryId, overview, chapterId, params, setParams]);
useEffect(() => {
if (entryId) return;
restoreScroll(listRef.current, `tsumugu-scroll:case:${id}:${chapterId}:${overview ? "over" : "direct"}`);
@@ -395,8 +387,6 @@ export function CaseDetail() {
const updated = new URLSearchParams(params);
updated.delete("bereich");
updated.set("eintrag", binding.id);
if (binding.chapter_id) updated.set("kapitel", binding.chapter_id);
else updated.delete("kapitel");
setParams(updated);
setView("contents");
}
@@ -536,10 +526,11 @@ export function CaseDetail() {
onOpen={openEntry}
onChange={load}
itemHref={(binding) => {
const search = new URLSearchParams();
const search = new URLSearchParams(params);
search.delete("bereich");
search.set("eintrag", binding.id);
if (binding.chapter_id) search.set("kapitel", binding.chapter_id);
return `/cases/${id}?${search}`;
const text = search.toString();
return text ? `/cases/${id}?${text}` : `/cases/${id}`;
}}
/>
) : null}
+9 -5
View File
@@ -14,6 +14,8 @@ export function Login() {
const [bootstrap, setBootstrap] = useState(undefined);
const [displayName, setDisplayName] = useState("");
const [pending, setPending] = useState(false);
const [introSettled, setIntroSettled] = useState(false);
const markMotion = pending ? "busy" : introSettled ? "none" : "intro";
useEffect(() => {
api("/api/v1/auth/demo")
@@ -26,6 +28,7 @@ export function Login() {
async function submit(event) {
event.preventDefault();
setIntroSettled(true);
setPending(true);
setError("");
try {
@@ -42,6 +45,7 @@ export function Login() {
async function createOperator(event) {
event.preventDefault();
setIntroSettled(true);
setPending(true);
setError("");
try {
@@ -62,12 +66,12 @@ export function Login() {
return (
<main className="login">
<section className="card login-card">
<p className="login-mark"><Mark size={72} /></p>
<p className="login-mark"><Mark size={96} motion={markMotion} onIntroComplete={() => setIntroSettled(true)} /></p>
<p className="eyebrow">Jinkendo</p>
<h1>Tsumugu</h1>
<p className="lead">Akten, Vorgänge und Fristen an einem Ort. Die erste Lieferung organisiert und verfolgt.</p>
{bootstrap === undefined ? null : bootstrap?.available ? (
<form onSubmit={createOperator} className="stack">
<form onSubmit={createOperator} className="stack" aria-busy={pending}>
<h2>Betreiberkonto</h2>
<p className="muted">Das erste Konto wird Betreiber und kann danach weitere Nutzer anlegen.</p>
<label>
@@ -83,10 +87,10 @@ export function Login() {
<input type="password" autoComplete="new-password" value={password} onChange={(event) => setPassword(event.target.value)} required minLength={10} />
</label>
{error ? <p className="error">{error}</p> : null}
<button type="submit" className="btn-full" disabled={pending}>{pending ? "Wird angelegt …" : "Betreiberkonto anlegen"}</button>
<button type="submit" className="btn-full" disabled={pending} aria-busy={pending}>{pending ? "Wird angelegt …" : "Betreiberkonto anlegen"}</button>
</form>
) : (
<form onSubmit={submit} className="stack">
<form onSubmit={submit} className="stack" aria-busy={pending}>
<label>
E-Mail
<input type="email" autoComplete="username" value={email} onChange={(event) => setEmail(event.target.value)} required />
@@ -96,7 +100,7 @@ export function Login() {
<input type="password" autoComplete="current-password" value={password} onChange={(event) => setPassword(event.target.value)} required />
</label>
{error ? <p className="error">{error}</p> : null}
<button type="submit" className="btn-full" disabled={pending}>{pending ? "Anmeldung …" : "Anmelden"}</button>
<button type="submit" className="btn-full" disabled={pending} aria-busy={pending}>{pending ? "Anmeldung …" : "Anmelden"}</button>
</form>
)}
{demo ? (
+3 -13
View File
@@ -280,14 +280,6 @@ export function MatterDetail() {
};
}, [inherited?.kind, inherited?.id]);
useEffect(() => {
if (!record || record.id !== id || !entryId) return;
const binding = (record.bindings || []).find((item) => item.id === entryId);
if (!binding) return;
const nextChapter = binding.chapter_id || "";
if ((chapterId || "") !== nextChapter) writeChapter(params, setParams, nextChapter);
}, [record, id, entryId, chapterId, params, setParams]);
useEffect(() => {
if (entryId) return;
restoreScroll(listRef.current, `tsumugu-scroll:${id}:${chapterId}`);
@@ -308,8 +300,6 @@ export function MatterDetail() {
rememberScroll(listRef.current, `tsumugu-scroll:${id}:${chapterId}`);
const updated = new URLSearchParams(params);
updated.set("eintrag", binding.id);
if (binding.chapter_id) updated.set("kapitel", binding.chapter_id);
else updated.delete("kapitel");
setParams(updated);
setView("contents");
}
@@ -462,10 +452,10 @@ export function MatterDetail() {
}}
onChange={load}
itemHref={(binding) => {
const search = new URLSearchParams(query.replace(/^\?/, ""));
const search = new URLSearchParams(params);
search.set("eintrag", binding.id);
if (binding.chapter_id) search.set("kapitel", binding.chapter_id);
return `/matters/${id}?${search}`;
const text = search.toString();
return text ? `/matters/${id}?${text}` : `/matters/${id}`;
}}
/>
) : null}
+36 -2
View File
@@ -32,6 +32,8 @@ export function Shell() {
const [query, setQuery] = useState("");
const [more, setMore] = useState(false);
const [width, setWidth] = useState(() => window.innerWidth);
const [markIntroDone, setMarkIntroDone] = useState(false);
const markMotion = markIntroDone ? "none" : "intro";
useEffect(() => {
const onResize = () => setWidth(window.innerWidth);
@@ -39,6 +41,34 @@ export function Shell() {
return () => window.removeEventListener("resize", onResize);
}, []);
// Desktop- und Mobilkopf teilen sich den Intro-Verbrauch. Wird die bisher
// verdeckte Darstellung sichtbar, setzt sie dieselbe Umdrehung fort.
useEffect(() => {
if (markIntroDone || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return undefined;
let carried = 0;
let frames = 0;
let frame = 0;
const tick = () => {
frames += 1;
for (const ring of document.querySelectorAll(".app-shell .jk-mark__ring")) {
if (ring.offsetParent === null) continue;
const anim = [...ring.getAnimations()].find((item) => item.animationName === "jk-enso-intro");
if (!anim || typeof anim.currentTime !== "number") continue;
if (carried - anim.currentTime > 48) anim.currentTime = carried;
carried = Math.max(carried, anim.currentTime);
}
if (carried >= 2400) {
setMarkIntroDone(true);
return;
}
const playing = document.querySelector(".app-shell .jk-mark--intro");
const waiting = document.querySelector('.app-shell .jk-mark[data-ready="false"]');
if ((playing || waiting) && frames < 1800) frame = requestAnimationFrame(tick);
};
frame = requestAnimationFrame(tick);
return () => cancelAnimationFrame(frame);
}, [markIntroDone]);
useEffect(() => {
setMore(false);
}, [location.pathname]);
@@ -70,7 +100,9 @@ export function Shell() {
<div className={`app-shell${compact ? " is-compact" : ""}`}>
<aside className="rail" aria-label="Hauptnavigation">
<div className="rail__brand">
<Mark />
<span className="jk-logo-frame" style={{ "--jk-frame-size": compact ? "40px" : "48px" }}>
<Mark motion={markMotion} onIntroComplete={() => setMarkIntroDone(true)} />
</span>
<span className="rail__name">Tsumugu</span>
</div>
<button
@@ -118,7 +150,9 @@ export function Shell() {
<div className="app-shell__column">
<header className="app-header mobile-only">
<NavLink to="/" className="app-logo" aria-label="Tsumugu">
<Mark size={28} />
<span className="jk-logo-frame jk-logo-frame--plain" style={{ "--jk-frame-size": "36px" }}>
<Mark size={28} motion={markMotion} onIntroComplete={() => setMarkIntroDone(true)} />
</span>
<span>Tsumugu</span>
</NavLink>
<form className="search" onSubmit={onSearch}>
+90 -70
View File
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState } from "react";
import { Link } from "react-router-dom";
import workerSrc from "pdfjs-dist/build/pdf.worker.min.mjs?url";
import { api, fetchFile, fetchPaperless } from "../api.js";
import { contentSourceSymbol, contentSymbol } from "../content-symbol.mjs";
import { Modal } from "./Modal.jsx";
import { ErrorNote } from "./widgets.jsx";
@@ -220,82 +220,89 @@ export function WorkSwitch({ view, onView }) {
);
}
const SYMBOL_LABEL = {
pdf: "PDF",
document: "Textdokument",
note: "Notiz",
email: "E-Mail",
image: "Bild",
audio: "Audio",
video: "Video",
spreadsheet: "Tabelle",
presentation: "Präsentation",
archive: "Archiv",
link: "Verweis",
attachment: "Anhang",
file: "Datei",
code: "Code",
};
function elementSymbol(element) {
if (element?.external?.source === "imap") return "email";
return contentSymbol(element || {});
}
function sourceLabel(element) {
if (element.kind === "note") return "Notiz";
if (element.kind === "external_ref") return element.external?.source === "paperless" ? "Paperless" : "Referenz";
if (element.file?.content_type === "application/pdf") return "PDF";
if (element.file?.content_type?.startsWith("image/")) return "Bild";
if (element.kind === "file") return "Datei";
return kindLabel(element.kind);
const type = SYMBOL_LABEL[elementSymbol(element)] || "Datei";
if (element.external?.source === "paperless") return `${type} · Paperless`;
if (element.external?.source === "imap") return "E-Mail";
if (element.kind === "external_ref" && type === "Verweis") return "Referenz";
return type;
}
function blurb(element) {
return element.summary || element.excerpt || "";
}
function PdfThumb({ url, title }) {
const canvasRef = useRef(null);
const [failed, setFailed] = useState(false);
useEffect(() => {
let alive = true;
let doc;
(async () => {
try {
const pdfjs = await import("pdfjs-dist");
pdfjs.GlobalWorkerOptions.workerSrc = workerSrc;
const bytes = await fetch(url).then((response) => response.arrayBuffer());
doc = await pdfjs.getDocument({ data: bytes }).promise;
const pdfPage = await doc.getPage(1);
if (!alive || !canvasRef.current) return;
const base = pdfPage.getViewport({ scale: 1 });
const viewport = pdfPage.getViewport({ scale: 148 / base.width });
const canvas = canvasRef.current;
canvas.width = viewport.width;
canvas.height = viewport.height;
await pdfPage.render({ canvasContext: canvas.getContext("2d"), viewport }).promise;
} catch {
if (alive) setFailed(true);
}
})();
return () => {
alive = false;
doc?.destroy?.();
};
}, [url]);
if (failed) return <span className="thumb thumb--empty">Vorschau nicht verfügbar</span>;
return <canvas ref={canvasRef} className="thumb thumb--pdf" aria-label={`Vorschau ${title}`} />;
function TypeGlyph({ name, tone, size = 28 }) {
return (
<img
className={tone === "dark" ? "type-glyph type-glyph--dark" : "type-glyph type-glyph--light"}
src={`/ui/content-symbols-v1/${tone}/${name}.svg`}
width={size}
height={size}
alt=""
/>
);
}
function Thumb({ element, context }) {
function EntryMark({ element, context }) {
const symbol = elementSymbol(element);
const photo = symbol === "image" && Boolean(element.preview?.available);
const [url, setUrl] = useState("");
const [media, setMedia] = useState("");
const [failed, setFailed] = useState(false);
useEffect(() => {
if (!element.preview?.available) return undefined;
if (!photo) return undefined;
let alive = true;
let current = "";
const load = element.preview.source === "paperless" ? fetchPaperless(element.id, context) : fetchFile(element.id, context);
load.then((blob) => {
if (!alive) return;
if (!alive || !blob.type.startsWith("image/")) return;
current = URL.createObjectURL(blob);
setUrl(current);
if (blob.type.startsWith("image/")) setMedia("image");
else if (blob.type.includes("pdf")) setMedia("pdf");
else setMedia("other");
}).catch(() => {
if (alive) setFailed(true);
if (alive) setUrl("");
});
return () => {
alive = false;
if (current) URL.revokeObjectURL(current);
};
}, [element.id, element.preview?.available, element.preview?.source, context?.kind, context?.id]);
if (element.kind === "note") return <span className="thumb thumb--note">Notiz</span>;
if (url && media === "image") return <img className="thumb" alt="" src={url} />;
if (url && media === "pdf") return <PdfThumb url={url} title={element.title} />;
if (failed) return <span className="thumb thumb--empty">Vorschau nicht verfügbar</span>;
if (element.preview?.available) return <span className="thumb thumb--empty">Vorschau wird geladen</span>;
return <span className="thumb thumb--empty">Keine Vorschau</span>;
}, [photo, element.id, element.preview?.source, context?.kind, context?.id]);
return (
<span className={url ? "entry-mark entry-mark--photo" : "entry-mark"}>
{url ? <img className="entry-mark__photo" alt="" src={url} /> : (
<>
<TypeGlyph name={symbol} tone="light" />
<TypeGlyph name={symbol} tone="dark" />
</>
)}
{url ? (
<span className="entry-mark__badge">
<TypeGlyph name="image" tone="light" size={14} />
<TypeGlyph name="image" tone="dark" size={14} />
</span>
) : null}
</span>
);
}
export async function saveChapterOrder({ containerKind, containerId, record, context, ids }) {
@@ -703,6 +710,7 @@ export function ContentBoard({
const movable = canMoveChapters && section.id !== "loose";
const fromIndex = chapters.findIndex((chapter) => chapter.id === draggingId);
const classes = ["content-section"];
if (!onlyChapter && section.title) classes.push("content-section--group");
if (draggingId === section.id) classes.push("is-dragging");
if (!expanded) classes.push("is-collapsed");
const insertBefore = indicator?.kind === "chapter" && fromIndex > indicator.index && chapterIndex === indicator.index;
@@ -721,7 +729,7 @@ export function ContentBoard({
draggable={movable && !pending}
onPointerDownCapture={(event) => {
if (!movable) return;
if (event.target.closest("input, textarea, select, a, label, .chapter-move")) return;
if (event.target.closest("input, textarea, select, a, label, .chapter-move, .chapter-date")) return;
beginDrag(event, { kind: "chapter", chapterId: section.id });
}}
onDragStart={(event) => {
@@ -742,25 +750,28 @@ export function ContentBoard({
</span>
) : null}
<h3 className="chapter-title">{section.title}</h3>
{section.documentOn ? <span className="muted">{formatDate(section.documentOn)}</span> : null}
{section.id !== "loose" ? (
<span className="chapter-date">
<span className="chapter-date__label">Kapiteldatum</span>
{canSort ? (
<input
type="date"
aria-label={`Kapiteldatum für ${section.title}`}
value={section.documentOn || ""}
disabled={pending}
onChange={(event) => saveChapterDate(section.id, event.target.value)}
/>
) : (
<span className="chapter-date__value">{section.documentOn ? formatDate(section.documentOn) : "ohne Datum"}</span>
)}
</span>
) : null}
{movable ? (
<span className="chapter-move">
<button type="button" className="quiet" aria-label={`${section.title} nach oben`} disabled={pending || chapters[0]?.id === section.id} onClick={() => moveChapter(section.id, -1)}>Nach oben</button>
<button type="button" className="quiet" aria-label={`${section.title} nach unten`} disabled={pending || chapters[chapters.length - 1]?.id === section.id} onClick={() => moveChapter(section.id, 1)}>Nach unten</button>
</span>
) : null}
{canSort && section.id !== "loose" ? (
<label className="chapter-date">
Datum
<input
type="date"
aria-label={`Datum für ${section.title}`}
value={section.documentOn || ""}
disabled={pending}
onChange={(event) => saveChapterDate(section.id, event.target.value)}
/>
</label>
) : null}
</div>
) : null}
{expanded && section.title && !section.items.length ? <p className="muted">Noch nichts in diesem Kapitel.</p> : null}
@@ -769,6 +780,7 @@ export function ContentBoard({
const element = binding.element;
const href = itemHref(binding);
const text = blurb(element);
const sourceSymbol = contentSourceSymbol(element);
return (
<li key={binding.id} data-binding={binding.id} className={`preview-row${draggingId === binding.id ? " is-dragging" : ""}${selectedId === binding.id ? " is-selected" : ""}`}>
{indicator?.sectionId === section.id && indicator?.kind !== "chapter" && indicator.index === index ? <div className="insert-line" /> : null}
@@ -791,7 +803,7 @@ export function ContentBoard({
<span className="handle__grip" aria-hidden="true" />
</button>
) : null}
<Thumb element={element} context={context} />
<EntryMark element={element} context={context} />
<Link
className="preview-row__main"
to={href}
@@ -803,7 +815,15 @@ export function ContentBoard({
}}
>
<strong>{element.title}</strong>
<span className="preview-row__meta">{formatDate(fachDate(element))} · {sourceLabel(element)}</span>
<span className="preview-row__meta">
{sourceSymbol ? (
<span className="source-mark">
<TypeGlyph name={sourceSymbol} tone="light" size={16} />
<TypeGlyph name={sourceSymbol} tone="dark" size={16} />
</span>
) : null}
{formatDate(fachDate(element))} · {sourceLabel(element)}
</span>
{text ? <span className="preview-row__text">{text}</span> : null}
{binding.origin ? <span className="preview-row__origin">{binding.origin}{binding.shared ? " · weitere Einbindung" : ""}</span> : null}
{!onlyChapter && !binding.origin && binding.chapter_id ? (
+10 -8
View File
@@ -1,3 +1,6 @@
import { JinkendoMark } from "../brand/JinkendoMark.jsx";
import "../brand/logo-frame.css";
const common = {
width: 22,
height: 22,
@@ -26,15 +29,14 @@ export function NavIcon({ name }) {
return <svg {...common}><circle cx="12" cy="12" r="8" /></svg>;
}
export function Mark({ size = 40 }) {
export function Mark({ size = 40, motion = "none", onIntroComplete, className = "" }) {
return (
<img
className="mark"
src="/brand/logo-original.png"
alt="Tsumugu"
width={280}
height={298}
style={{ height: size, width: "auto" }}
<JinkendoMark
product="tsumugu"
size={size}
motion={motion}
onIntroComplete={onIntroComplete}
className={className}
/>
);
}