Halte die Vorgangsleiste sichtbar und nimm die ueberfluessigen Kapitelworte weg, damit Datum, Bezuege, Titel und mehrere Belege direkt gesetzt werden koennen.
Deploy Development / deploy (push) Successful in 30s
Test Suite / pytest-backend (push) Successful in 1m28s
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 22:46:12 +02:00
1 parent cbd45a8997
commit deb5d662fe
13 files changed
+423 -101

No files matched your search

+21 -12
View File
@@ -7,7 +7,7 @@ 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 { ContentBoard, DateField, 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 { NavIcon } from "./icons.jsx";
@@ -199,6 +199,7 @@ export function MatterDetail() {
const [error, setError] = useState("");
const [modal, setModal] = useState("");
const [chapterParentId, setChapterParentId] = useState("");
const [addChapterId, setAddChapterId] = useState("");
const rightsContext = inherited || { kind: "matter", id };
const placement = inherited?.kind === "case" ? { kind: "matter", id } : null;
const [view, setView] = useState("contents");
@@ -374,6 +375,11 @@ export function MatterDetail() {
setModal("chapter");
}
function openAdd(targetChapterId = chapterId) {
setAddChapterId(targetChapterId || "");
setModal("add");
}
async function moveChapter(chapterIdToMove, delta) {
const ids = siblingChapterIds(record?.chapters || [], chapterIdToMove);
const index = ids.indexOf(chapterIdToMove);
@@ -468,6 +474,7 @@ export function MatterDetail() {
/>
) : null}
>
<div className="workspace-pin">
<header className="workspace-head">
<div>
<Trail items={trailWithChapter(record.trail?.length ? record.trail : objectTrail(record, query), record.chapters, chapterId, `/matters/${id}${query}`)} />
@@ -480,7 +487,7 @@ export function MatterDetail() {
<div className="page-actions">
{width < 1500 ? <button type="button" className="quiet" onClick={() => setStructureOpen(true)}>Struktur</button> : null}
{canEdit ? (
<button type="button" className="desktop-add" onClick={() => setModal("add")}>
<button type="button" className="desktop-add" onClick={() => openAdd(chapterId)}>
<NavIcon name="plus" /> Inhalt hinzufügen
</button>
) : null}
@@ -499,6 +506,7 @@ export function MatterDetail() {
{!canEdit ? <p className="muted">In {targetLabel} fehlt das Bearbeitungsrecht.</p> : null}
<ErrorNote error={error} />
<WorkSwitch view={view} onView={setView} />
</div>
{view === "contents" ? (
<ContentBoard
record={record}
@@ -509,6 +517,7 @@ export function MatterDetail() {
selectedId={entryId}
listTitle={activeChapter ? chapterPathLabel(record.chapters, activeChapter.id) : "Alle Inhalte"}
onAddSubchapter={canEdit ? openChapter : null}
onAddContent={canEdit ? openAdd : null}
onOpen={(binding) => {
rememberScroll(listRef.current, scrollKey);
openEntry(binding);
@@ -544,7 +553,7 @@ export function MatterDetail() {
</div>
) : null}
{canEdit && view === "contents" ? (
<button type="button" className="mobile-add" onClick={() => setModal("add")}>
<button type="button" className="mobile-add" onClick={() => openAdd(chapterId)}>
<NavIcon name="plus" /> Inhalt hinzufügen
</button>
) : null}
@@ -556,10 +565,10 @@ export function MatterDetail() {
<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 || ""} />
<TargetLine label={targetLabel} chapters={record.chapters} chapterId={addChapterId} />
<div className="add-choices">
<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={() => openChapter(addChapterId)}>{addChapterId ? "Unterkapitel" : "Kapitel"}</button>
{addChapterId ? <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,16 +576,16 @@ export function MatterDetail() {
</div>
</Modal>
<Modal open={modal === "note"} title="Notiz" onClose={() => setModal("")}>
<NoteForm context={rightsContext} placement={placement} chapters={record.chapters} initialChapter={activeChapter?.id || ""} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
<NoteForm context={rightsContext} placement={placement} chapters={record.chapters} initialChapter={addChapterId} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "file"} title="Datei" onClose={() => setModal("")}>
<FileForm context={rightsContext} placement={placement} chapters={record.chapters} initialChapter={activeChapter?.id || ""} targetLabel={targetLabel} onChange={() => { setModal(""); load(); }} />
<FileForm context={rightsContext} placement={placement} chapters={record.chapters} initialChapter={addChapterId} 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 ? chapterPathLabel(record.chapters, activeChapter.id) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
<PaperlessPicker context={rightsContext} placement={placement} chapterId={addChapterId} chapterTitle={addChapterId ? chapterPathLabel(record.chapters, addChapterId) : ""} targetLabel={targetLabel} onInserted={load} 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 ? chapterPathLabel(record.chapters, activeChapter.id) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
<MailPicker context={rightsContext} placement={placement} chapterId={addChapterId} chapterTitle={addChapterId ? chapterPathLabel(record.chapters, addChapterId) : ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "submatter"} title="Teilvorgang anlegen" onClose={() => setModal("")}>
<SubmatterForm parentId={id} context={inherited} onChange={() => { setModal(""); load(); }} />
@@ -756,13 +765,13 @@ function WorkForms({ matterId, context, deadlines, onChange }) {
<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>
<label>Frist <DateField value={deadlineDue} onChange={setDeadlineDue} 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 vor der Frist zu tun?" required />
<label>Arbeitstermin <input type="date" value={taskDue} onChange={(event) => setTaskDue(event.target.value)} /></label>
<label>Arbeitstermin <DateField value={taskDue} onChange={setTaskDue} /></label>
<label>
Gehört zur Frist
<select value={deadlineId} onChange={(event) => setDeadlineId(event.target.value)}>