Richte die Exportauswahl am bestehenden Baum aus.
Deploy Development / deploy (push) Successful in 25s
Deploy Development / deploy (push) Successful in 25s
Kleine Kaestchen, linksbündige Zeilen und die Inhaltssymbole machen die Auswahl lesbar. Der Pruefbericht haelt das Ergebnis der ersten Exportlieferung fest. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
95381030bc
commit
060d99bda0
5 files changed
+144
-29
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { api, downloadPost } from "../api.js";
|
||||
import { symbolUrl } from "../content-symbol.mjs";
|
||||
|
||||
function leafIds(node, into = []) {
|
||||
if (!node) return into;
|
||||
@@ -56,28 +57,55 @@ function CheckBox({ state, disabled, onChange, label }) {
|
||||
);
|
||||
}
|
||||
|
||||
function TreeRows({ node, depth, selected, onToggle }) {
|
||||
function ContentMark({ name }) {
|
||||
return (
|
||||
<span className="export-tree__mark" aria-hidden="true">
|
||||
<img className="type-glyph type-glyph--light" src={symbolUrl("light", name)} width="16" height="16" alt="" />
|
||||
<img className="type-glyph type-glyph--dark" src={symbolUrl("dark", name)} width="16" height="16" alt="" />
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
function symbolFor(node) {
|
||||
if (node.kind === "chapter") return "chapter";
|
||||
if (node.kind === "matter") return node.label === "Teilvorgang" ? "submatter" : "matter";
|
||||
if (node.kind === "annotation" || node.content_kind === "note") return "note";
|
||||
if (node.content_kind === "email") return "email";
|
||||
if (node.content_kind === "paperless") return "source-archive";
|
||||
if (node.content_kind === "url") return "link";
|
||||
return "file";
|
||||
}
|
||||
|
||||
function TreeBranch({ node, selected, onToggle }) {
|
||||
const state = checkState(node, selected);
|
||||
const ids = leafIds(node);
|
||||
const branch = node.kind === "matter" || node.kind === "chapter";
|
||||
return (
|
||||
<>
|
||||
<label className="export-tree__row" style={{ paddingLeft: `${depth * 16}px` }}>
|
||||
<li>
|
||||
<label className={branch ? "export-tree__row is-branch" : "export-tree__row"}>
|
||||
<CheckBox
|
||||
state={state}
|
||||
disabled={!ids.length}
|
||||
label={node.title}
|
||||
label={node.label ? `${node.label}: ${node.title}` : node.title}
|
||||
onChange={() => onToggle(node, state !== "on")}
|
||||
/>
|
||||
<span>
|
||||
<strong>{node.title}</strong>
|
||||
{node.label ? <span className="muted"> {node.label}</span> : null}
|
||||
{node.reason ? <span className="export-reason"> {node.reason}</span> : null}
|
||||
<ContentMark name={symbolFor(node)} />
|
||||
<span className="export-tree__text">
|
||||
<span className="export-tree__line">
|
||||
<span className="export-tree__title">{node.title}</span>
|
||||
{node.label ? <span className="export-tree__kind">{node.label}</span> : null}
|
||||
</span>
|
||||
{node.reason ? <span className="export-reason">{node.reason}</span> : null}
|
||||
</span>
|
||||
</label>
|
||||
{(node.children || []).map((child) => (
|
||||
<TreeRows key={child.id} node={child} depth={depth + 1} selected={selected} onToggle={onToggle} />
|
||||
))}
|
||||
</>
|
||||
{node.children?.length ? (
|
||||
<ul>
|
||||
{node.children.map((child) => (
|
||||
<TreeBranch key={child.id} node={child} selected={selected} onToggle={onToggle} />
|
||||
))}
|
||||
</ul>
|
||||
) : null}
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -153,7 +181,7 @@ export function ExportPackage({ matterId, context, onClose }) {
|
||||
|
||||
return (
|
||||
<div className="stack export-package">
|
||||
<p className="muted">
|
||||
<p className="export-lead">
|
||||
Die Auswahl gilt für diese Ausgabe. Ein bereits heruntergeladenes Paket verändert sich nicht,
|
||||
wenn danach Inhalte geändert oder ergänzt werden.
|
||||
</p>
|
||||
@@ -161,9 +189,9 @@ export function ExportPackage({ matterId, context, onClose }) {
|
||||
{!tree ? <p className="muted">Auswahl wird geladen …</p> : null}
|
||||
{tree && !review ? (
|
||||
<>
|
||||
<div className="export-tree" role="group" aria-label="Exportauswahl">
|
||||
<TreeRows node={tree} depth={0} selected={selected} onToggle={toggle} />
|
||||
</div>
|
||||
<ul className="export-tree" role="group" aria-label="Exportauswahl">
|
||||
<TreeBranch node={tree} selected={selected} onToggle={toggle} />
|
||||
</ul>
|
||||
<div className="export-actions">
|
||||
<button type="button" onClick={examine} disabled={pending || selected.size === 0}>
|
||||
{pending ? "Prüfung läuft …" : "Auswahl prüfen"}
|
||||
@@ -203,8 +231,11 @@ export function ExportPackage({ matterId, context, onClose }) {
|
||||
<ul className="export-entries">
|
||||
{(review.entries || []).map((entry) => (
|
||||
<li key={entry.node_id}>
|
||||
{entry.kind_label}: {entry.title}
|
||||
{entry.path ? <span className="muted"> · {entry.path}</span> : null}
|
||||
<span className="export-tree__line">
|
||||
<span className="export-tree__title">{entry.title}</span>
|
||||
{entry.kind_label ? <span className="export-tree__kind">{entry.kind_label}</span> : null}
|
||||
</span>
|
||||
{entry.path ? <span className="export-tree__kind">{entry.path}</span> : null}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
+48
-9
@@ -426,16 +426,55 @@ label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(-
|
||||
.hierarchy__row.is-current { background: var(--accent-light); box-shadow: inset 3px 0 0 var(--accent); }
|
||||
.hierarchy__kind { color: var(--text3); font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
|
||||
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
|
||||
.export-tree { display: grid; gap: 2px; max-height: min(52vh, 440px); overflow: auto; }
|
||||
.export-tree__row { display: flex; gap: 8px; align-items: flex-start; min-height: 36px; font-weight: 400; }
|
||||
.export-tree__row input { margin-top: 4px; }
|
||||
.export-tree__row strong { font-weight: 650; }
|
||||
.export-reason { color: var(--danger); font-weight: 400; }
|
||||
.export-notice { color: var(--warn); }
|
||||
.export-entries { margin: 0; padding-left: 1.1rem; }
|
||||
.export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.export-lead { margin: 0; color: var(--text2); font-size: 13px; font-weight: 400; line-height: 1.4; text-align: left; }
|
||||
.export-tree, .export-tree ul { list-style: none; margin: 0; padding: 0; }
|
||||
.export-tree { max-height: min(60vh, 520px); overflow: auto; text-align: left; }
|
||||
.export-tree ul { margin-left: 11px; padding-left: 8px; border-left: 1px solid var(--border); }
|
||||
.export-tree__row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
min-height: 28px;
|
||||
margin: 0;
|
||||
padding: 3px 4px;
|
||||
border-radius: 4px;
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 1.35;
|
||||
color: var(--text1);
|
||||
}
|
||||
.export-tree__row:hover { background: var(--surface2); }
|
||||
.export-tree__row input[type="checkbox"] {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
min-width: 14px;
|
||||
min-height: 14px;
|
||||
margin: 2px 0 0;
|
||||
padding: 0;
|
||||
flex: 0 0 14px;
|
||||
accent-color: var(--accent);
|
||||
background: transparent;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.export-tree__mark { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
|
||||
.export-tree__mark .type-glyph { width: 16px; height: 16px; }
|
||||
.export-tree__text { min-width: 0; flex: 1; display: grid; justify-items: start; gap: 1px; text-align: left; }
|
||||
.export-tree__line { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: 2px 8px; width: 100%; text-align: left; }
|
||||
.export-tree__title { font-weight: 600; text-align: left; overflow-wrap: anywhere; }
|
||||
.export-tree__row.is-branch .export-tree__title { font-weight: 650; }
|
||||
.export-tree__kind { color: var(--text3); font-size: 12px; font-weight: 500; text-align: left; overflow-wrap: anywhere; }
|
||||
.export-reason { color: var(--danger); font-size: 12px; font-weight: 400; line-height: 1.35; text-align: left; }
|
||||
.export-package > .export-reason { font-size: 13px; }
|
||||
.export-notice { color: var(--warn); font-size: 13px; font-weight: 400; text-align: left; }
|
||||
.export-entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; text-align: left; }
|
||||
.export-entries li { display: grid; justify-items: start; gap: 1px; padding: 3px 4px; font-size: 13px; line-height: 1.35; text-align: left; }
|
||||
.export-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
|
||||
.export-actions button { min-height: 44px; }
|
||||
.export-review { display: grid; gap: 8px; max-height: min(52vh, 440px); overflow: auto; }
|
||||
.export-review { display: grid; justify-items: start; gap: 8px; max-height: min(60vh, 520px); overflow: auto; text-align: left; }
|
||||
.export-review > p { text-align: left; }
|
||||
.add-choices { display: grid; gap: 8px; }
|
||||
.add-choices button { min-height: 44px; justify-content: flex-start; }
|
||||
.hierarchy__parent { margin-bottom: 8px; }
|
||||
|
||||
Reference in new issue
Block a user