[79] Publikationssatz: Reihenfolge der Blätter mit ↑/↓
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NTYBZBvLYCtugMJoKXaB67
This commit is contained in:
5 files changed
+46
-7
No files matched your search
@@ -1770,7 +1770,7 @@ Reihenfolge = Abhängigkeiten. Neue Geometrie entsteht in Rust ([K]).
|
||||
(Index A→B→…→AA, 2→3; Plan, Ops), Ausführung `export/publishRun.ts` (PDF über `layoutPdf.buildPagesPdf`, DXF/DWG über den
|
||||
Papierbereich-Export; mehrere Dateien als ZIP), Hülle `state/publishActions.ts`, UI-Abschnitt „Publikation“ im Mappe-Reiter
|
||||
(`panels/PublishSection.tsx`: Sätze, Einstellungen, ein Klick, Protokoll). Publizieren = ein Undo-Schritt (Index + Protokoll).
|
||||
Offen: Reihenfolge der Blätter im Satz per Ziehen (heute Projekt-Reihenfolge beim Anhaken), DXF/DWG enthält die Papierbereiche
|
||||
4.11.: Reihenfolge der Blätter im Satz mit ↑/↓ (gewählte Blätter oben in Ausgabe-Reihenfolge). Offen: DXF/DWG enthält die Papierbereiche
|
||||
der Satz-Blätter, aber Papier-/Massstab-Übersteuerung wirkt dort nur als Export-Massstab, Satz je Ordner, Protokoll als Export.
|
||||
Nicht in der Tauri-App getestet (Browser-Download-Pfad geprüft).
|
||||
- ✅ **[93] Zeichnen auf dem Layout-Blatt = Zeichnen im Grundriss.** (29.10., Wartungs-Feedback „soll sich genau
|
||||
|
||||
@@ -3222,6 +3222,8 @@ export const de = {
|
||||
"publish.format.dxf": "DXF mit Layouts",
|
||||
"publish.format.dwg": "DWG mit Layouts",
|
||||
"publish.sheets": "Blätter",
|
||||
"publish.moveUp": "Im Satz nach vorne",
|
||||
"publish.moveDown": "Im Satz nach hinten",
|
||||
"publish.views": "Gespeicherte Ansichten",
|
||||
"publish.pattern": "Dateiname",
|
||||
"publish.pattern.hint": "Platzhalter: {Projektnummer} {Projekt} {Blattnummer} {Blattname} {Index} {Datum} {Satz}",
|
||||
|
||||
@@ -3208,6 +3208,8 @@ export const en: Record<TranslationKey, string> = {
|
||||
"publish.format.dxf": "DXF with layouts",
|
||||
"publish.format.dwg": "DWG with layouts",
|
||||
"publish.sheets": "Sheets",
|
||||
"publish.moveUp": "Move earlier in the set",
|
||||
"publish.moveDown": "Move later in the set",
|
||||
"publish.views": "Saved views",
|
||||
"publish.pattern": "File name",
|
||||
"publish.pattern.hint": "Placeholders: {Projektnummer} {Projekt} {Blattnummer} {Blattname} {Index} {Datum} {Satz}",
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// [79] Reihenfolge der Blätter im Publikationssatz: ↑/↓ tauschen Nachbarn, am Rand nichts.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { move } from "./PublishSection";
|
||||
|
||||
describe("move", () => {
|
||||
it("tauscht mit dem Nachbarn", () => {
|
||||
expect(move(["a", "b", "c"], 1, -1)).toEqual(["b", "a", "c"]);
|
||||
expect(move(["a", "b", "c"], 1, 1)).toEqual(["a", "c", "b"]);
|
||||
});
|
||||
it("am Rand unverändert", () => {
|
||||
expect(move(["a", "b"], 0, -1)).toEqual(["a", "b"]);
|
||||
expect(move(["a", "b"], 1, 1)).toEqual(["a", "b"]);
|
||||
});
|
||||
});
|
||||
@@ -16,6 +16,15 @@ function toggle(list: readonly string[], id: string, on: boolean): string[] {
|
||||
return on ? (list.includes(id) ? [...list] : [...list, id]) : list.filter((x) => x !== id);
|
||||
}
|
||||
|
||||
/** Eintrag `i` um `d` (±1) verschieben. */
|
||||
export function move(list: readonly string[], i: number, d: number): string[] {
|
||||
const j = i + d;
|
||||
if (i < 0 || j < 0 || i >= list.length || j >= list.length) return [...list];
|
||||
const out = [...list];
|
||||
[out[i], out[j]] = [out[j], out[i]];
|
||||
return out;
|
||||
}
|
||||
|
||||
function SetEditor({ set }: { set: PublishSet }) {
|
||||
const host = usePanelHost();
|
||||
const project = host.project;
|
||||
@@ -43,12 +52,24 @@ function SetEditor({ set }: { set: PublishSet }) {
|
||||
<div>
|
||||
<div>{t("publish.sheets")}</div>
|
||||
{layouts.length === 0 && <div style={{ color: "var(--muted)" }}>{t("layouts.tree.empty")}</div>}
|
||||
{layouts.map((l) => (
|
||||
<label key={l.id} style={{ display: "flex", gap: 5, alignItems: "center" }}>
|
||||
<input type="checkbox" checked={set.layoutIds.includes(l.id)} onChange={(e) => patch({ layoutIds: toggle(set.layoutIds, l.id, e.target.checked) })} />
|
||||
<span>{l.name}</span>
|
||||
</label>
|
||||
))}
|
||||
{/* Gewählte Blätter in Satz-Reihenfolge (so werden sie ausgegeben, [79]), mit ↑/↓; darunter die übrigen. */}
|
||||
{[...set.layoutIds.map((id) => layouts.find((l) => l.id === id)).filter((l) => !!l), ...layouts.filter((l) => !set.layoutIds.includes(l.id))].map((l) => {
|
||||
const i = set.layoutIds.indexOf(l!.id);
|
||||
return (
|
||||
<div key={l!.id} style={{ display: "flex", gap: 5, alignItems: "center" }} data-testid="publish-sheet-row">
|
||||
<label style={{ display: "flex", gap: 5, alignItems: "center", flex: 1 }}>
|
||||
<input type="checkbox" checked={i >= 0} onChange={(e) => patch({ layoutIds: toggle(set.layoutIds, l!.id, e.target.checked) })} />
|
||||
<span>{l!.name}</span>
|
||||
</label>
|
||||
{i >= 0 && (
|
||||
<>
|
||||
<button className="nav-add" title={t("publish.moveUp")} disabled={i === 0} onClick={() => patch({ layoutIds: move(set.layoutIds, i, -1) })}>↑</button>
|
||||
<button className="nav-add" title={t("publish.moveDown")} disabled={i === set.layoutIds.length - 1} onClick={() => patch({ layoutIds: move(set.layoutIds, i, 1) })}>↓</button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
{pdf && snapshots.length > 0 && (
|
||||
<div>
|
||||
|
||||
Reference in new issue
Block a user