Zeige den Vorgang in seiner Akte, ordne mehrere Aufgaben einer Frist zu und verwende Logo sowie Favicon aus der Lieferung.
Deploy Development / deploy (push) Successful in 27s
Test Suite / pytest-backend (push) Successful in 1m7s
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 14:57:48 +02:00
1 parent 448e9a06ff
commit dc8a9c2db6
41 files changed
+600 -390

No files matched your search

-1
View File
@@ -1 +0,0 @@
export const ENSO_PATH = "M 49.21 17.51 L 50.41 18.25 L 51.45 19.16 L 52.41 20.17 L 53.29 21.26 L 54.10 22.43 L 54.80 23.66 L 55.42 24.96 L 55.92 26.30 L 56.32 27.68 L 56.60 29.10 L 56.78 30.53 L 56.84 31.98 L 56.79 33.42 L 56.64 34.86 L 56.39 36.28 L 56.04 37.68 L 55.61 39.05 L 55.10 40.39 L 54.52 41.70 L 53.87 42.97 L 53.16 44.21 L 52.39 45.40 L 51.57 46.56 L 50.69 47.68 L 49.76 48.75 L 48.78 49.78 L 47.75 50.77 L 46.66 51.70 L 45.52 52.57 L 44.34 53.38 L 43.10 54.12 L 41.82 54.79 L 40.49 55.36 L 39.12 55.85 L 37.73 56.23 L 36.30 56.51 L 34.86 56.69 L 33.42 56.75 L 31.98 56.70 L 30.55 56.54 L 29.14 56.27 L 27.76 55.90 L 26.41 55.44 L 25.12 54.88 L 23.87 54.25 L 22.67 53.54 L 21.53 52.78 L 20.44 51.96 L 19.40 51.09 L 18.41 50.19 L 17.47 49.25 L 16.57 48.29 L 15.71 47.31 L 14.89 46.29 L 14.11 45.26 L 13.36 44.20 L 12.65 43.12 L 11.97 42.00 L 11.33 40.86 L 10.74 39.68 L 10.20 38.46 L 9.72 37.22 L 9.31 35.94 L 8.96 34.63 L 8.70 33.29 L 8.53 31.93 L 8.45 30.56 L 8.47 29.18 L 8.60 27.80 L 8.82 26.43 L 9.15 25.08 L 9.59 23.76 L 10.12 22.47 L 10.74 21.23 L 11.45 20.04 L 12.23 18.90 L 13.09 17.81 L 14.01 16.79 L 14.99 15.83 L 16.02 14.93 L 17.09 14.08 L 18.20 13.30 L 19.34 12.57 L 20.51 11.90 L 21.71 11.29 L 22.94 10.74 L 24.19 10.24 L 25.46 9.80 L 26.76 9.43 L 28.08 9.14 L 29.41 8.92 L 30.76 8.78 L 32.11 8.75 L 33.47 8.82 L 34.80 9.02 L 36.09 9.50 L 36.09 9.50 L 34.74 9.55 L 33.42 9.62 L 32.11 9.75 L 30.82 9.96 L 29.56 10.22 L 28.32 10.54 L 27.10 10.91 L 25.91 11.33 L 24.74 11.78 L 23.60 12.28 L 22.47 12.82 L 21.36 13.39 L 20.27 14.01 L 19.20 14.66 L 18.16 15.37 L 17.13 16.12 L 16.14 16.92 L 15.18 17.78 L 14.27 18.70 L 13.41 19.67 L 12.60 20.71 L 11.87 21.80 L 11.21 22.95 L 10.63 24.14 L 10.15 25.38 L 9.76 26.65 L 9.47 27.95 L 9.29 29.27 L 9.20 30.60 L 9.22 31.93 L 9.34 33.26 L 9.54 34.56 L 9.84 35.85 L 10.22 37.10 L 10.66 38.33 L 11.18 39.52 L 11.76 40.67 L 12.38 41.79 L 13.06 42.88 L 13.78 43.93 L 14.54 44.94 L 15.33 45.93 L 16.17 46.88 L 17.04 47.79 L 17.96 48.67 L 18.91 49.51 L 19.91 50.31 L 20.95 51.06 L 22.04 51.76 L 23.17 52.40 L 24.34 52.97 L 25.54 53.46 L 26.79 53.87 L 28.06 54.19 L 29.35 54.41 L 30.66 54.54 L 31.98 54.57 L 33.29 54.49 L 34.59 54.31 L 35.87 54.04 L 37.12 53.67 L 38.34 53.21 L 39.51 52.67 L 40.64 52.07 L 41.73 51.39 L 42.77 50.66 L 43.76 49.89 L 44.70 49.07 L 45.60 48.22 L 46.46 47.33 L 47.28 46.42 L 48.07 45.48 L 48.82 44.52 L 49.54 43.53 L 50.22 42.51 L 50.87 41.47 L 51.48 40.39 L 52.05 39.29 L 52.57 38.14 L 53.04 36.97 L 53.44 35.76 L 53.78 34.53 L 54.04 33.26 L 54.22 31.98 L 54.30 30.68 L 54.30 29.37 L 54.19 28.06 L 53.99 26.76 L 53.69 25.48 L 53.29 24.22 L 52.79 22.99 L 52.21 21.81 L 51.55 20.67 L 50.82 19.58 L 50.02 18.53 L 49.21 17.51 Z";
+6 -3
View File
@@ -454,6 +454,7 @@ export function CaseDetail() {
contextValue={id}
onContext={parentTree ? ((next) => { if (next !== id) navigate(`/cases/${next}`); }) : null}
nodes={caseNodes(record, parentTree)}
allLabel="Direkt in dieser Akte"
chapters={chapters}
chapterId={overview ? "" : chapterId}
allCount={(record.bindings || []).length}
@@ -473,7 +474,7 @@ export function CaseDetail() {
<ReadingPane
binding={entry}
context={context}
backLabel={activeChapter?.title || "Alle Inhalte"}
backLabel={activeChapter?.title || "Direkt in dieser Akte"}
onClose={closeEntry}
onReload={load}
canDetach={canEdit}
@@ -530,7 +531,8 @@ export function CaseDetail() {
containerId={id}
onlyChapter={chapterId}
selectedId={entryId}
listTitle={activeChapter ? activeChapter.title : "Alle Inhalte"}
listTitle={activeChapter ? activeChapter.title : "Direkt in dieser Akte"}
context={context}
onOpen={openEntry}
onChange={load}
itemHref={(binding) => {
@@ -567,6 +569,7 @@ export function CaseDetail() {
<AssignMatter caseId={id} onChange={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "add"} title={`Hinzufügen in ${targetLabel}`} onClose={() => setModal("")}>
<p className="muted">Dieser Inhalt liegt direkt in der Akte. Er erscheint unter „Direkt in dieser Akte“ und im Überblick, nicht in einem Vorgang.</p>
<TargetLine label={targetLabel} chapters={record.chapters} chapterId={activeChapter?.id || ""} />
<div className="add-choices">
<button type="button" onClick={() => setModal("chapter")}>Kapitel</button>
@@ -585,7 +588,7 @@ export function CaseDetail() {
<Modal open={modal === "paperless"} title="Aus Paperless" onClose={() => setModal("")}>
<PaperlessPicker context={context} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "mail"} title="E-Mail verbinden" wide onClose={() => setModal("")}>
<Modal open={modal === "mail"} title="E-Mail verbinden" wide split onClose={() => setModal("")}>
<MailPicker context={context} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "subcase"} title="Unterakte anlegen" onClose={() => setModal("")}>
+1 -1
View File
@@ -62,7 +62,7 @@ export function Login() {
return (
<main className="login">
<section className="card login-card">
<p className="login-mark" aria-hidden="true"><Mark size={72} /></p>
<p className="login-mark"><Mark size={72} /></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>
+80 -74
View File
@@ -139,8 +139,8 @@ function caseNodes(caseRecord, parentRecord, activeId, contextId) {
}];
}
function loneNodes(record, query) {
const current = {
function placementNodes(record) {
const matter = {
id: record.id,
title: record.title,
kind: record.kind_label || "Vorgang",
@@ -150,22 +150,32 @@ function loneNodes(record, query) {
id: item.id,
title: item.title,
kind: "Teilvorgang",
href: `/matters/${item.id}${query}`,
href: `/matters/${item.id}`,
current: false,
children: [],
})),
};
if (record.parent_matter_id && record.parent_title) {
return [{
id: record.parent_matter_id,
title: record.parent_title,
kind: "Vorgang",
href: `/matters/${record.parent_matter_id}${query}`,
const rooted = record.parent_matter_id && record.parent_title ? [{
id: record.parent_matter_id,
title: record.parent_title,
kind: "Vorgang",
href: `/matters/${record.parent_matter_id}`,
current: false,
children: [matter],
}] : [matter];
const cases = record.placements || [];
if (cases.length < 2) return rooted;
return [
...rooted,
...cases.map((item) => ({
id: item.case_id,
title: item.label.replaceAll("Unterakte ", "").replaceAll("Akte ", "").replaceAll(" → ", " / "),
kind: "Akte",
href: `/matters/${record.id}?context_kind=case&context_id=${item.case_id}`,
current: false,
children: [current],
}];
}
return [current];
children: [],
})),
];
}
function objectTrail(record, query) {
@@ -233,6 +243,16 @@ export function MatterDetail() {
}
}, [record, id, chapterId, params, setParams]);
useEffect(() => {
if (!record || record.id !== id || inherited?.kind === "case") return;
const placements = record.placements || [];
if (placements.length !== 1) return;
const next = new URLSearchParams(params);
next.set("context_kind", "case");
next.set("context_id", placements[0].case_id);
setParams(next, { replace: true });
}, [record, id, inherited?.kind]);
useEffect(() => {
if (inherited?.kind !== "case") {
setCaseTree(null);
@@ -343,7 +363,7 @@ export function MatterDetail() {
label: item.label.replaceAll("Unterakte ", "").replaceAll("Akte ", "").replaceAll(" → ", " / "),
}));
const contextValue = inherited?.kind === "case" ? inherited.id : (contexts.length === 1 ? contexts[0].id : "");
const nodes = caseTree ? caseNodes(caseTree, parentTree, id, inherited.id) : loneNodes(record, query);
const nodes = caseTree ? caseNodes(caseTree, parentTree, id, inherited.id) : placementNodes(record);
const links = [
...(record.cross_links || []).map((item) => ({
id: `cross-${item.id}`,
@@ -351,7 +371,7 @@ export function MatterDetail() {
kind: "Querverweis",
href: `/matters/${item.matter_id}${query}`,
})),
...(record.case_links || []).filter((item) => item.case_id !== inherited?.id).map((item) => ({
...(record.case_links || []).filter((item) => inherited?.kind === "case" && item.case_id !== inherited.id).map((item) => ({
id: `case-${item.id}`,
title: item.title,
kind: "Weitere Akte",
@@ -403,7 +423,7 @@ export function MatterDetail() {
>
<header className="workspace-head">
<div>
<Trail items={objectTrail(record, query)} />
<Trail items={record.trail?.length ? record.trail : objectTrail(record, query)} />
<Placements items={record.placements} />
<div className="title-row">
<h1>{record.title}</h1>
@@ -477,7 +497,7 @@ export function MatterDetail() {
) : null}
</Workspace>
<Modal open={modal === "work"} title="Aufgabe oder Frist" onClose={() => setModal("")}>
<WorkForms matterId={id} context={inherited} tasks={record.tasks} onChange={() => { setModal(""); load(); }} />
<WorkForms matterId={id} context={inherited} deadlines={record.deadlines || []} onChange={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "add"} title={`Hinzufügen in ${targetLabel}`} onClose={() => setModal("")}>
<TargetLine label={targetLabel} chapters={record.chapters} chapterId={activeChapter?.id || ""} />
@@ -498,7 +518,7 @@ export function MatterDetail() {
<Modal open={modal === "paperless"} title="Aus Paperless" onClose={() => setModal("")}>
<PaperlessPicker context={rightsContext} placement={placement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "mail"} title="E-Mail verbinden" wide onClose={() => setModal("")}>
<Modal open={modal === "mail"} title="E-Mail verbinden" wide split onClose={() => setModal("")}>
<MailPicker context={rightsContext} placement={placement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "submatter"} title="Teilvorgang anlegen" onClose={() => setModal("")}>
@@ -527,14 +547,35 @@ export function MatterDetail() {
);
}
function WorkForms({ matterId, context, tasks, onChange }) {
function WorkForms({ matterId, context, deadlines, onChange }) {
const [taskTitle, setTaskTitle] = useState("");
const [taskDue, setTaskDue] = useState("");
const [deadlineId, setDeadlineId] = useState("");
const [deadlineTitle, setDeadlineTitle] = useState("");
const [deadlineDue, setDeadlineDue] = useState("");
const [linkTask, setLinkTask] = useState("");
const [error, setError] = useState("");
async function addDeadline(event) {
event.preventDefault();
setError("");
try {
await api("/api/v1/deadlines", {
method: "POST",
body: {
title: deadlineTitle,
due_on: deadlineDue,
matter_id: matterId,
...(context ? { context } : {}),
},
});
setDeadlineTitle("");
setDeadlineDue("");
onChange();
} catch (err) {
setError(err.message);
}
}
async function addTask(event) {
event.preventDefault();
setError("");
@@ -548,53 +589,15 @@ function WorkForms({ matterId, context, tasks, onChange }) {
...(context ? { context } : {}),
},
});
if (linkTask === "new-deadline" && deadlineTitle && deadlineDue) {
const deadline = await api("/api/v1/deadlines", {
method: "POST",
body: {
title: deadlineTitle,
due_on: deadlineDue,
matter_id: matterId,
...(context ? { context } : {}),
},
});
if (deadlineId) {
await api(`/api/v1/tasks/${task.id}/deadline-links`, {
method: "POST",
body: { deadline_id: deadline.id, ...(context ? { context } : {}) },
body: { deadline_id: deadlineId, ...(context ? { context } : {}) },
});
setDeadlineTitle("");
setDeadlineDue("");
}
setTaskTitle("");
setTaskDue("");
setLinkTask("");
onChange();
} catch (err) {
setError(err.message);
}
}
async function addDeadline(event) {
event.preventDefault();
setError("");
try {
const deadline = await api("/api/v1/deadlines", {
method: "POST",
body: {
title: deadlineTitle,
due_on: deadlineDue,
matter_id: matterId,
...(context ? { context } : {}),
},
});
if (linkTask && linkTask !== "new-deadline") {
await api(`/api/v1/tasks/${linkTask}/deadline-links`, {
method: "POST",
body: { deadline_id: deadline.id, ...(context ? { context } : {}) },
});
}
setDeadlineTitle("");
setDeadlineDue("");
setDeadlineId("");
onChange();
} catch (err) {
setError(err.message);
@@ -603,23 +606,26 @@ function WorkForms({ matterId, context, tasks, onChange }) {
return (
<div className="forms">
<form onSubmit={addDeadline} className="stack compact">
<h3>Frist</h3>
<input value={deadlineTitle} onChange={(event) => setDeadlineTitle(event.target.value)} placeholder="Maßgeblicher Termin" required />
<label>Frist <input type="date" value={deadlineDue} onChange={(event) => setDeadlineDue(event.target.value)} required /></label>
<button type="submit">Frist erfassen</button>
</form>
<form onSubmit={addTask} className="stack compact">
<h3>Aufgabe</h3>
<input value={taskTitle} onChange={(event) => setTaskTitle(event.target.value)} placeholder="Was ist zu tun?" required />
<input value={taskTitle} onChange={(event) => setTaskTitle(event.target.value)} placeholder="Was ist vor der Frist zu tun?" required />
<label>Arbeitstermin <input type="date" value={taskDue} onChange={(event) => setTaskDue(event.target.value)} /></label>
<label>
Gehört zur Frist
<select value={deadlineId} onChange={(event) => setDeadlineId(event.target.value)}>
<option value="">Ohne Frist</option>
{deadlines.map((deadline) => (
<option key={deadline.id} value={deadline.id}>{deadline.title}</option>
))}
</select>
</label>
<button type="submit">Aufgabe anlegen</button>
</form>
<form onSubmit={addDeadline} className="stack compact">
<h3>Unabhängige Frist</h3>
<input value={deadlineTitle} onChange={(event) => setDeadlineTitle(event.target.value)} placeholder="Maßgebliche Frist" required />
<label>Frist <input type="date" value={deadlineDue} onChange={(event) => setDeadlineDue(event.target.value)} required /></label>
<select value={linkTask} onChange={(event) => setLinkTask(event.target.value)}>
<option value="">Nicht mit einer Aufgabe verknüpfen</option>
{tasks.map((task) => (
<option key={task.id} value={task.id}>{task.title}</option>
))}
</select>
<button type="submit">Frist erfassen</button>
<ErrorNote error={error} />
</form>
</div>
+2 -2
View File
@@ -1,7 +1,7 @@
import { useEffect, useRef } from "react";
import { isDirty, markDirty } from "../api.js";
export function Modal({ open, title, onClose, wide = false, children }) {
export function Modal({ open, title, onClose, wide = false, split = false, children }) {
const dialogRef = useRef(null);
const restoreRef = useRef(null);
@@ -33,7 +33,7 @@ export function Modal({ open, title, onClose, wide = false, children }) {
if (!open) return null;
return (
<div className="modal-overlay" onClick={(event) => { if (event.target === event.currentTarget) requestClose(); }}>
<div ref={dialogRef} className={wide ? "modal modal--wide" : "modal"} role="dialog" aria-modal="true" aria-label={title} tabIndex={-1}>
<div ref={dialogRef} className={`modal${wide ? " modal--wide" : ""}${split ? " modal--split" : ""}`} role="dialog" aria-modal="true" aria-label={title} tabIndex={-1}>
<header className="modal__bar">
<h2>{title}</h2>
<button type="button" className="quiet" onClick={requestClose}>Schließen</button>
+6 -2
View File
@@ -2,6 +2,7 @@ import { useEffect, useState } from "react";
import { Link } from "react-router-dom";
import { api } from "../api.js";
import { TargetLine, formatDate } from "./content.jsx";
import { NavIcon } from "./icons.jsx";
import { ErrorNote } from "./widgets.jsx";
export function Sources() {
@@ -231,9 +232,12 @@ function FolderBranch({ node, mailbox, expanded, onToggle, onSelect }) {
</button>
) : <span className="folder-twist" aria-hidden="true" />}
{node.selectable ? (
<button type="button" className="folder-name" aria-current={current ? "true" : undefined} onClick={() => onSelect(node.name)}>{node.label}</button>
<button type="button" className="folder-name" aria-current={current ? "true" : undefined} onClick={() => onSelect(node.name)}>
<NavIcon name="folder" />
<span>{node.label}</span>
</button>
) : (
<span className="folder-name">{node.label}</span>
<span className="folder-name"><NavIcon name="folder" /><span>{node.label}</span></span>
)}
</div>
{node.children.length && open ? (
+169 -34
View File
@@ -165,11 +165,9 @@ function sectionsOf(chapters, bindings) {
}
export function matterOpenHref(item) {
const contexts = item?.contexts || [];
if (contexts.some((entry) => entry.kind === "direct")) return `/matters/${item.id}`;
const context = contexts.find((entry) => entry.kind === "case");
if (!context) return `/matters/${item.id}`;
return `/matters/${item.id}?context_kind=case&context_id=${context.id}`;
const cases = (item?.contexts || []).filter((entry) => entry.kind === "case");
if (cases.length === 1) return `/matters/${item.id}?context_kind=case&context_id=${cases[0].id}`;
return `/matters/${item.id}`;
}
export function Placements({ items }) {
@@ -346,7 +344,25 @@ export function ContentBoard({
const visibleSections = onlyChapter ? sections.filter((section) => section.id === onlyChapter) : sections;
const shownCount = onlyChapter ? (visibleSections[0]?.items.length || 0) : source.length;
const canSort = sortable && record?.rights?.edit;
const canEdit = Boolean(record?.rights?.edit);
const canDestroy = Boolean(record?.is_owner);
const canMoveChapters = Boolean(canSort && chapters.length > 1);
async function removeBinding(binding, everywhere) {
const element = binding.element;
if (everywhere) {
if (!window.confirm("Überall löschen? Alle Einbindungen verschwinden. Eine Paperless-Quelle bleibt unangetastet.")) return;
await api(`/api/v1/elements/${element.id}/delete`, { method: "POST", body: { expected_version: element.version } });
} else {
if (!window.confirm("Aus diesem Zusammenhang entfernen? Die Unterlage bleibt an anderen Stellen erhalten.")) return;
const action = context || (containerKind === "case" ? { kind: "case", id: containerId } : { kind: "matter", id: containerId });
const search = new URLSearchParams();
search.set("context_kind", action.kind);
search.set("context_id", action.id);
await api(`/api/v1/bindings/${binding.id}?${search}`, { method: "DELETE" });
}
onChange();
}
const orderPath = `/api/v1/${containerKind === "case" ? "cases" : "matters"}/${containerId}`;
const orderContext = context && containerKind === "matter" ? { context } : {};
@@ -794,8 +810,15 @@ export function ContentBoard({
<span className="preview-row__origin">Kapitel {(chapters.find((chapter) => chapter.id === binding.chapter_id)?.title) || ""}</span>
) : null}
</Link>
{(canSort && custom) || (canSort && chapters.length) ? (
{(canEdit || (canSort && custom) || (canSort && chapters.length)) ? (
<div className="preview-row__actions">
{canEdit ? (
<details className="row-menu">
<summary>Entfernen</summary>
<button type="button" onClick={() => removeBinding(binding, false)}>Aus diesem Zusammenhang entfernen</button>
{canDestroy ? <button type="button" className="danger" onClick={() => removeBinding(binding, true)}>Überall löschen</button> : null}
</details>
) : null}
{canSort && custom ? (
<details className="row-menu">
<summary>Reihenfolge</summary>
@@ -940,8 +963,27 @@ export function AuditLog({ items, nextCursor, onMore }) {
);
}
function contentChoices(record) {
const rows = [...(record?.bindings || [])];
for (const group of record?.contained || []) rows.push(...(group.bindings || []));
const seen = new Set();
return rows.flatMap((binding) => {
const element = binding.element;
if (!element?.id || seen.has(element.id)) return [];
seen.add(element.id);
return [{ id: element.id, title: element.title }];
});
}
function taskContextBody(task, context) {
const taskContext = task.action_context || context;
return taskContext ? { context: taskContext } : {};
}
export function WorkLists({ record, context, onChange }) {
const linked = new Set((record.task_deadline_links || []).map((item) => item.task_id));
const links = record.task_deadline_links || [];
const tasks = record.tasks || [];
const elements = contentChoices(record);
async function complete(task) {
const body = { expected_version: task.version, status: "done" };
@@ -958,42 +1000,135 @@ export function WorkLists({ record, context, onChange }) {
onChange();
}
const tasksFor = (deadlineId) => tasks.filter((task) => links.some((link) => link.deadline_id === deadlineId && link.task_id === task.id));
const linkedIds = new Set(links.map((link) => link.task_id));
const loose = tasks.filter((task) => !linkedIds.has(task.id));
async function assign(task, deadline) {
await api(`/api/v1/tasks/${task.id}/deadline-links`, {
method: "POST",
body: { deadline_id: deadline.id, ...taskContextBody(task, context) },
});
onChange();
}
return (
<div className="stack">
<p className="muted">Erledigen und Erfüllen bleiben getrennte Aktionen.</p>
<div>
<h3>Aufgaben</h3>
{record.tasks?.length ? (
<ul className="work">
{record.tasks.map((task) => (
<li key={task.id}>
<div>
<strong>{task.title}</strong>
<span>{task.status === "done" ? "Erledigt" : "Offen"}{task.due_on ? ` · ${formatDate(task.due_on)}` : ""}{task.matter_title ? ` · ${task.matter_title}` : ""}</span>
{linked.has(task.id) ? <small>Mit einer Frist verknüpft, ohne sie zu erfüllen.</small> : null}
</div>
{task.status === "open" && task.rights?.edit !== false ? <button type="button" onClick={() => complete(task)}>Erledigen</button> : null}
</li>
))}
</ul>
) : <p className="muted">Keine Aufgabe.</p>}
</div>
<p className="muted">Eine Frist ist der maßgebliche Termin. Mehrere Aufgaben können davor liegen. Erledigen einer Aufgabe erfüllt die Frist nicht.</p>
<div>
<h3>Fristen</h3>
{record.deadlines?.length ? (
<ul className="work">
{record.deadlines.map((deadline) => (
<li key={deadline.id}>
<div>
<strong>{deadline.title}</strong>
<span>{deadline.status === "fulfilled" ? "Erfüllt" : "Offen"} · {formatDate(deadline.due_on)}{deadline.matter_title ? ` · ${deadline.matter_title}` : ""}</span>
</div>
{deadline.status === "open" ? <button type="button" onClick={() => fulfill(deadline)}>Frist erfüllen</button> : null}
</li>
))}
{record.deadlines.map((deadline) => {
const assigned = tasksFor(deadline.id);
const available = tasks.filter((task) => !assigned.some((item) => item.id === task.id));
return (
<li key={deadline.id}>
<div>
<strong>{deadline.title}</strong>
<span>{deadline.status === "fulfilled" ? "Erfüllt" : "Offen"} · {formatDate(deadline.due_on)}{deadline.matter_title ? ` · ${deadline.matter_title}` : ""}</span>
{assigned.length ? (
<ul className="task-under">
{assigned.map((task) => (
<TaskRow key={task.id} task={task} tasks={tasks} elements={elements} context={context} onComplete={complete} onChange={onChange} />
))}
</ul>
) : <small>Noch keine Aufgabe vor dieser Frist.</small>}
{available.length ? (
<label className="task-assign">
Aufgabe zuordnen
<select value="" onChange={(event) => { const task = available.find((item) => item.id === event.target.value); if (task) assign(task, deadline); }}>
<option value="">Auswählen</option>
{available.map((task) => <option key={task.id} value={task.id}>{task.title}</option>)}
</select>
</label>
) : null}
</div>
{deadline.status === "open" ? <button type="button" onClick={() => fulfill(deadline)}>Frist erfüllen</button> : null}
</li>
);
})}
</ul>
) : <p className="muted">Keine Frist.</p>}
</div>
<div>
<h3>Aufgaben ohne Frist</h3>
{loose.length ? (
<ul className="work">
{loose.map((task) => (
<li key={task.id}>
<TaskRow task={task} tasks={tasks} elements={elements} context={context} onComplete={complete} onChange={onChange} />
</li>
))}
</ul>
) : <p className="muted">Keine Aufgabe ohne Frist.</p>}
</div>
</div>
);
}
function TaskRow({ task, tasks, elements, context, onComplete, onChange }) {
const [elementIds, setElementIds] = useState((task.elements || []).map((item) => item.id));
const [dependsOn, setDependsOn] = useState("");
const others = tasks.filter((item) => item.id !== task.id);
async function saveElements(next) {
setElementIds(next);
await api(`/api/v1/tasks/${task.id}/elements`, {
method: "PUT",
body: { element_ids: next, ...taskContextBody(task, context) },
});
onChange();
}
async function addDependency(event) {
const id = event.target.value;
setDependsOn("");
if (!id) return;
await api(`/api/v1/tasks/${task.id}/dependencies`, {
method: "POST",
body: { depends_on_task_id: id, ...taskContextBody(task, context) },
});
onChange();
}
return (
<div className="task-row">
<div>
<strong>{task.title}</strong>
<span>{task.status === "done" ? "Erledigt" : "Offen"}{task.due_on ? ` · Arbeitstermin ${formatDate(task.due_on)}` : ""}</span>
{(task.depends_on || []).length ? <small>Hängt ab von {task.depends_on.map((item) => item.title).join(", ")}.</small> : null}
{(task.elements || []).length ? <small>Bezieht sich auf {task.elements.map((item) => item.title).join(", ")}.</small> : null}
</div>
{task.status === "open" && task.rights?.edit !== false ? <button type="button" onClick={() => onComplete(task)}>Erledigen</button> : null}
{task.rights?.edit !== false ? (
<details className="row-menu">
<summary>Bezüge</summary>
<label>
Hängt ab von
<select value={dependsOn} onChange={addDependency}>
<option value="">Aufgabe wählen</option>
{others.map((item) => <option key={item.id} value={item.id}>{item.title}</option>)}
</select>
</label>
<fieldset className="task-elements">
<legend>Inhalte</legend>
{elements.length ? elements.map((element) => (
<label key={element.id}>
<input
type="checkbox"
checked={elementIds.includes(element.id)}
onChange={(event) => {
const next = event.target.checked ? [...elementIds, element.id] : elementIds.filter((id) => id !== element.id);
saveElements(next);
}}
/>
{element.title}
</label>
)) : <span>In diesem Objekt liegt noch kein Inhalt.</span>}
</fieldset>
</details>
) : null}
</div>
);
}
+9 -9
View File
@@ -26,15 +26,15 @@ export function NavIcon({ name }) {
return <svg {...common}><circle cx="12" cy="12" r="8" /></svg>;
}
import { ENSO_PATH } from "../enso-path.js";
export function Mark({ size = 36 }) {
export function Mark({ size = 40 }) {
return (
<svg className="mark" width={size} height={size} viewBox="0 0 64 64" aria-hidden="true">
<path fill="currentColor" d={ENSO_PATH} />
<path fill="currentColor" opacity="0.72" d="M37.2 25.2h11.2v13.2h-1.8V27.4H38.6z" />
<path fill="currentColor" d="M22.8 29.2h8.8l1.7 2.2h10.2V44H22.8z" />
<path fill="currentColor" opacity="0.45" d="M26.2 34.2h6.4v1.3h-6.4zm0 2.8h4.5v1.3h-4.5z" />
</svg>
<img
className="mark"
src="/brand/logo-original.png"
alt="Tsumugu"
width={280}
height={298}
style={{ height: size, width: "auto" }}
/>
);
}
+41 -38
View File
@@ -95,6 +95,7 @@ export function StructureNavigator({
chapters = [],
chapterId = "",
allCount = 0,
allLabel = "Alle Inhalte",
overview = null,
chapterHeading,
onChapter,
@@ -116,6 +117,7 @@ export function StructureNavigator({
</button>
) : null}
</div>
<div className="structure__tree">
<label className="context-select">
Aktenkontext
<select
@@ -130,44 +132,6 @@ export function StructureNavigator({
</select>
</label>
<TreeNodes nodes={nodes} onNavigate={onNavigate} />
<div className="structure__chapters">
<h3>{chapterHeading}</h3>
{overview ? (
<button type="button" className={overview.active ? "chapter-link is-current" : "chapter-link"} onClick={overview.onSelect}>
<span>Überblick</span>
<span className="count">{overview.count}</span>
</button>
) : null}
<button type="button" className={!chapterId && !overview?.active ? "chapter-link is-current" : "chapter-link"} onClick={() => onChapter("")}>
<span>Alle Inhalte</span>
<span className="count">{allCount}</span>
</button>
<ul className="chapter-links">
{chapters.map((chapter, index) => (
<li key={chapter.id}>
<button
type="button"
className={chapterId === chapter.id ? "chapter-link is-current" : "chapter-link"}
onClick={() => onChapter(chapter.id)}
>
<span>{chapter.title}</span>
<span className="count">{chapter.count}</span>
</button>
{canReorder && chapterId === chapter.id ? (
<span className="chapter-link__move">
<button type="button" aria-label={`${chapter.title} nach oben`} disabled={index === 0} onClick={() => onMoveChapter(chapter.id, -1)}>Nach oben</button>
<button type="button" aria-label={`${chapter.title} nach unten`} disabled={index === chapters.length - 1} onClick={() => onMoveChapter(chapter.id, 1)}>Nach unten</button>
</span>
) : null}
</li>
))}
</ul>
{canAddChapter ? (
<button type="button" className="quiet chapter-add" onClick={onAddChapter}>
<NavIcon name="plus" /> Kapitel
</button>
) : null}
</div>
{links.length ? (
<div className="structure__links">
<h3>Weitere Zuordnungen</h3>
@@ -186,6 +150,45 @@ export function StructureNavigator({
</ul>
</div>
) : null}
</div>
<div className="structure__chapters">
<h3>{chapterHeading}</h3>
{overview ? (
<button type="button" className={overview.active ? "chapter-link is-current" : "chapter-link"} onClick={overview.onSelect}>
<span>Überblick</span>
<span className="count">{overview.count}</span>
</button>
) : null}
<button type="button" className={!chapterId && !overview?.active ? "chapter-link is-current" : "chapter-link"} onClick={() => onChapter("")}>
<span>{allLabel}</span>
<span className="count">{allCount}</span>
</button>
<ul className="chapter-links">
{chapters.map((chapter, index) => (
<li key={chapter.id}>
<button
type="button"
className={chapterId === chapter.id ? "chapter-link is-current" : "chapter-link"}
onClick={() => onChapter(chapter.id)}
>
<span>{chapter.title}</span>
<span className="count">{chapter.count}</span>
</button>
{canReorder ? (
<span className="chapter-link__move">
<button type="button" aria-label={`${chapter.title} nach oben`} disabled={index === 0} onClick={() => onMoveChapter(chapter.id, -1)}>↑</button>
<button type="button" aria-label={`${chapter.title} nach unten`} disabled={index === chapters.length - 1} onClick={() => onMoveChapter(chapter.id, 1)}>↓</button>
</span>
) : null}
</li>
))}
</ul>
{canAddChapter ? (
<button type="button" className="quiet chapter-add" onClick={onAddChapter}>
<NavIcon name="plus" /> Kapitel
</button>
) : null}
</div>
</nav>
);
}
+46 -18
View File
@@ -461,12 +461,13 @@ label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(-
.content-section.is-chapter-target { box-shadow: inset 0 3px 0 var(--accent); }
.content-section.is-chapter-after { box-shadow: inset 0 -3px 0 var(--accent); }
.folder-tree, .folder-tree ul { list-style: none; margin: 0; padding: 0; }
.folder-tree ul { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--border); }
.folder-row { display: flex; align-items: center; gap: 2px; min-height: 32px; border-radius: 6px; }
.folder-tree ul { margin-left: 11px; padding-left: 8px; border-left: 1px solid var(--border); }
.folder-row { display: flex; align-items: center; gap: 0; min-height: 28px; border-radius: 4px; }
.folder-row.is-current { background: var(--accent-light); }
.folder-twist, .folder-name { background: transparent; border: 0; color: inherit; min-height: 32px; padding: 0; }
.folder-twist { width: 28px; }
.folder-name { flex: 1; text-align: left; padding: 4px 8px; font: inherit; font-weight: 600; cursor: pointer; }
.folder-twist, .folder-name { background: transparent; border: 0; color: inherit; min-height: 28px; padding: 0; }
.folder-twist { width: 22px; flex: none; }
.folder-name { flex: 1; display: flex; align-items: center; gap: 6px; text-align: left; padding: 2px 6px; font: inherit; font-weight: 500; cursor: pointer; min-width: 0; }
.folder-name svg { width: 16px; height: 16px; flex: none; }
.order-choice { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; max-width: 36rem; font-size: 14px; }
.order-choice select { width: auto; min-width: 16rem; flex: 1; }
.target-line { margin: 0; color: var(--text2); overflow-wrap: break-word; }
@@ -600,9 +601,18 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
.menu-list button { width: 100%; justify-content: flex-start; }
.placements { margin: 4px 0 0; overflow-wrap: anywhere; }
.reader-preview { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); }
.mailbox { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 16px; align-items: stretch; min-height: 420px; }
.mailbox__folders { border-right: 1px solid var(--border); padding-right: 8px; max-height: 60vh; overflow: auto; }
.mailbox { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 12px; align-items: stretch; min-height: 0; }
.mailbox__folders { border-right: 1px solid var(--border); padding-right: 8px; overflow: auto; min-height: 0; }
.mailbox__folders { display: block; }
.modal.modal--split {
height: min(86vh, 760px);
overflow: hidden;
display: flex;
flex-direction: column;
}
.modal.modal--split > .stack { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.modal.modal--split .mailbox { flex: 1; overflow: hidden; }
.mailbox__messages { min-height: 0; overflow: auto; align-content: start; }
.mailbox__group { min-height: 32px; display: flex; align-items: center; color: var(--text3); font-size: 13px; font-weight: 650; }
.mailbox__messages { display: grid; gap: 10px; min-width: 0; }
.mail-list { display: grid; }
@@ -643,8 +653,8 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
.outline__body { display: none; }
.outline.is-open .outline__body { display: block; }
.outline__toggle { display: inline-flex; margin-bottom: 8px; }
.mailbox { grid-template-columns: 1fr; min-height: 0; }
.mailbox__folders { display: block; max-height: 240px; overflow: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 8px; }
.mailbox { grid-template-columns: 1fr; grid-template-rows: minmax(140px, 34%) minmax(0, 1fr); min-height: 0; }
.mailbox__folders { display: block; max-height: none; overflow: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 8px; }
}
@media (prefers-color-scheme: dark) {
@@ -735,7 +745,13 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
}
.rail__user-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail__logout { margin-left: auto; color: #d7efe4; background: transparent; }
.mark { display: block; }
.mark {
display: block;
flex: none;
width: auto;
object-fit: contain;
aspect-ratio: 280 / 298;
}
.app-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); text-decoration: none; }
.app-main:has(.workspace) {
@@ -758,6 +774,7 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
.workspace.is-structure,
.workspace.is-reader-focus { grid-template-columns: minmax(0, 1fr); }
.workspace-nav, .workspace-main, .workspace-reader { min-width: 0; min-height: 0; overflow: auto; }
.workspace-nav { display: flex; flex-direction: column; overflow: hidden; }
.workspace-nav { background: #f7f6f1; border-right: 1px solid var(--border); }
.workspace-nav.is-overlay {
position: absolute;
@@ -801,7 +818,10 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
border-bottom: 2px solid transparent;
}
.surface-tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--accent); }
.structure { display: grid; align-content: start; gap: 14px; padding: 16px 14px 24px; }
.structure { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 10px 12px; overflow: hidden; }
.structure__tree, .structure__chapters { min-height: 0; overflow: auto; }
.structure__tree { flex: 1 1 46%; }
.structure__chapters { flex: 1 1 54%; border-top: 1px solid var(--border); padding-top: 8px; }
.structure__bar, .structure h2 { display: flex; align-items: center; justify-content: space-between; margin: 0; font-size: 20px; }
.structure h3 { margin: 8px 0 4px; font-size: 13px; color: var(--text2); font-weight: 700; }
.context-select select { background: #fff; }
@@ -809,21 +829,29 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
.nav-tree ul { margin: 0; padding: 0 0 0 14px; }
.nav-tree__link, .chapter-link {
display: flex;
align-items: flex-start;
align-items: center;
gap: 8px;
width: 100%;
min-height: 44px;
padding: 8px 10px;
min-height: 32px;
padding: 4px 8px;
border: 0;
border-radius: 12px;
border-radius: 6px;
background: transparent;
color: inherit;
text-align: left;
text-decoration: none;
font-weight: 600;
}
.nav-tree__link > span { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.nav-tree__link.is-current, .chapter-link.is-current { background: var(--accent-light); color: var(--brand); }
.nav-tree__kind { display: block; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text3); font-weight: 700; }
.nav-tree__kind { font-size: 11px; color: var(--text3); font-weight: 700; flex: none; }
.chapter-links { margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--border); }
.chapter-links li { display: flex; align-items: center; gap: 2px; }
.chapter-links li .chapter-link { flex: 1; }
.task-under { margin: 6px 0 0; padding-left: 14px; border-left: 1px solid var(--border); display: grid; gap: 8px; }
.task-row, .task-assign { display: grid; gap: 4px; }
.task-elements { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
.task-elements label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.nav-tree__title, .chapter-link span:first-child, .preview-row__main strong, h1 { overflow-wrap: anywhere; }
.chapter-link { justify-content: space-between; align-items: center; }
.count {
@@ -833,8 +861,8 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
font-size: 13px;
font-weight: 650;
}
.chapter-link__move { display: flex; gap: 6px; padding: 0 8px 8px; }
.chapter-link__move button { min-height: 36px; padding: 4px 8px; font-size: 13px; }
.chapter-link__move { display: flex; gap: 2px; flex: none; }
.chapter-link__move button { min-height: 28px; min-width: 28px; padding: 0 6px; font-size: 14px; }
.chapter-add { justify-content: flex-start; }
.content-toolbar { align-items: center; margin-bottom: 12px; }
.content-toolbar h2 { font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--text1); }