[139] Merge: Zauberstab-Kürzel, Speichern/Teilen-Tasten, Fensterliste-SVG
This commit is contained in:
21 files changed
+194
-28
No files matched your search
@@ -2636,6 +2636,8 @@ Modelle · [44] Aus Datei einfügen · [45] Favoriten · [68] Gelände mit Baugr
|
||||
(◐, DXF-Parser, IFC-Import) · [52] Icons (◐, `CommandIcon.tsx`) · [56] Startparameter · [89] Git-freundliches
|
||||
Format · [90] Versionsvergleich · [91] Assistent · [92] Speckle.
|
||||
|
||||
- ✅ **[139] Kleine Fehler aus der Doku.** (5.11.) Beim Schreiben der Doku gefunden: (1) Befehl `wand` startete den Zauberstab statt der Wand; der Zauberstab heisst jetzt `zauberstab` (Kürzel `zs`), `wand` = Wand, Kern-Befehl `wand` unverändert. (2) Cmd/Strg+S war doppelt belegt: jetzt Speichern (bekannter Pfad ohne Dialog, sonst Dialog), Cmd/Strg+Shift+S = Speichern unter, Teilen auf Cmd/Strg+Shift+J. (3) `schedule --openings --format svg`: Zellen werden in der Blattaufteilung (`area_report.rs`, gilt auch für PDF) auf Spaltenbreite umbrochen statt zu überlappen, Spaltenbreiten der Liste angepasst. Offen: Speichern/Speichern unter nur per vitest geprüft, nicht in der Tauri-App.
|
||||
|
||||
- ◐ **[68] Baugrube / Geländebearbeitung.** (30.10.) Kontext-Objekt `excavation` (Rust-Modell, `ContextObject`):
|
||||
Sohle (`outline`, `bottom` m ±0.00), Böschung `slope` (Standard 45°, je Kante `edgeSlopes`), Schüttung `fillSlope`
|
||||
(33.7°), Bermen `bermWidth`/`bermHeight`. Neues Gelände = clamp(t, b − d·tan β, b + H(d)) mit d = Abstand zum
|
||||
|
||||
@@ -239,6 +239,59 @@ fn wrap(text: &str, max_mm: f64, size_pt: f64) -> Vec<String> {
|
||||
lines
|
||||
}
|
||||
|
||||
/// Geschätzte Textbreite in mm (Helvetica: Ziffern 0.556 em, Fett etwas breiter; bewusst grosszügig).
|
||||
fn char_w_mm(size_pt: f64, bold: bool) -> f64 {
|
||||
size_pt * 0.3528 * if bold { 0.58 } else { 0.52 }
|
||||
}
|
||||
|
||||
/// Bricht eine Zelle in Zeilen, die in `avail_mm` passen: an Leerzeichen, überlange Wörter hart.
|
||||
fn fit_cell(text: &str, avail_mm: f64, size_pt: f64, bold: bool) -> Vec<String> {
|
||||
let max = (avail_mm / char_w_mm(size_pt, bold)).floor().max(1.0) as usize;
|
||||
let mut lines: Vec<String> = Vec::new();
|
||||
let mut cur = String::new();
|
||||
let push_word = |cur: &mut String, lines: &mut Vec<String>, w: &str| {
|
||||
let mut w: Vec<char> = w.chars().collect();
|
||||
while utf16_len(&w.iter().collect::<String>()) > max {
|
||||
let mut n = 0;
|
||||
let mut take = 0;
|
||||
for (i, c) in w.iter().enumerate() {
|
||||
n += c.len_utf16();
|
||||
if n > max {
|
||||
break;
|
||||
}
|
||||
take = i + 1;
|
||||
}
|
||||
let take = take.max(1);
|
||||
if !cur.is_empty() {
|
||||
lines.push(std::mem::take(cur));
|
||||
}
|
||||
lines.push(w.drain(..take).collect());
|
||||
}
|
||||
let ws: String = w.iter().collect();
|
||||
if ws.is_empty() {
|
||||
return;
|
||||
}
|
||||
if cur.is_empty() {
|
||||
*cur = ws;
|
||||
} else if utf16_len(cur) + 1 + utf16_len(&ws) <= max {
|
||||
cur.push(' ');
|
||||
cur.push_str(&ws);
|
||||
} else {
|
||||
lines.push(std::mem::replace(cur, ws));
|
||||
}
|
||||
};
|
||||
for w in text.split_whitespace() {
|
||||
push_word(&mut cur, &mut lines, w);
|
||||
}
|
||||
if !cur.is_empty() {
|
||||
lines.push(cur);
|
||||
}
|
||||
if lines.is_empty() {
|
||||
lines.push(String::new());
|
||||
}
|
||||
lines
|
||||
}
|
||||
|
||||
fn text(x: f64, y: f64, s: &str, size: f64, bold: bool, right: bool) -> Prim {
|
||||
Prim::Text { x, y, s: s.to_string(), size, bold, right }
|
||||
}
|
||||
@@ -288,7 +341,18 @@ pub fn layout(report: &Report, o: &LayoutOptions) -> Layout {
|
||||
let numeric: Vec<bool> = (0..s.columns.len()).map(|i| s.rows.iter().any(|r| matches!(r.cells.get(i), Some(Cell::Num { .. })))).collect();
|
||||
// 0 = keine Linie, 1 = oben
|
||||
let draw_row = |pages: &mut Vec<Vec<Prim>>, y: &mut f64, cells: &[String], bold: bool, top: bool| {
|
||||
if *y + row_h > height - m {
|
||||
// Zellen auf Spaltenbreite umbrechen; die Zeile wächst mit der höchsten Zelle.
|
||||
let wrapped: Vec<Vec<String>> = cells
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(i, c)| {
|
||||
let w = xs.get(i + 1).copied().unwrap_or(f64::NAN) - xs.get(i).copied().unwrap_or(f64::NAN);
|
||||
if w.is_finite() { fit_cell(c, (w - 3.0).max(2.0), 8.5, bold) } else { vec![c.clone()] }
|
||||
})
|
||||
.collect();
|
||||
let n = wrapped.iter().map(|l| l.len()).max().unwrap_or(1).max(1);
|
||||
let h = if n == 1 { row_h } else { n as f64 * 3.6 + 2.4 };
|
||||
if *y + h > height - m {
|
||||
pages.push(Vec::new());
|
||||
*y = m;
|
||||
}
|
||||
@@ -296,13 +360,15 @@ pub fn layout(report: &Report, o: &LayoutOptions) -> Layout {
|
||||
if top {
|
||||
pg.push(Prim::Line { x1: m, y1: *y, x2: m + inner, y2: *y, w: 0.35 });
|
||||
}
|
||||
for (i, c) in cells.iter().enumerate() {
|
||||
for (i, lines) in wrapped.iter().enumerate() {
|
||||
let right = numeric.get(i).copied().unwrap_or(false);
|
||||
let xi = xs.get(i).copied().unwrap_or(f64::NAN);
|
||||
let xn = xs.get(i + 1).copied().unwrap_or(f64::NAN);
|
||||
pg.push(text(if right { xn - 1.5 } else { xi + 1.5 }, *y + 4.2, c, 8.5, bold, right));
|
||||
for (k, l) in lines.iter().enumerate() {
|
||||
pg.push(text(if right { xn - 1.5 } else { xi + 1.5 }, *y + 4.2 + k as f64 * 3.6, l, 8.5, bold, right));
|
||||
}
|
||||
}
|
||||
*y += row_h;
|
||||
*y += h;
|
||||
};
|
||||
draw_row(&mut pages, &mut y, &s.columns, true, false);
|
||||
page!().push(Prim::Line { x1: m, y1: y, x2: m + inner, y2: y, w: 0.35 });
|
||||
@@ -420,6 +486,33 @@ mod tests {
|
||||
assert_eq!(p["notes"][0], "Eine Fussnote");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lange_zellen_ueberlappen_nicht() {
|
||||
let r: Report = serde_json::from_value(json!({
|
||||
"title": "T", "projectName": "",
|
||||
"sections": [{ "heading": "H", "columns": ["Nr", "Bezeichnung sehr lang", "Mass"], "widths": [1, 1, 1],
|
||||
"rows": [{ "cells": ["EG.01", "Hebeschiebetür Aluminium dreifach verglast mit Oberlicht", { "n": 1234567.891, "d": 2 }] }] }],
|
||||
"notes": []
|
||||
}))
|
||||
.unwrap();
|
||||
let l = layout(&r, &LayoutOptions::default());
|
||||
// Text-Kästen je Grundlinie sammeln: (links, rechts) nach Ausrichtung; keine zwei überlappen.
|
||||
let mut rows: std::collections::BTreeMap<i64, Vec<(f64, f64)>> = Default::default();
|
||||
for p in &l.pages[0] {
|
||||
if let Prim::Text { x, y, s, size, bold, right } = p {
|
||||
let w = utf16_len(s) as f64 * char_w_mm(*size, *bold) * 0.9;
|
||||
let (a, b) = if *right { (x - w, *x) } else { (*x, x + w) };
|
||||
rows.entry((y * 100.0).round() as i64).or_default().push((a, b));
|
||||
}
|
||||
}
|
||||
for (_, mut v) in rows {
|
||||
v.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap());
|
||||
for w in v.windows(2) {
|
||||
assert!(w[0].1 <= w[1].0, "Überlappung {:?}", w);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn seiten_und_svg() {
|
||||
let l = layout(&sample(), &LayoutOptions::default());
|
||||
|
||||
@@ -1191,6 +1191,7 @@ export default function App() {
|
||||
loadImportLayout,
|
||||
setImportPdfOptions,
|
||||
onSaveProject,
|
||||
onSaveProjectAs,
|
||||
onNewProject,
|
||||
onNewProjectFromSample,
|
||||
onNewProjectFromComplexSample,
|
||||
@@ -1373,6 +1374,7 @@ export default function App() {
|
||||
onNewProjectFromTemplate,
|
||||
onOpenProject,
|
||||
onSaveProject,
|
||||
onSaveProjectAs,
|
||||
onImport: () => dxfInputRef.current?.click(),
|
||||
onExportPdf: () => setExportOpen(true),
|
||||
onExportDxf: () => setExportDxfOpen(true),
|
||||
@@ -2003,6 +2005,7 @@ export default function App() {
|
||||
onNewProjectFromTemplate,
|
||||
onOpenProject,
|
||||
onSaveProject,
|
||||
onSaveProjectAs,
|
||||
onImport: () => dxfInputRef.current?.click(),
|
||||
onImportPointCloud: () => openPointCloudFileDialog(),
|
||||
onImportMesh: () => openMeshFileDialog(),
|
||||
@@ -2172,6 +2175,7 @@ export default function App() {
|
||||
onNewProjectFromTemplate={ev.onNewProjectFromTemplate}
|
||||
onOpenProject={ev.onOpenProject}
|
||||
onSaveProject={ev.onSaveProject}
|
||||
onSaveProjectAs={ev.onSaveProjectAs}
|
||||
onImport={ev.onImport}
|
||||
onImportPointCloud={ev.onImportPointCloud}
|
||||
onImportMesh={ev.onImportMesh}
|
||||
|
||||
@@ -22,7 +22,7 @@ const hatchOf = (s: WandState, ctx: CommandContext): string | undefined =>
|
||||
s.sticky.hatch === NONE ? undefined : (usable(ctx)[s.sticky.hatch] ?? usable(ctx)[0])?.id;
|
||||
|
||||
export const wandCommand: Command = {
|
||||
name: "wand",
|
||||
name: "zauberstab",
|
||||
labelKey: "cmd.wand.label",
|
||||
prompt: () => "cmd.wand.point",
|
||||
accepts: () => ["point", "option"],
|
||||
|
||||
@@ -71,4 +71,10 @@ describe("Körper-Befehle (truck)", () => {
|
||||
expect(resolveCommand("bool")?.name).toBe("solidbool");
|
||||
expect(resolveCommand("verschneiden")?.name).toBe("solidbool");
|
||||
});
|
||||
|
||||
it("wand startet die Wand, zauberstab/zs den Zauberstab", () => {
|
||||
expect(resolveCommand("wand")?.name).toBe("wall");
|
||||
expect(resolveCommand("zauberstab")?.name).toBe("zauberstab");
|
||||
expect(resolveCommand("zs")?.name).toBe("zauberstab");
|
||||
});
|
||||
});
|
||||
@@ -107,7 +107,7 @@ export const COMMANDS: Record<string, Command> = {
|
||||
scalebar: scalebarCommand,
|
||||
revcloud: revcloudCommand,
|
||||
pointmarker: pointmarkerCommand,
|
||||
wand: wandCommand,
|
||||
zauberstab: wandCommand,
|
||||
wipeout: wipeoutCommand,
|
||||
text: textCommand,
|
||||
leader: leaderCommand,
|
||||
@@ -223,8 +223,7 @@ export const ALIASES: Record<string, string> = {
|
||||
wolke: "revcloud",
|
||||
revisionswolke: "revcloud",
|
||||
pm: "pointmarker",
|
||||
zs: "wand",
|
||||
zauberstab: "wand",
|
||||
zs: "zauberstab",
|
||||
punkt: "pointmarker",
|
||||
knoten: "pointmarker",
|
||||
wo: "wipeout",
|
||||
|
||||
@@ -302,3 +302,29 @@ describe("scheduleRows — Dächer und Stützen (bisher fehlten sie in Liste/Ele
|
||||
expect(scheduleRows(proj).some((r) => r.id === "RM1")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Fenster- und Türliste als Blatt ([139])", () => {
|
||||
it("keine zwei Texte derselben Zeile überlappen (Musterhaus komplex)", async () => {
|
||||
const { buildComplexSampleProject } = await import("../model/sampleProjectComplex");
|
||||
const { buildOpeningReport } = await import("./openingSchedule");
|
||||
const { layoutAreaReport } = await import("./areaReport");
|
||||
const lay = layoutAreaReport(buildOpeningReport(buildComplexSampleProject()));
|
||||
let texts = 0;
|
||||
for (const page of lay.pages) {
|
||||
const rows = new Map<number, [number, number][]>();
|
||||
for (const p of page) {
|
||||
if (p.k !== "text") continue;
|
||||
texts++;
|
||||
const w = p.s.length * p.size * 0.3528 * 0.45; // untere Schätzung der Breite
|
||||
const box: [number, number] = p.align === "right" ? [p.x - w, p.x] : [p.x, p.x + w];
|
||||
const key = Math.round(p.y * 100);
|
||||
rows.set(key, [...(rows.get(key) ?? []), box]);
|
||||
}
|
||||
for (const boxes of rows.values()) {
|
||||
boxes.sort((a, b) => a[0] - b[0]);
|
||||
for (let i = 1; i < boxes.length; i++) expect(boxes[i - 1]![1]).toBeLessThanOrEqual(boxes[i]![0] + 1e-6);
|
||||
}
|
||||
}
|
||||
expect(texts).toBeGreaterThan(50);
|
||||
});
|
||||
});
|
||||
@@ -102,7 +102,7 @@ function withReveals(sec: ReportSection, rows: OpeningScheduleRow[]): ReportSect
|
||||
return {
|
||||
...sec,
|
||||
columns: [...sec.columns, ...keys.map((name) => t("openings.col.reveal", { name }))],
|
||||
widths: [...sec.widths, ...keys.map(() => 1.4)],
|
||||
widths: [...sec.widths, ...keys.map(() => 1.9)],
|
||||
rows: sec.rows.map((row, i) => ({ ...row, cells: [...row.cells, ...keys.map((k) => num(revealArea(rows[i]!, k), 2))] })),
|
||||
};
|
||||
}
|
||||
@@ -119,7 +119,7 @@ function windowBase(rows: OpeningScheduleRow[]): ReportSection {
|
||||
return {
|
||||
heading: t("openings.windows"),
|
||||
columns: [t("openings.col.mark"), t("openings.col.type"), t("openings.col.floor"), t("openings.col.rooms"), t("openings.col.width"), t("openings.col.height"), t("openings.col.sill"), t("openings.col.sound"), t("openings.col.u"), t("openings.col.rc"), t("openings.col.ext"), t("openings.col.notes")],
|
||||
widths: [1.4, 2.4, 1.4, 3.2, 1.2, 1.2, 1.2, 1.6, 1.1, 1.1, 1.4, 3],
|
||||
widths: [1.3, 3.4, 1.9, 3, 1.4, 1.4, 1.4, 1.5, 1.3, 1.3, 1.6, 2.6],
|
||||
rows: rows.map((r): ReportRow => ({ cells: [r.mark, r.typeName, r.floor, roomsText(r), num(r.width, 2), num(r.height, 2), num(r.sill, 2), r.soundClass, num(r.uValue, 2), r.burglaryClass, externalText(r.external), r.notes] })),
|
||||
};
|
||||
}
|
||||
@@ -128,7 +128,7 @@ function doorBase(rows: OpeningScheduleRow[]): ReportSection {
|
||||
return {
|
||||
heading: t("openings.doors"),
|
||||
columns: [t("openings.col.mark"), t("openings.col.type"), t("openings.col.floor"), t("openings.col.rooms"), t("openings.col.width"), t("openings.col.height"), t("openings.col.clearWidth"), t("openings.col.clearHeight"), t("openings.col.swing"), t("openings.col.fire"), t("openings.col.sound"), t("openings.col.u"), t("openings.col.rc"), t("openings.col.ext"), t("openings.col.notes")],
|
||||
widths: [1.4, 2.2, 1.3, 3, 1.1, 1.1, 1.2, 1.2, 2.6, 1.1, 1.5, 1, 1, 1.3, 2.6],
|
||||
widths: [1.3, 3, 1.9, 3, 1.3, 1.3, 1.4, 1.4, 2.6, 1.1, 1.5, 1.1, 1.3, 1.6, 2.4],
|
||||
rows: rows.map((r): ReportRow => ({ cells: [r.mark, r.typeName, r.floor, roomsText(r), num(r.width, 2), num(r.height, 2), num(r.clearWidth, 2), num(r.clearHeight, 2), swingText(r), r.fireRating, r.soundClass, num(r.uValue, 2), r.burglaryClass, externalText(r.external), r.notes] })),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ export const de = {
|
||||
"menu.native.newFromComplexSample": "Musterhaus (komplex)",
|
||||
"menu.native.newFromTemplateFile": "Vorlagendatei wählen …",
|
||||
"menu.native.open": "Öffnen …",
|
||||
"menu.native.save": "Speichern",
|
||||
"menu.native.saveAs": "Speichern unter …",
|
||||
"menu.native.import": "Importieren …",
|
||||
"menu.native.export": "Exportieren",
|
||||
|
||||
@@ -132,6 +132,7 @@ export const en: Record<TranslationKey, string> = {
|
||||
"menu.native.newFromComplexSample": "Sample House (Complex)",
|
||||
"menu.native.newFromTemplateFile": "Choose Template File…",
|
||||
"menu.native.open": "Open…",
|
||||
"menu.native.save": "Save",
|
||||
"menu.native.saveAs": "Save As…",
|
||||
"menu.native.import": "Import…",
|
||||
"menu.native.export": "Export",
|
||||
|
||||
@@ -26,6 +26,7 @@ export interface NativeAppMenuHandlers {
|
||||
onNewProjectFromTemplate: () => void;
|
||||
onOpenProject: () => void;
|
||||
onSaveProject: () => void;
|
||||
onSaveProjectAs: () => void;
|
||||
onImport: () => void;
|
||||
onExportPdf: () => void;
|
||||
onExportDxf: () => void;
|
||||
@@ -173,10 +174,15 @@ export function useNativeAppMenu(
|
||||
action: () => handlersRef.current.onOpenProject(),
|
||||
}),
|
||||
await MenuItem.new({
|
||||
text: t("menu.native.saveAs"),
|
||||
text: t("menu.native.save"),
|
||||
accelerator: "CmdOrCtrl+S",
|
||||
action: () => handlersRef.current.onSaveProject(),
|
||||
}),
|
||||
await MenuItem.new({
|
||||
text: t("menu.native.saveAs"),
|
||||
accelerator: "CmdOrCtrl+Shift+S",
|
||||
action: () => handlersRef.current.onSaveProjectAs(),
|
||||
}),
|
||||
await MenuItem.new({
|
||||
text: t("menu.native.import"),
|
||||
action: () => handlersRef.current.onImport(),
|
||||
|
||||
@@ -124,7 +124,15 @@ export async function saveProjectFile(
|
||||
json: string,
|
||||
projectName: string,
|
||||
onSavedPath?: (path: string) => void,
|
||||
knownPath?: string | null,
|
||||
): Promise<boolean> {
|
||||
// „Speichern" (Cmd/Ctrl+S): bekannter Pfad → ohne Dialog atomar überschreiben.
|
||||
if (knownPath && isTauriRuntime()) {
|
||||
const { writeFileAtomic } = await import("./saveFile");
|
||||
await writeFileAtomic(knownPath, json);
|
||||
onSavedPath?.(knownPath);
|
||||
return true;
|
||||
}
|
||||
const filename = `${projectName || "projekt"}.${PROJECT_EXT}`;
|
||||
return saveTextFile(json, filename, "application/json", PROJECT_DIALOG_FILTERS, onSavedPath, true);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,15 @@ function key(
|
||||
} as KeyboardEvent;
|
||||
}
|
||||
|
||||
describe("Speichern-Kürzel", () => {
|
||||
it("Mod+S und Mod+Shift+S sind für Speichern/Speichern unter frei (Teilen = Mod+Shift+J)", () => {
|
||||
const combos = SHORTCUT_DEFS.map((d) => d.defaultCombo);
|
||||
expect(combos).not.toContain("mod+s");
|
||||
expect(combos).not.toContain("mod+shift+s");
|
||||
expect(SHORTCUT_DEFS.find((d) => d.id === "split")?.defaultCombo).toBe("mod+shift+j");
|
||||
});
|
||||
});
|
||||
|
||||
describe("SHORTCUT_DEFS", () => {
|
||||
it("hat für jede Id eine eindeutige Default-Kombination (keine eingebaute Kollision)", () => {
|
||||
const seen = new Map<string, string>();
|
||||
|
||||
@@ -82,7 +82,7 @@ export const SHORTCUT_DEFS: ShortcutDef[] = [
|
||||
labelKey: "shortcut.deleteSelection",
|
||||
defaultCombo: "Delete",
|
||||
},
|
||||
{ id: "split", category: "edit", labelKey: "shortcut.split", defaultCombo: "mod+s" },
|
||||
{ id: "split", category: "edit", labelKey: "shortcut.split", defaultCombo: "mod+shift+j" },
|
||||
{ id: "join", category: "edit", labelKey: "shortcut.join", defaultCombo: "mod+j" },
|
||||
{ id: "copyElements", category: "edit", labelKey: "shortcut.copyElements", defaultCombo: "mod+c" },
|
||||
{ id: "pasteElements", category: "edit", labelKey: "shortcut.pasteElements", defaultCombo: "mod+v" },
|
||||
|
||||
@@ -392,7 +392,7 @@ export function useSelectAllAndDeleteShortcut(opts: {
|
||||
}
|
||||
|
||||
/**
|
||||
* Ctrl/Cmd+S = Split, Ctrl/Cmd+J = Join der selektierten Drawing2D-Elemente.
|
||||
* Ctrl/Cmd+Shift+J = Split (Ctrl/Cmd+S ist Speichern), Ctrl/Cmd+J = Join der selektierten Drawing2D-Elemente.
|
||||
* Join läuft über DENSELBEN Engine-Befehl wie getipptes „join" (Sofort-
|
||||
* Befehl, autoRun). Split bleibt die direkte Aktion (`runSplit`, in App.tsx —
|
||||
* bleibt dort, da es auch für einen etwaigen Menü-Eintrag geteilt wird). Beide
|
||||
|
||||
@@ -104,6 +104,8 @@ export function useProjectFileActions(
|
||||
// Pfad + Lock-Status der aktuell offenen .obp/.json-Datei (nur Tauri; sonst
|
||||
// bleibt beides null/false — Browser-Blob-Pfad hat keinen echten Pfad).
|
||||
const openedProjectPathRef = useRef<string | null>(null);
|
||||
// Zielpfad für „Speichern" (Cmd/Ctrl+S): gesetzt beim Öffnen und nach „Speichern unter".
|
||||
const savePathRef = useRef<string | null>(null);
|
||||
const projectLockOwnedRef = useRef(false);
|
||||
// Konflikt-Zustand: Datei ist in einer anderen Instanz gesperrt → Dialog mit
|
||||
// „Schreibgeschützt öffnen"/„Trotzdem erzwingen"/„Abbrechen" (kein window.confirm!).
|
||||
@@ -371,11 +373,14 @@ export function useProjectFileActions(
|
||||
// Liefert `true`, wenn wirklich gespeichert wurde (nicht bei abgebrochenem
|
||||
// nativem Dialog) — `guardDiscard`-Aufrufer verlassen sich darauf, um NICHT
|
||||
// zu verwerfen, wenn der Nutzer den Speichern-Dialog abbricht.
|
||||
const onSaveProject = (): Promise<boolean> => {
|
||||
// Cmd/Ctrl+S „Speichern": bekannter Pfad → ohne Dialog; sonst wie „Speichern unter".
|
||||
// Cmd/Ctrl+Shift+S „Speichern unter" fragt immer nach dem Ziel.
|
||||
const saveProjectTo = (asNew: boolean): Promise<boolean> => {
|
||||
const json = serializeProject(project);
|
||||
return saveProjectFile(json, project.name, (path) =>
|
||||
addRecentProject(path, project.name || "modell"),
|
||||
).then(
|
||||
return saveProjectFile(json, project.name, (path) => {
|
||||
savePathRef.current = path;
|
||||
addRecentProject(path, project.name || "modell");
|
||||
}, asNew ? null : savePathRef.current).then(
|
||||
(saved) => {
|
||||
if (saved) {
|
||||
lastSavedProjectRef.current = project;
|
||||
@@ -392,6 +397,8 @@ export function useProjectFileActions(
|
||||
},
|
||||
);
|
||||
};
|
||||
const onSaveProject = (): Promise<boolean> => saveProjectTo(false);
|
||||
const onSaveProjectAs = (): Promise<boolean> => saveProjectTo(true);
|
||||
// „Neu" (Datei-Menü): leeres Projekt, wie am Startbildschirm — löst dabei
|
||||
// einen evtl. gehaltenen Datei-Lock der bisherigen Projektdatei und vergisst
|
||||
// deren Pfad (das leere Projekt ist noch NICHT gespeichert). Über
|
||||
@@ -467,6 +474,7 @@ export function useProjectFileActions(
|
||||
void releaseProjectLock(openedProjectPathRef.current);
|
||||
}
|
||||
openedProjectPathRef.current = null;
|
||||
savePathRef.current = null;
|
||||
projectLockOwnedRef.current = false;
|
||||
};
|
||||
// Übernimmt ein per Pfad geöffnetes Projekt (Tauri-Fluss): parst, prüft grob
|
||||
@@ -482,6 +490,7 @@ export function useProjectFileActions(
|
||||
releaseCurrentProjectLock();
|
||||
lastSavedProjectRef.current = loaded;
|
||||
openedProjectPathRef.current = path;
|
||||
savePathRef.current = path;
|
||||
projectLockOwnedRef.current = lockOwned;
|
||||
addRecentProject(path, loaded.name || "modell");
|
||||
offerRecovery(path);
|
||||
@@ -670,6 +679,7 @@ export function useProjectFileActions(
|
||||
setImportPdfOptions,
|
||||
loadImportLayout,
|
||||
onSaveProject,
|
||||
onSaveProjectAs,
|
||||
onNewProject,
|
||||
onNewProjectFromSample,
|
||||
onNewProjectFromComplexSample,
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ const TOOLS: Record<ToolId, ToolInfo> = {
|
||||
scalebar: { labelKey: "tool.scalebar", hintKey: "tool.scalebar.hint", command: "scalebar" },
|
||||
revcloud: { labelKey: "tool.revcloud", hintKey: "tool.revcloud.hint", command: "revcloud" },
|
||||
pointmarker: { labelKey: "tool.pointmarker", hintKey: "tool.pointmarker.hint", command: "pointmarker" },
|
||||
wand: { labelKey: "tool.wand", hintKey: "tool.wand.hint", command: "wand" },
|
||||
wand: { labelKey: "tool.wand", hintKey: "tool.wand.hint", command: "zauberstab" },
|
||||
grid: { labelKey: "tool.grid", hintKey: "tool.grid.hint", command: "grid" },
|
||||
wipeout: { labelKey: "tool.wipeout", hintKey: "tool.wipeout.hint", command: "wipeout" },
|
||||
text: { labelKey: "tool.text", hintKey: "tool.text.hint", command: "text" },
|
||||
|
||||
@@ -20,6 +20,7 @@ export interface AppMenuBarProps {
|
||||
onNewProjectFromTemplate: () => void;
|
||||
onOpenProject: () => void;
|
||||
onSaveProject: () => void;
|
||||
onSaveProjectAs: () => void;
|
||||
onImport: () => void;
|
||||
/** Datei: Punktwolke importieren ([27]). */
|
||||
onImportPointCloud?: () => void;
|
||||
@@ -65,6 +66,7 @@ export const AppMenuBar = memo(function AppMenuBar({
|
||||
onNewProjectFromTemplate,
|
||||
onOpenProject,
|
||||
onSaveProject,
|
||||
onSaveProjectAs,
|
||||
onImport,
|
||||
onImportPointCloud,
|
||||
onImportMesh,
|
||||
@@ -98,6 +100,7 @@ export const AppMenuBar = memo(function AppMenuBar({
|
||||
{ divider: true },
|
||||
{ label: t("file.open"), onSelect: onOpenProject },
|
||||
{ label: t("file.save"), onSelect: onSaveProject },
|
||||
{ label: t("menu.native.saveAs"), onSelect: onSaveProjectAs },
|
||||
{ divider: true },
|
||||
{ label: t("file.import"), onSelect: onImport },
|
||||
...(onImportPointCloud ? [{ label: t("menu.native.importPointCloud"), onSelect: onImportPointCloud }] : []),
|
||||
|
||||
@@ -22,8 +22,7 @@ ohne Fokus in der Befehlszeile sind dagegen Tastenkürzel (`m` Verschieben,
|
||||
- Eigene Kürzel legt man unter *Einstellungen → Allgemein →
|
||||
Befehlszeilen-Kürzel* an.
|
||||
|
||||
Kürzel werden vor dem Vervollständigen geprüft. Darum startet `wand` die
|
||||
**Wand** und nicht den Zauberstab – für den gibt es `zs` oder `zauberstab`.
|
||||
`wand` startet die **Wand**; der Zauberstab heisst `zauberstab` (Kürzel `zs`).
|
||||
Den Einzelbuchstaben `r` gibt es absichtlich nicht: er ist für relative
|
||||
Koordinaten reserviert.
|
||||
|
||||
@@ -135,7 +134,7 @@ Stand 5.11.2026, aus der Befehlsliste des Programms (`src/commands/registry.ts`)
|
||||
| `spline` | Spline | `sp` | Glatte Kurve durch Punkte |
|
||||
| `bezier` | Bezier | `bz` | Bézierkurve |
|
||||
| `wipeout` | Maskenregion | `wo`, `maske`, `maskierung` | Fläche, die Darunterliegendes abdeckt |
|
||||
| `wand` | Zauberstab | `zs`, `zauberstab` | Klick in umschlossene Fläche → Umriss mit Schraffur (Kürzel `zs`, nicht `wand`!) |
|
||||
| `zauberstab` | Zauberstab | `zs` | Klick in umschlossene Fläche → Umriss mit Schraffur |
|
||||
| `grid` | Achsraster | `axes`, `achsraster`, `achsen` | Rechtwinkliges oder radiales Achsraster mit Achsköpfen |
|
||||
| `block` | Block einfügen | `bl`, `symbol` | Block (Symbol) platzieren |
|
||||
| `defblock` | Block definieren | `db`, `blockdef` | Auswahl als Block speichern |
|
||||
|
||||
@@ -74,7 +74,6 @@ Stand 5.11.2026; die vollständige Liste führt
|
||||
|
||||
- Zeichnungs-Reiter werden nicht im Projekt gespeichert [136].
|
||||
- Ziehen von Griffen mit Fang ist im 3D noch nicht vollständig.
|
||||
- Mod+S ist doppelt belegt (Speichern / Teilen bei 2D-Auswahl).
|
||||
|
||||
**Modell und Pläne**
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@ ab. Einzeltasten (ohne Mod) gelten nur, solange kein Textfeld den Fokus hat.
|
||||
|---|---|
|
||||
| Mod+N | Neues Projekt (Menü der Desktop-App) |
|
||||
| Mod+O | Öffnen (Menü der Desktop-App) |
|
||||
| Mod+S | Speichern unter … (Menü der Desktop-App; bei gewählten 2D-Elementen: Teilen, siehe unten) |
|
||||
| Mod+S | Speichern (Datei der Desktop-App ohne Dialog überschreiben; neues Projekt: Zielwahl) |
|
||||
| Mod+Shift+S | Speichern unter … |
|
||||
| Mod+Z | Rückgängig |
|
||||
| Mod+Shift+Z, Strg+Y | Wiederholen |
|
||||
| Entf | Auswahl löschen |
|
||||
@@ -49,15 +50,14 @@ ab. Einzeltasten (ohne Mod) gelten nur, solange kein Textfeld den Fokus hat.
|
||||
|
||||
| Taste | Aktion |
|
||||
|---|---|
|
||||
| Mod+S | Teilen der gewählten 2D-Elemente |
|
||||
| Mod+Shift+J | Teilen der gewählten 2D-Elemente |
|
||||
| Mod+J | Verbinden der gewählten 2D-Elemente |
|
||||
| Mod+Shift+U | Vereinigen (Boolean) |
|
||||
| Mod+Shift+D | Abziehen (Boolean) |
|
||||
| Mod+Shift+I | Schneiden (Boolean) |
|
||||
|
||||
Mod+S ist doppelt belegt: Sind 2D-Elemente gewählt, teilt es sie; sonst
|
||||
speichert es. Wer das nicht mag, legt *Teilen* in den Einstellungen auf eine
|
||||
andere Kombination.
|
||||
Mod+S speichert immer; *Teilen* liegt auf Mod+Shift+J und lässt sich in den
|
||||
Einstellungen umlegen.
|
||||
|
||||
## Maus
|
||||
|
||||
|
||||
Reference in new issue
Block a user