Verkuerze die Inhaltsliste und fuehre Unterkapitel ein, damit Richtung, Bezuge und Struktur ohne Zusatzzeilen bedienbar bleiben.
Deploy Development / deploy (push) Successful in 29s
Test Suite / pytest-backend (push) Successful in 1m24s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 9s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-17 21:13:21 +02:00
1 parent eeeb81148a
commit e4380261fc
30 files changed
+2384 -430

No files matched your search

+4
View File
@@ -6,6 +6,10 @@ const SYMBOL_REV = {
"dark/communication-in": "96DD8CF1D6B0",
"light/communication-out": "700E710A12CB",
"dark/communication-out": "761536F9818E",
"light/communication-local": "6FD92AEECE11",
"dark/communication-local": "2E1EF315DFE5",
"light/communication-unspecified": "759AF850BB6C",
"dark/communication-unspecified": "541E3CFE050C",
};
export function symbolUrl(tone, name) {
+33
View File
@@ -0,0 +1,33 @@
/** Readable name from a single mailbox address. Chains stay in the reader. */
export function partyLabel(raw) {
const value = String(raw || "").split(/[;,]/)[0].trim();
if (!value) return "";
const named = value.match(/^\s*"?([^"<]+?)"?\s*</);
if (named && named[1].trim()) return named[1].trim();
const address = value.match(/([A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,})/i);
if (address) return address[1].split("@")[0].replace(/[._]+/g, " ");
return value.replace(/^["']|["']$/g, "");
}
/** Counterpart shown in the compact metadata line. */
export function counterpartLabel(element, direction) {
if (element?.external?.source !== "imap") return "";
const detail = element.external.detail || {};
const from = partyLabel(detail.message_from);
const to = partyLabel(detail.message_to);
if (direction === "out") return to;
if (direction === "in") return from;
return from || to;
}
export function directionSymbol(direction) {
if (direction === "out") return "communication-out";
if (direction === "in") return "communication-in";
if (direction === "local") return "communication-local";
return "communication-unspecified";
}
/** Count only counterparts already disclosed as readable in this context. */
export function bezugCount(element) {
return (element?.refers_to?.length || 0) + (element?.referred_by?.length || 0);
}
+38
View File
@@ -0,0 +1,38 @@
import assert from "node:assert/strict";
import test from "node:test";
import { bezugCount, counterpartLabel, directionSymbol, partyLabel } from "./list-meta.mjs";
test("party names stay short and ignore address chains", () => {
assert.equal(partyLabel("Karin Vogel <karin.vogel@example.org>"), "Karin Vogel");
assert.equal(partyLabel('"Kanzlei Beispiel" <kanzlei@example.org>, Ablage <ablage@example.org>'), "Kanzlei Beispiel");
assert.equal(partyLabel("ablage@example.org"), "ablage");
});
test("incoming mail shows the sender and outgoing mail the recipient", () => {
const element = {
external: {
source: "imap",
detail: {
message_from: "Karin Vogel <karin.vogel@example.org>",
message_to: "Kanzlei Beispiel <kanzlei@example.org>",
},
},
};
assert.equal(counterpartLabel(element, "in"), "Karin Vogel");
assert.equal(counterpartLabel(element, "out"), "Kanzlei Beispiel");
assert.equal(counterpartLabel({ kind: "note" }, "local"), "");
});
test("direction symbols distinguish local, unspecified and the triangles", () => {
assert.equal(directionSymbol("in"), "communication-in");
assert.equal(directionSymbol("out"), "communication-out");
assert.equal(directionSymbol("local"), "communication-local");
assert.equal(directionSymbol(""), "communication-unspecified");
assert.equal(directionSymbol(null), "communication-unspecified");
});
test("bezug counts only readable disclosed counterparts", () => {
assert.equal(bezugCount({ refers_to: [{ id: "a" }], referred_by: [{ id: "b" }, { id: "c" }] }), 3);
assert.equal(bezugCount({}), 0);
assert.equal(bezugCount(null), 0);
});
+42 -23
View File
@@ -2,13 +2,14 @@ import { useContext, useEffect, useRef, useState } from "react";
import { Link, useNavigate, useParams, useSearchParams } from "react-router-dom";
import { api, markDirty, textToDocument } from "../api.js";
import { SessionContext } from "../session.js";
import { chapterPathLabel, siblingChapterIds, trailWithChapter } from "./chapters.js";
import { Modal } from "./Modal.jsx";
import { MailPicker, PaperlessPicker } from "./Sources.jsx";
import { ErrorNote, ShareBox } from "./widgets.jsx";
import { ContentBoard, DirectionChoice, MarkdownEditor, ObjectMenu, OrderChoice, RecordTree, SurfaceView, TargetLine, Trail, WorkLists, WorkSwitch, saveChapterOrder, writeSelection } from "./content.jsx";
import { ReadingPane } from "./ReadingPane.jsx";
import { StructureNavigator, Workspace, rememberScroll, restoreScroll, useWorkspaceLayout } from "./workspace.jsx";
import { IconButton, NavIcon } from "./icons.jsx";
import { NavIcon } from "./icons.jsx";
export function CaseList() {
const { session } = useContext(SessionContext);
@@ -202,8 +203,8 @@ function matterOrigin(group) {
}
function chapterOrigin(base, chapters, chapterId) {
const title = (chapters || []).find((chapter) => chapter.id === chapterId)?.title;
return title ? `${base} · Kapitel ${title}` : base;
const path = chapterPathLabel(chapters, chapterId);
return path ? `${base} · ${path}` : base;
}
function mergedCaseItems(record, direction, caseId) {
@@ -295,6 +296,7 @@ export function CaseDetail() {
const [parentTree, setParentTree] = useState(null);
const [error, setError] = useState("");
const [modal, setModal] = useState("");
const [chapterParentId, setChapterParentId] = useState("");
const [view, setView] = useState("contents");
const [dateDir, setDateDir] = useState("asc");
const { width, structureOpen, setStructureOpen } = useWorkspaceLayout();
@@ -434,8 +436,13 @@ export function CaseDetail() {
setParams(updated, { replace: true });
}
function openChapter(parentId = "") {
setChapterParentId(parentId || "");
setModal("chapter");
}
async function moveChapter(chapterIdToMove, delta) {
const ids = (record?.chapters || []).map((chapter) => chapter.id);
const ids = siblingChapterIds(record?.chapters || [], chapterIdToMove);
const index = ids.indexOf(chapterIdToMove);
const target = index + delta;
if (!record || index < 0 || target < 0 || target >= ids.length) return;
@@ -488,7 +495,8 @@ export function CaseDetail() {
overview={hasContained ? { active: overview, count: merged.length, onSelect: showOverview } : null}
chapterHeading={`Kapitel in ${record.title}`}
onChapter={chooseChapter}
onAddChapter={canEdit ? () => setModal("chapter") : null}
onAddChapter={canEdit ? () => openChapter(chapterId) : null}
onAddRootChapter={canEdit ? () => openChapter("") : null}
canAddChapter={canEdit}
onMoveChapter={moveChapter}
canReorder={canEdit && chapters.length > 1}
@@ -515,17 +523,10 @@ export function CaseDetail() {
>
<header className="workspace-head">
<div>
<Trail items={record.trail} />
<Trail items={trailWithChapter(record.trail, record.chapters, overview ? "" : chapterId, `/cases/${id}`)} />
<div className="title-row">
<h1>{record.title}</h1>
<span className={record.status === "open" ? "status-pill" : "status-pill is-closed"}>{record.status === "open" ? "Offen" : "Geschlossen"}</span>
{record.rights.edit ? (
<span className="record-tools">
<IconButton name="pencil" label="Umbenennen" onClick={renameCase} />
<IconButton name={record.status === "closed" ? "restore" : "archive"} label={record.status === "closed" ? "Wieder öffnen" : "Archivieren"} onClick={archiveCase} />
<IconButton name="trash" label="Löschen" onClick={deleteCase} />
</span>
) : null}
</div>
</div>
<div className="page-actions">
@@ -536,6 +537,9 @@ export function CaseDetail() {
</button>
) : null}
<ObjectMenu view={view} onView={setView}>
{record.rights.edit ? <button type="button" className="quiet" onClick={renameCase}>Umbenennen</button> : null}
{record.rights.edit ? <button type="button" className="quiet" onClick={archiveCase}>{record.status === "closed" ? "Wieder öffnen" : "Archivieren"}</button> : null}
{record.rights.edit ? <button type="button" className="danger" onClick={deleteCase}>Löschen</button> : null}
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("matter")}>Vorgang anlegen und zuordnen</button> : null}
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("assign")}>Vorhandenen Vorgang zuordnen</button> : null}
{record.rights.edit ? <button type="button" className="quiet" onClick={() => setModal("subcase")}>Unterakte anlegen</button> : null}
@@ -569,7 +573,8 @@ export function CaseDetail() {
containerId={id}
onlyChapter={chapterId}
selectedId={entryId}
listTitle={activeChapter ? activeChapter.title : "Direkt in dieser Akte"}
listTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : "Direkt in dieser Akte"}
onAddSubchapter={canEdit ? openChapter : null}
context={context}
onOpen={openEntry}
onChange={load}
@@ -611,7 +616,8 @@ export function CaseDetail() {
<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>
<button type="button" onClick={() => openChapter(activeChapter?.id || "")}>{activeChapter ? "Unterkapitel" : "Kapitel"}</button>
{activeChapter ? <button type="button" onClick={() => openChapter("")}>Kapitel auf oberster Ebene</button> : null}
<button type="button" onClick={() => setModal("note")}>Notiz</button>
<button type="button" onClick={() => setModal("file")}>Datei</button>
<button type="button" onClick={() => setModal("paperless")}>Paperless</button>
@@ -625,17 +631,19 @@ export function CaseDetail() {
<FileForm context={context} chapters={record.chapters} initialChapter={activeChapter?.id || ""} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "paperless"} title="Aus Paperless" onClose={() => setModal("")}>
<PaperlessPicker context={context} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
<PaperlessPicker context={context} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<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(); }} />
<MailPicker context={context} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "subcase"} title="Unterakte anlegen" onClose={() => setModal("")}>
<NewSubcase parentId={id} onChange={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "chapter"} title={`Kapitel in ${targetLabel} hinzufügen`} onClose={() => setModal("")}>
<Modal open={modal === "chapter"} title={chapterParentId ? `Unterkapitel in ${targetLabel}` : `Kapitel in ${targetLabel}`} onClose={() => setModal("")}>
<ChapterForm
path={`/api/v1/cases/${id}/chapters`}
targetLabel={targetLabel}
parentChapter={chapterParentId ? { id: chapterParentId, title: chapterPathLabel(record.chapters, chapterParentId) } : null}
onChange={(created) => {
setModal("");
if (created?.id) {
@@ -802,11 +810,11 @@ function caseTrail(record, caseId, group, scope, chapter) {
href: chapter ? `/cases/${caseId}?bereich=${group.matter_id}` : null,
});
}
if (chapter && (group || scope === "direct")) items.push({ label: `Kapitel ${chapter.title}`, href: null });
if (chapter && (group || scope === "direct")) items.push({ label: chapter.title, href: null });
return items;
}
export function ChapterForm({ path, onChange }) {
export function ChapterForm({ path, onChange, targetLabel = "", parentChapter = null }) {
const [title, setTitle] = useState("");
const [dated, setDated] = useState("");
const [error, setError] = useState("");
@@ -815,7 +823,14 @@ export function ChapterForm({ path, onChange }) {
event.preventDefault();
setError("");
try {
const created = await api(path, { method: "POST", body: { title, ...(dated ? { document_on: dated } : {}) } });
const created = await api(path, {
method: "POST",
body: {
title,
...(dated ? { document_on: dated } : {}),
...(parentChapter?.id ? { parent_chapter_id: parentChapter.id } : {}),
},
});
setTitle("");
setDated("");
onChange(created);
@@ -826,7 +841,11 @@ export function ChapterForm({ path, onChange }) {
return (
<form onSubmit={submit} className="stack compact">
<label>Titel <input value={title} onChange={(event) => setTitle(event.target.value)} placeholder="Kapitel" required /></label>
{targetLabel ? <p className="target-line">Ziel: <strong>{targetLabel}</strong></p> : null}
<p className="target-line">
{parentChapter ? <>Elternkapitel: <strong>{parentChapter.title}</strong></> : <>Ebene: <strong>oberste Kapitel</strong></>}
</p>
<label>Titel <input value={title} onChange={(event) => setTitle(event.target.value)} placeholder={parentChapter ? "Unterkapitel" : "Kapitel"} required /></label>
<label>Fachliches Datum, optional <input type="date" value={dated} onChange={(event) => setDated(event.target.value)} /></label>
<button type="submit">Hinzufügen</button>
<ErrorNote error={error} />
@@ -852,7 +871,7 @@ function chapterSelect(chapters, value, setValue) {
<select value={value} onChange={(event) => setValue(event.target.value)}>
<option value="">Ohne Kapitel</option>
{chapters.map((chapter) => (
<option key={chapter.id} value={chapter.id}>{chapter.title}</option>
<option key={chapter.id} value={chapter.id}>{chapterPathLabel(chapters, chapter.id)}</option>
))}
</select>
</label>
+26 -18
View File
@@ -5,11 +5,12 @@ import { SessionContext } from "../session.js";
import { Modal } from "./Modal.jsx";
import { MailPicker, PaperlessPicker } from "./Sources.jsx";
import { ErrorNote, ShareBox } from "./widgets.jsx";
import { chapterPathLabel, siblingChapterIds, trailWithChapter } from "./chapters.js";
import { ChapterForm, FileForm, NoteForm } from "./Cases.jsx";
import { ContentBoard, ObjectMenu, Placements, RecordTree, SurfaceView, TargetLine, Trail, WorkLists, WorkSwitch, matterOpenHref, saveChapterOrder, writeChapter } from "./content.jsx";
import { ReadingPane } from "./ReadingPane.jsx";
import { StructureNavigator, Workspace, rememberScroll, restoreScroll, useWorkspaceLayout } from "./workspace.jsx";
import { IconButton, NavIcon } from "./icons.jsx";
import { NavIcon } from "./icons.jsx";
import { ExportPackage } from "./ExportPackage.jsx";
function pageContext(params) {
@@ -197,6 +198,7 @@ export function MatterDetail() {
const [record, setRecord] = useState(null);
const [error, setError] = useState("");
const [modal, setModal] = useState("");
const [chapterParentId, setChapterParentId] = useState("");
const rightsContext = inherited || { kind: "matter", id };
const placement = inherited?.kind === "case" ? { kind: "matter", id } : null;
const [view, setView] = useState("contents");
@@ -367,8 +369,13 @@ export function MatterDetail() {
setStructureOpen(false);
}
function openChapter(parentId = "") {
setChapterParentId(parentId || "");
setModal("chapter");
}
async function moveChapter(chapterIdToMove, delta) {
const ids = (record?.chapters || []).map((chapter) => chapter.id);
const ids = siblingChapterIds(record?.chapters || [], chapterIdToMove);
const index = ids.indexOf(chapterIdToMove);
const target = index + delta;
if (!record || index < 0 || target < 0 || target >= ids.length) return;
@@ -435,7 +442,8 @@ export function MatterDetail() {
allCount={(record.bindings || []).length}
chapterHeading={`Kapitel in ${record.title}`}
onChapter={chooseChapter}
onAddChapter={canEdit ? () => setModal("chapter") : null}
onAddChapter={canEdit ? () => openChapter(chapterId) : null}
onAddRootChapter={canEdit ? () => openChapter("") : null}
canAddChapter={canEdit}
onMoveChapter={moveChapter}
canReorder={canEdit && chapters.length > 1}
@@ -462,30 +470,26 @@ export function MatterDetail() {
>
<header className="workspace-head">
<div>
<Trail items={record.trail?.length ? record.trail : objectTrail(record, query)} />
<Trail items={trailWithChapter(record.trail?.length ? record.trail : objectTrail(record, query), record.chapters, chapterId, `/matters/${id}${query}`)} />
<Placements items={record.placements} />
<div className="title-row">
<h1>{record.title}</h1>
<span className={record.status === "open" ? "status-pill" : "status-pill is-closed"}>{record.status === "open" ? "Offen" : "Geschlossen"}</span>
{canEdit ? (
<span className="record-tools">
<IconButton name="pencil" label="Umbenennen" onClick={renameMatter} />
<IconButton name={record.status === "closed" ? "restore" : "archive"} label={record.status === "closed" ? "Wieder öffnen" : "Archivieren"} onClick={archiveMatter} />
<IconButton name="move" label="Verschieben" onClick={() => setModal("move")} />
<IconButton name="trash" label="Löschen" onClick={deleteMatter} />
</span>
) : null}
</div>
</div>
<div className="page-actions">
{width < 1500 ? <button type="button" className="quiet" onClick={() => setStructureOpen(true)}>Struktur</button> : null}
<button type="button" className="quiet" onClick={() => setModal("export")}>Übergabepaket</button>
{canEdit ? (
<button type="button" className="desktop-add" onClick={() => setModal("add")}>
<NavIcon name="plus" /> Inhalt hinzufügen
</button>
) : null}
<ObjectMenu view={view} onView={setView}>
<button type="button" className="quiet" onClick={() => setModal("export")}>Übergabepaket</button>
{canEdit ? <button type="button" className="quiet" onClick={renameMatter}>Umbenennen</button> : null}
{canEdit ? <button type="button" className="quiet" onClick={archiveMatter}>{record.status === "closed" ? "Wieder öffnen" : "Archivieren"}</button> : null}
{canEdit ? <button type="button" className="quiet" onClick={() => setModal("move")}>Verschieben</button> : null}
{canEdit ? <button type="button" className="danger" onClick={deleteMatter}>Löschen</button> : null}
{canEdit ? <button type="button" className="quiet" onClick={() => setModal("submatter")}>Teilvorgang anlegen</button> : null}
{canEdit ? <button type="button" className="quiet" onClick={() => setModal("cross")}>Querverweis</button> : null}
{record.rights.share || record.is_owner ? <button type="button" className="quiet" onClick={() => setModal("share")}>Teilen</button> : null}
@@ -503,7 +507,8 @@ export function MatterDetail() {
containerId={id}
onlyChapter={chapterId}
selectedId={entryId}
listTitle={activeChapter ? activeChapter.title : "Alle Inhalte"}
listTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : "Alle Inhalte"}
onAddSubchapter={canEdit ? openChapter : null}
onOpen={(binding) => {
rememberScroll(listRef.current, scrollKey);
openEntry(binding);
@@ -553,7 +558,8 @@ export function MatterDetail() {
<Modal open={modal === "add"} title={`Hinzufügen in ${targetLabel}`} onClose={() => setModal("")}>
<TargetLine label={targetLabel} chapters={record.chapters} chapterId={activeChapter?.id || ""} />
<div className="add-choices">
<button type="button" onClick={() => setModal("chapter")}>Kapitel</button>
<button type="button" onClick={() => openChapter(activeChapter?.id || "")}>{activeChapter ? "Unterkapitel" : "Kapitel"}</button>
{activeChapter ? <button type="button" onClick={() => openChapter("")}>Kapitel auf oberster Ebene</button> : null}
<button type="button" onClick={() => setModal("note")}>Notiz</button>
<button type="button" onClick={() => setModal("file")}>Datei</button>
<button type="button" onClick={() => setModal("paperless")}>Paperless</button>
@@ -567,10 +573,10 @@ export function MatterDetail() {
<FileForm context={rightsContext} placement={placement} chapters={record.chapters} initialChapter={activeChapter?.id || ""} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
</Modal>
<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(); }} />
<PaperlessPicker context={rightsContext} placement={placement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<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(); }} />
<MailPicker context={rightsContext} placement={placement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "submatter"} title="Teilvorgang anlegen" onClose={() => setModal("")}>
<SubmatterForm parentId={id} context={inherited} onChange={() => { setModal(""); load(); }} />
@@ -578,9 +584,11 @@ export function MatterDetail() {
<Modal open={modal === "cross"} title="Querverweis" onClose={() => setModal("")}>
<CrossLinkForm matterId={id} context={inherited} onChange={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "chapter"} title={`Kapitel in ${targetLabel} hinzufügen`} onClose={() => setModal("")}>
<Modal open={modal === "chapter"} title={chapterParentId ? `Unterkapitel in ${targetLabel}` : `Kapitel in ${targetLabel}`} onClose={() => setModal("")}>
<ChapterForm
path={`/api/v1/matters/${id}/chapters${inherited ? `?context_kind=${inherited.kind}&context_id=${inherited.id}` : ""}`}
targetLabel={targetLabel}
parentChapter={chapterParentId ? { id: chapterParentId, title: chapterPathLabel(record.chapters, chapterParentId) } : null}
onChange={(created) => {
setModal("");
if (created?.id) {
+20 -10
View File
@@ -1,4 +1,4 @@
import { useContext, useEffect, useState } from "react";
import { useContext, useEffect, useRef, useState } from "react";
import { NavLink, Outlet, useLocation, useNavigate } from "react-router-dom";
import { SessionContext } from "../session.js";
import { Mark, NavIcon } from "./icons.jsx";
@@ -30,6 +30,8 @@ export function Shell() {
}
});
const [query, setQuery] = useState("");
const [searchOpen, setSearchOpen] = useState(false);
const searchRef = useRef(null);
const [more, setMore] = useState(false);
const [width, setWidth] = useState(() => window.innerWidth);
const [markIntroDone, setMarkIntroDone] = useState(false);
@@ -149,15 +151,23 @@ export function Shell() {
</aside>
<div className="app-shell__column">
<header className="app-header mobile-only">
<NavLink to="/" className="app-logo" aria-label="Tsumugu">
<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}>
<input value={query} onChange={(event) => setQuery(event.target.value)} placeholder="Suchen" aria-label="Suchen" />
</form>
<div className="app-header__bar">
<NavLink to="/" className="app-logo" aria-label="Tsumugu">
<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>
<button type="button" className="icon-button" aria-label="Suchen" aria-expanded={searchOpen} onClick={() => setSearchOpen((value) => !value)}>
<NavIcon name="search" />
</button>
</div>
{searchOpen ? (
<form className="search" onSubmit={onSearch}>
<input ref={searchRef} value={query} onChange={(event) => setQuery(event.target.value)} placeholder="Suchen" aria-label="Suchen" autoFocus />
<button type="button" className="quiet" onClick={() => setSearchOpen(false)}>Schließen</button>
</form>
) : null}
</header>
<div className="app-main">
<Outlet />
+82
View File
@@ -0,0 +1,82 @@
export function chapterPath(chapters, chapterId) {
const byId = new Map((chapters || []).map((chapter) => [chapter.id, chapter]));
const names = [];
const seen = new Set();
let current = byId.get(chapterId);
while (current && !seen.has(current.id)) {
seen.add(current.id);
names.unshift(current.title);
current = current.parent_chapter_id ? byId.get(current.parent_chapter_id) : null;
}
return names;
}
export function chapterPathLabel(chapters, chapterId) {
return chapterPath(chapters, chapterId).join(" / ");
}
export function siblingChapterIds(chapters, chapterId) {
const current = (chapters || []).find((chapter) => chapter.id === chapterId);
const parent = current?.parent_chapter_id || null;
return (chapters || [])
.filter((chapter) => (chapter.parent_chapter_id || null) === parent)
.map((chapter) => chapter.id);
}
export function descendantChapterIds(chapters, chapterId) {
const children = (chapters || []).filter((chapter) => chapter.parent_chapter_id === chapterId);
return children.flatMap((chapter) => [chapter.id, ...descendantChapterIds(chapters, chapter.id)]);
}
export function buildChapterSections(chapters, bindings) {
const buckets = new Map();
const loose = [];
const known = new Set((chapters || []).map((chapter) => chapter.id));
for (const binding of bindings || []) {
if (binding.chapter_id && known.has(binding.chapter_id)) {
const list = buckets.get(binding.chapter_id) || [];
list.push(binding);
buckets.set(binding.chapter_id, list);
} else {
loose.push(binding);
}
}
const nodes = new Map();
for (const chapter of chapters || []) {
nodes.set(chapter.id, {
id: chapter.id,
title: chapter.title,
documentOn: chapter.document_on || "",
parentId: chapter.parent_chapter_id || "",
items: buckets.get(chapter.id) || [],
children: [],
});
}
const roots = [];
for (const chapter of chapters || []) {
const node = nodes.get(chapter.id);
const parent = chapter.parent_chapter_id ? nodes.get(chapter.parent_chapter_id) : null;
if (parent) parent.children.push(node);
else roots.push(node);
}
return { roots, loose };
}
export function trailWithChapter(items, chapters, chapterId, backHref) {
if (!chapterId) return items;
const path = chapterPath(chapters, chapterId);
if (!path.length) return items || [];
const base = (items || []).map((item, index, all) => (
index === all.length - 1 && !item.href ? { ...item, href: backHref } : item
));
return [...base, { label: path.join(" / "), href: null }];
}
export function findSection(nodes, id) {
for (const node of nodes || []) {
if (node.id === id) return node;
const found = findSection(node.children, id);
if (found) return found;
}
return null;
}
File diff suppressed because it is too large. Load diff
+89 -23
View File
@@ -1,5 +1,6 @@
import { useEffect, useState } from "react";
import { Link } from "react-router-dom";
import { chapterPathLabel } from "./chapters.js";
import { NavIcon } from "./icons.jsx";
export function useWorkspaceLayout() {
@@ -53,7 +54,7 @@ export function Workspace({ width, structureOpen, setStructureOpen, hasEntry, na
function structureIcon(kind) {
if (kind === "Akte" || kind === "Unterakte") return "folder";
if (kind === "Kapitel") return "chapter";
if (kind === "Kapitel" || kind === "Unterkapitel") return "chapter";
if (kind === "Inhalte") return "contents";
if (kind === "Querverweis" || kind === "Weitere Akte") return "link";
return "layers";
@@ -64,11 +65,18 @@ function branchHasCurrent(node) {
return (node.children || []).some(branchHasCurrent);
}
function TreeRow({ node, onNavigate, ancestor = false }) {
function TreeRow({ node, onNavigate, ancestor = false, toggle = null }) {
const className = node.current ? "nav-tree__link is-current" : ancestor ? "nav-tree__link is-ancestor" : "nav-tree__link";
const icon = <NavIcon name={structureIcon(node.kind)} />;
const label = <span className="nav-tree__title">{node.title}</span>;
const name = `${node.kind}: ${node.title}`;
const name = node.path ? `${node.kind}: ${node.path}` : `${node.kind}: ${node.title}`;
const label = (
<span className="nav-tree__title">
{node.title}
{node.kind === "Kapitel" || node.kind === "Unterkapitel" || node.kind === "Teilvorgang" ? (
<span className="nav-tree__kind">{node.kind}</span>
) : null}
</span>
);
let row;
if (node.onSelect) {
row = (
@@ -92,29 +100,46 @@ function TreeRow({ node, onNavigate, ancestor = false }) {
</span>
);
}
if (node.moveUp === undefined && node.moveDown === undefined) return row;
const moves = node.moveUp !== undefined || node.moveDown !== undefined ? (
<span className="chapter-link__move">
<button type="button" aria-label={`${node.title} nach oben`} disabled={!node.moveUp} onClick={node.moveUp}>↑</button>
<button type="button" aria-label={`${node.title} nach unten`} disabled={!node.moveDown} onClick={node.moveDown}>↓</button>
</span>
) : null;
return (
<div className="nav-tree__line">
{toggle}
{row}
<span className="chapter-link__move">
<button type="button" aria-label={`${node.title} nach oben`} disabled={!node.moveUp} onClick={node.moveUp}>↑</button>
<button type="button" aria-label={`${node.title} nach unten`} disabled={!node.moveDown} onClick={node.moveDown}>↓</button>
</span>
{moves}
</div>
);
}
function TreeNodes({ nodes, onNavigate, unfold = false }) {
function TreeNodes({ nodes, onNavigate, unfold = false, isOpen, onToggle }) {
if (!nodes?.length) return null;
return (
<ul className="nav-tree">
{nodes.map((node) => {
const open = unfold || node.current || branchHasCurrent(node);
const hasChildren = Boolean(node.children?.length);
const open = hasChildren && isOpen(node, unfold);
const toggle = hasChildren ? (
<button
type="button"
className="nav-tree__toggle"
aria-expanded={open}
aria-label={open ? `${node.title} einklappen` : `${node.title} ausklappen`}
onClick={() => onToggle(node, open)}
>
{open ? "▾" : "▸"}
</button>
) : (
<span className="nav-tree__toggle is-empty" aria-hidden="true" />
);
return (
<li key={node.id}>
<TreeRow node={node} onNavigate={onNavigate} ancestor={!node.current && branchHasCurrent(node)} />
{open && node.children?.length ? (
<TreeNodes nodes={node.children} onNavigate={onNavigate} unfold={unfold || node.current} />
<TreeRow node={node} onNavigate={onNavigate} ancestor={!node.current && branchHasCurrent(node)} toggle={toggle} />
{open ? (
<TreeNodes nodes={node.children} onNavigate={onNavigate} unfold={unfold || node.current} isOpen={isOpen} onToggle={onToggle} />
) : null}
</li>
);
@@ -141,19 +166,29 @@ function scopeContents({ chapters, chapterId, allLabel, overview, onChapter, can
current: !chapterId && !overview?.active,
onSelect: () => onChapter?.(""),
});
chapters.forEach((chapter, index) => {
items.push({
const byParent = new Map();
chapters.forEach((chapter) => {
const key = chapter.parent_chapter_id || "";
const list = byParent.get(key) || [];
list.push(chapter);
byParent.set(key, list);
});
function chapterNodes(parentId) {
return (byParent.get(parentId) || []).map((chapter, index, siblings) => ({
id: chapter.id,
title: chapter.title,
kind: "Kapitel",
path: chapterPathLabel(chapters, chapter.id),
kind: parentId ? "Unterkapitel" : "Kapitel",
current: chapterId === chapter.id,
onSelect: () => onChapter?.(chapter.id),
children: chapterNodes(chapter.id),
...(canReorder ? {
moveUp: index > 0 ? () => onMoveChapter(chapter.id, -1) : null,
moveDown: index < chapters.length - 1 ? () => onMoveChapter(chapter.id, 1) : null,
moveDown: index < siblings.length - 1 ? () => onMoveChapter(chapter.id, 1) : null,
} : {}),
});
});
}));
}
items.push(...chapterNodes(""));
return items;
}
@@ -179,6 +214,7 @@ export function StructureNavigator({
overview = null,
onChapter,
onAddChapter,
onAddRootChapter,
canAddChapter = false,
onMoveChapter,
canReorder = false,
@@ -186,7 +222,32 @@ export function StructureNavigator({
onNavigate,
onClose,
}) {
const [opened, setOpened] = useState(() => new Set());
const [closed, setClosed] = useState(() => new Set());
const tree = treeWithScope(nodes, scopeContents({ chapters, chapterId, allLabel, overview, onChapter, canReorder, onMoveChapter }));
function isOpen(node, unfold) {
if (!node.children?.length) return false;
if (closed.has(node.id)) return false;
if (opened.has(node.id) || unfold || node.current || branchHasCurrent(node)) return true;
return false;
}
function toggle(node, currently) {
setOpened((current) => {
const next = new Set(current);
if (currently) next.delete(node.id);
else next.add(node.id);
return next;
});
setClosed((current) => {
const next = new Set(current);
if (currently) next.add(node.id);
else next.delete(node.id);
return next;
});
}
return (
<nav className="structure" aria-label="Struktur">
<div className="structure__bar">
@@ -198,16 +259,21 @@ export function StructureNavigator({
) : null}
</div>
<div className="structure__tree">
<TreeNodes nodes={tree} onNavigate={onNavigate} />
<TreeNodes nodes={tree} onNavigate={onNavigate} isOpen={isOpen} onToggle={toggle} />
{links.length ? (
<div className="structure__links">
<h3>Weitere Zuordnungen</h3>
<TreeNodes nodes={links} onNavigate={onNavigate} unfold />
<TreeNodes nodes={links} onNavigate={onNavigate} unfold isOpen={() => true} onToggle={() => {}} />
</div>
) : null}
{canAddChapter ? (
<button type="button" className="quiet chapter-add" onClick={onAddChapter}>
<NavIcon name="plus" /> Kapitel
<NavIcon name="plus" /> {chapterId ? "Unterkapitel" : "Kapitel"}
</button>
) : null}
{canAddChapter && chapterId && onAddRootChapter ? (
<button type="button" className="quiet chapter-add" onClick={onAddRootChapter}>
<NavIcon name="plus" /> Kapitel auf oberster Ebene
</button>
) : null}
</div>
+212 -77
View File
@@ -496,7 +496,7 @@ label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(-
.content-row__title { font-weight: 650; }
.content-row__kind { color: var(--text3); font-size: 13px; }
.content-row__move { display: flex; gap: 4px; }
.chapter-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.chapter-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 0 0 2px; padding: 0; border: 0; border-radius: 0; background: transparent; min-height: 32px; }
.chapter-head.is-movable { cursor: grab; touch-action: none; user-select: none; }
.chapter-head.is-movable:active { cursor: grabbing; }
.chapter-head.is-movable .chapter-date,
@@ -508,15 +508,30 @@ label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(-
.icon-button--compact:hover, .icon-button--compact:focus-visible { background: var(--surface2); color: var(--text1); }
.direction-choice { flex: 0 0 auto; }
.direction-choice select { width: auto; min-width: 7.5rem; min-height: 32px; height: 32px; padding: 0 8px; font-size: 13px; }
.direction-column { flex: 0 0 36px; width: 36px; height: 40px; display: grid; place-items: center; }
.direction-column__icon { width: 28px; height: 28px; display: block; }
.direction-column__icon--dark { display: none; }
.direction-column { flex: none; width: auto; height: auto; min-height: 0; display: grid; place-items: center; }
.direction-trigger, .preview-row__menu {
width: 36px;
min-width: 36px;
height: 36px;
min-height: 36px;
padding: 0;
border-radius: 8px;
background: transparent;
color: var(--text2);
font-size: 18px;
line-height: 1;
}
.direction-trigger:hover, .direction-trigger:focus-visible, .preview-row__menu:hover, .preview-row__menu:focus-visible { background: var(--surface2); color: var(--text1); }
.direction-column__icon { width: 26px; height: 26px; display: block; }
.direction-column__icon.direction-column__icon--local { width: 12px; height: 12px; }
.direction-column__icon--dark, .bezug-trigger__icon--dark { display: none; }
@media (prefers-color-scheme: dark) {
.direction-column__icon--light { display: none; }
.direction-column__icon--dark { display: block; }
.direction-column__icon--light, .bezug-trigger__icon--light { display: none; }
.direction-column__icon--dark, .bezug-trigger__icon--dark { display: block; }
}
@media (max-width: 720px) {
.direction-column__icon { width: 24px; height: 24px; }
.direction-trigger, .preview-row__menu { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
.bezug-trigger { width: auto; min-height: 28px; height: 28px; }
}
.markdown-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.markdown-editor__preview { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 8rem; overflow: auto; }
@@ -530,7 +545,7 @@ label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(-
.chapter-date__label { font-weight: 700; color: var(--text3); }
.chapter-date__value { font-variant-numeric: tabular-nums; }
.chapter-date input { width: auto; }
.content-section--group { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border2); }
.content-section--group { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--border2); }
.contents > .content-section--group:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.content-section.is-dragging { opacity: 0.45; }
.content-section.is-chapter-target { box-shadow: inset 0 3px 0 var(--accent); }
@@ -592,33 +607,133 @@ label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(-
button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; font-weight: 600; cursor: pointer; }
.preview-list { list-style: none; margin: 0; padding: 0; }
.preview-row {
display: flex;
flex-wrap: wrap;
gap: 14px;
align-items: flex-start;
padding: 14px 0;
display: grid;
grid-template-columns: auto auto minmax(0, 1fr) auto;
column-gap: 8px;
align-items: start;
padding: 5px 0 6px;
border: 0;
border-top: 1px solid var(--border);
border-radius: 0;
position: relative;
min-width: 0;
background: transparent;
}
.preview-row--ordered, .preview-row--picking { grid-template-columns: auto auto auto minmax(0, 1fr) auto; }
.preview-row--ordered.preview-row--picking { grid-template-columns: auto auto auto auto minmax(0, 1fr) auto; }
.preview-row > .insert-line { grid-column: 1 / -1; }
.preview-row.is-dragging { opacity: 0.4; }
.preview-row__main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 18rem; color: inherit; text-decoration: none; }
.preview-row__main strong { font-size: 16px; line-height: 1.35; overflow-wrap: break-word; }
.preview-row__meta, .preview-row__origin { color: var(--text2); font-size: 13px; overflow-wrap: break-word; }
.preview-row__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.source-mark { display: inline-flex; width: 16px; height: 16px; flex: none; }
.preview-row__actions { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; align-items: center; }
.preview-row__text {
color: var(--text);
.preview-row__body { display: grid; gap: 2px; min-width: 0; }
.preview-row__title, .preview-row__text { color: inherit; text-decoration: none; min-width: 0; }
.preview-row__title strong, .preview-row__main strong {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
font-size: 16px;
line-height: 1.3;
font-weight: 650;
overflow-wrap: anywhere;
}
.preview-row__meta, .preview-row__origin { color: var(--text2); font-size: 13px; line-height: 1.3; overflow-wrap: break-word; }
.preview-row__meta { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; }
.preview-row__facts { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-mark { display: inline-flex; width: 16px; height: 16px; flex: none; }
.preview-row__actions { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; align-items: center; }
.preview-row__text {
color: var(--text2);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
font-size: 14px;
line-height: 1.35;
}
.bezug-trigger {
position: relative;
display: inline-flex;
align-items: center;
gap: 4px;
flex: none;
width: auto;
min-height: 28px;
height: 28px;
padding: 0 8px;
border: 1px solid var(--border2);
border-radius: 999px;
background: transparent;
color: var(--brand);
font-size: 13px;
font-weight: 650;
}
.bezug-trigger::after { content: ""; position: absolute; inset: -8px; }
.bezug-trigger__icon { width: 16px; height: 16px; display: block; }
.menu-popover__backdrop {
position: fixed;
inset: 0;
z-index: 40;
width: 100%;
min-height: 100%;
margin: 0;
padding: 0;
border: 0;
border-radius: 0;
background: transparent;
}
.menu-popover__backdrop.is-dim { background: rgba(28, 27, 24, 0.28); }
.menu-popover__panel {
position: fixed;
z-index: 41;
max-height: min(320px, 70vh);
overflow: auto;
display: grid;
gap: 4px;
align-content: start;
padding: 6px;
background: var(--surface);
border: 1px solid var(--border2);
border-radius: 12px;
box-shadow: var(--shadow);
}
.menu-popover__panel--sheet {
left: 0;
right: 0;
bottom: 0;
top: auto;
width: auto;
max-height: 70vh;
border-radius: 16px 16px 0 0;
padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
}
.menu-popover__panel button, .menu-popover__panel a {
width: 100%;
justify-content: flex-start;
min-height: 44px;
padding: 8px 10px;
border-radius: 8px;
background: transparent;
color: var(--text1);
font-weight: 600;
text-align: left;
text-decoration: none;
}
.menu-popover__panel button[aria-selected="true"] { background: var(--accent-light); color: var(--brand); }
.menu-popover__panel button.danger { background: #fcebeb; color: var(--danger); }
.menu-popover__label { margin: 6px 4px 0; color: var(--text3); font-size: 12px; font-weight: 700; }
.trail__more {
min-height: 28px;
height: auto;
padding: 0 6px;
background: transparent;
color: var(--brand);
font-size: 13px;
font-weight: 650;
}
.trail { margin-bottom: 4px; }
.entry-mark {
width: 40px;
height: 40px;
flex: 0 0 40px;
width: 36px;
height: 36px;
flex: 0 0 36px;
display: grid;
place-items: center;
position: relative;
@@ -626,7 +741,7 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
border-radius: 10px;
background: var(--surface);
}
.entry-mark--photo { width: 64px; height: 64px; flex-basis: 64px; overflow: hidden; }
.entry-mark--photo { width: 36px; height: 36px; flex-basis: 36px; overflow: hidden; }
.entry-mark__photo { width: 100%; height: 100%; object-fit: cover; }
.entry-mark__badge {
position: absolute;
@@ -758,35 +873,6 @@ button.hierarchy__row { width: 100%; min-height: 34px; padding: 6px 8px; border:
.mail-files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mail-files button.is-current { background: var(--accent-light); color: var(--text); }
.mail-attachment__caption { margin: 12px 0 0; font-weight: 650; }
.preview-row--linked { box-shadow: inset 3px 0 0 var(--accent); }
.bezug { flex: 1 1 100%; display: grid; gap: 2px; min-width: 0; }
.bezug__link, a.bezug__link, p.bezug__link {
display: flex;
flex-wrap: wrap;
align-items: baseline;
justify-content: flex-start;
gap: 8px;
width: 100%;
min-height: 0;
margin: 0;
padding: 2px 0 2px 10px;
border: 0;
border-left: 2px solid var(--accent);
border-radius: 0;
background: transparent;
color: var(--text2);
text-align: left;
font: inherit;
font-size: 13px;
font-weight: 500;
text-decoration: none;
cursor: pointer;
}
.bezug__link--reply, a.bezug__link--reply { border-left-color: var(--border2); }
p.bezug__link { cursor: default; }
.bezug__link span { color: var(--text3); font-size: 12px; font-weight: 700; }
.bezug__link strong { color: var(--text1); font-weight: 650; overflow-wrap: anywhere; }
.bezug__link em { font-style: normal; color: var(--text3); }
.schriftwechsel {
display: grid;
gap: 0;
@@ -835,13 +921,11 @@ p.bezug__link { cursor: default; }
@media (max-width: 720px) {
h1, .page-title { font-size: 24px; }
.order-choice { align-items: stretch; flex-direction: column; max-width: none; }
.order-choice select { width: 100%; min-width: 0; }
.preview-row { gap: 10px 12px; }
.preview-row__main { flex-basis: 12rem; }
.preview-row__actions { flex: 0 0 auto; margin-left: auto; }
.entry-mark { width: 40px; height: 40px; flex-basis: 40px; }
.entry-mark--photo { width: 56px; height: 56px; flex-basis: 56px; }
.order-choice { align-items: center; flex-direction: row; max-width: none; }
.order-choice select { width: auto; min-width: 0; flex: 1; }
.preview-row__text { -webkit-line-clamp: 1; }
.preview-row__facts { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.entry-mark, .entry-mark--photo { width: 36px; height: 36px; flex-basis: 36px; }
}
@media (max-width: 899px) {
@@ -1073,31 +1157,80 @@ p.bezug__link { cursor: default; }
}
.chapter-link__move { display: flex; gap: 2px; flex: none; align-items: center; }
.chapter-link__move button {
min-height: 22px;
width: 22px;
height: 22px;
min-height: 44px;
width: 44px;
height: 44px;
padding: 0;
font-size: 12px;
font-size: 16px;
font-weight: 600;
background: transparent;
color: var(--text3);
border-radius: 4px;
}
.nav-tree__toggle {
width: 44px;
min-width: 44px;
height: 44px;
padding: 0;
border: 0;
background: transparent;
color: var(--text2);
font-size: 16px;
}
.nav-tree__toggle.is-empty { visibility: hidden; }
.nav-tree__kind {
display: block;
color: var(--text3);
font-size: 11px;
font-weight: 700;
letter-spacing: 0.02em;
}
.chapter-kind {
display: inline;
margin-right: 6px;
color: var(--text3);
font-size: 12px;
font-weight: 700;
}
.chapter-nest {
margin-left: 12px;
padding-left: 10px;
border-left: 1px solid var(--border);
}
.chapter-children { display: grid; gap: 8px; margin-top: 8px; }
.pick-bar {
display: flex;
flex-wrap: wrap;
gap: 8px 12px;
align-items: end;
margin: 0 0 12px;
padding: 8px 10px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--surface);
}
.pick-bar button, .pick-bar select, .chapter-menu button, .chapter-menu summary {
min-height: 44px;
}
.pick-box {
display: flex;
align-items: center;
min-width: 44px;
min-height: 44px;
}
.chapter-menu { flex-wrap: wrap; }
.trail, .chapter-title, .target-line, .export-tree__title { overflow-wrap: anywhere; }
.chapter-link__move button:hover:not(:disabled) { background: var(--accent-light); color: var(--brand); }
.chapter-link__move button:disabled { opacity: 0.35; }
.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); }
.content-toolbar { align-items: center; margin-bottom: 6px; gap: 8px; }
.content-toolbar h2 { display: flex; align-items: baseline; gap: 8px; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--text1); margin: 0; }
.content-toolbar__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.content-toolbar__pick { min-height: 36px; padding: 4px 10px; }
.order-choice { margin: 0; }
.preview-list { display: grid; gap: 8px; }
.preview-row {
border: 1px solid transparent;
border-radius: 16px;
padding: 12px;
background: transparent;
}
.preview-list { display: grid; gap: 0; }
.preview-row.is-selected { background: var(--accent-light); }
.preview-row__main strong { font-size: 17px; }
.preview-row__title strong { font-size: 16px; }
.entry-mark { border-radius: 10px; }
.app-header .jk-logo-frame--plain {
width: auto;
@@ -1197,12 +1330,14 @@ p.bezug__link { cursor: default; }
@media (max-width: 759px) {
.rail { display: none; }
.app-shell { flex-direction: column; }
.workspace-main, .structure { padding-bottom: 96px; }
.workspace-main { padding: 8px 12px 88px; }
.structure { padding-bottom: 96px; }
.mobile-add { display: none; }
.page-actions { flex-wrap: wrap; }
.surface-tabs { margin: 4px 0 8px; }
.export-actions button { flex: 1 1 100%; }
.export-tree, .export-review { max-height: none; }
.desktop-add { width: 100%; justify-content: center; }
.desktop-add { width: auto; justify-content: center; }
.modal-overlay { padding: 0; align-items: end; }
.modal {
width: 100%;