[289] Linux-App: Strg-Kürzel über isPrimaryMod (Meta löst nichts mehr aus; neu Strg+N/P/Q/Plus/Minus), Kürzel-Anzeige je Plattform, Fensterknöpfe rechts, Scrollbalken/Schrift, gedoppelte Plan-Schrift unter WASM behoben
This commit is contained in:
22 files changed
+272
-70
No files matched your search
@@ -10,7 +10,7 @@ Wer zu einer ID mehr wissen will (Entscheide, Tests, Bilder), sucht dort nach `*
|
||||
stehen im Archiv („Bewusst nicht übernommen“).
|
||||
- **Grösse** (eine Person mit Agenten): S ≤ 1 Tag · M ≤ 1 Woche · L ≤ 1 Monat · XL > 1 Monat.
|
||||
Steht keine Grösse im Archiv, ist sie hier geschätzt.
|
||||
- **IDs sind stabil.** Neue ID = nächste freie Zahl nach der höchsten im Archiv und hier (aktuell 288);
|
||||
- **IDs sind stabil.** Neue ID = nächste freie Zahl nach der höchsten im Archiv und hier (aktuell 289);
|
||||
nie eine ID wiederverwenden oder umnummerieren. Präfix-IDs (`[K]`, `[G]`, `[T]`, `[B]`, `[C]`) bleiben.
|
||||
- **Pro Punkt:** was fehlt · wo im Code · Grösse. Höchstens ein bis drei Sätze je Punkt;
|
||||
Messwerte und Befunde gehören in den Commit.
|
||||
@@ -57,6 +57,7 @@ Kennwort, anonym) als PDF; Austausch mit Fachplanern über DXF/IFC.
|
||||
- ◐ **[266]** Wettbewerb einmal ganz durchgespielt (16.11., Chromium/Linux, Bilder `doc/review-266/`); alle Befunde behoben bis auf: GV (18.11., `flaechen.rs`): Studienkörper (frei, ≥ 9 m² Grundfläche und ≥ 2.4 m hoch) zählen, aber nur ausserhalb der Geschossgrundrisse (innerhalb sonst doppelt); Bodenplatte = Decke unter dem untersten Geschoss zählt von ihrer UK bis Fertigboden (SIA 416: untere Begrenzung = Unterseite der untersten Bodenkonstruktion; Fundamente/Kies/Magerbeton nicht) — FRAGE: SIA-416-Wortlaut zu Fundamenten/Sauberkeitsschicht nicht im Repo, gegen die Norm prüfen; Schwellen 9 m²/2.4 m sind Annahmen (Alternative: Merkmal „Gebäudekörper" am Körper); Aufstockungen über dem Haus als Geschoss modellieren, nicht als Körper. Offen: Innenhöfe ohne Dach werden im Dachraum gefüllt (`core/building_volume.rs`); Tabellen wandern aufs 2. Blatt trotz freier Spalten oben (`presentation_poster.rs`); Schnittmarken im Plakat: Marken ungewählter Schnitte erscheinen mit, Linien > 40 mm Papier vom Haus beschnitten, beim Blatt ohne Plakat keine Marken; Plakat-Grundrisse zeigen alle Bemassungsketten statt nur Gesamtmass; Situation: eigenständige Layouts „Situation WBW“ setzen Nordpfeil/Massstab weiter unter die Lage, Kataster-Gebäude unter eigenem Fussabdruck nicht ausgeblendet; Wendeltreppen und Treppen nach unten/Teilhöhe bekommen kein Deckenloch automatisch (`stair_hole_ops`, `cmd_solid.rs`); 3D-Dokument ([266]/12, `plan/axo.rs`): nicht auf dem Mac geprüft (passt die Zeichnung zur 3D-Kamera?), kein eigener Reiter (nur Blatt-Viewport), kein Live-Schnitt, Fenster als Löcher ohne Rahmen/Glas, keine Rückseiten verdeckter Flächen, Gelände nicht, Kontext-Netze nur mit `context`, Flächen < 1/1200 Bildbreite ungetönt. Nicht geprüft: Tauri-App/Mac (Metal, 3D-Bild, Schatten, Rendering), Mausbedienung, Druck des A1-Plakats, DXF/IFC in Fremdsoftware. · M
|
||||
- ◐ **[286]** Umbau: Ecken sanierter Wände schichtweise statt Gehrung (18.11., Wunsch Maintainer: Abbruch nicht schräg durch die Ecke). Ursache: L-Ecken waren je Wand eine einzige Gehrungslinie durch alle Schichten (`joins.rs`, `join_priority` wirkte nur am T-Stoss). Neu `joins::layered_corner`: ist eine Wand der Ecke saniert, läuft die dominante Schicht durch (höhere Priorität bis zur äusseren Kernfläche des Nachbarn, gleiche ⇒ Gehrung der Kerne), Abbruch-/neue Schichten enden rechtwinklig bündig mit dem Kernende, die Schichten der bleibenden Nachbarwand laufen bis zur Fläche der sanierten (beide saniert ⇒ Gehrung je Zone); Stirnlinien gestrichelt im Abbruch. Dominante Schicht wählbar je Typ-Paar (Panel Umbau › Sanierung, `WallType.renovationCore`, Vorgabe: bleibende Schicht mit höchster Priorität, dann dickste; `renovation::build_up::core_of`). Grundriss, 3D und Schnitt aus denselben Schnitten; Wände ohne Sanierung unverändert (Goldens ohne Diff); Prüfbild `doc/review-286/ecke.png` (`:umbau` 1:20 `--hatch`, Abbruch-/Umbauplan vorher/nachher). Offen: in der Umbauplan-Darstellung fehlt die Fuge zwischen Beton der sanierten Wand und Dämmung des Nachbarn (gleiche Bestandsfarbe); Bogenwände und Knoten mit ≥ 3 Wänden bleiben auf Gehrung; Ecke im 3D nicht angesehen (kein render3d unter Linux); nicht in der Tauri-App geprüft; dominante Schicht nicht im Schicht-Editor des Wandtyps (nur im Typ-Paar). · S
|
||||
- ◐ **[287]** UX-Prüfung „wie eine Architektin zeichnen“ (18.11., Chromium/Linux, 1280×800 hell, nur Maus und Tastatur: leeres Projekt, Wandzug mit Klicks/getippter Länge/Winkel, Ring schliessen, Fenster/Tür, Raum, Treppe, Bemassung, Text, Decke, Auswahl/Verschieben/Griff, Ctrl+Z, Ebenen-/Schnittwechsel; Bilder `doc/review-287/`; nicht geprüft: 3D umschauen (headless kein WebGPU), Layout/Plakat, Umbau-Status, Wandtyp-Wechsel, Spiegeln/Drehen bis zum Ergebnis, Mac). Behoben: Klick auf den Startpunkt schliesst den Wandring (≥ 3 Wände) und legt ihn an — vorher blieb der Befehl offen und das gewohnte Esc-Esc verwarf alle gezeichneten Wände (`cmds/wall.ts`, vitest `wallClose.test.ts`) · Befehlszeile bei schmaler Mitte (Docks offen): Optionen/Felder/Eingabe liefen rechts aus dem Bild (Treppe: „Trittmass=“ abgeschnitten, Felder unsichtbar) — die Zeile wächst jetzt nach oben über die Zeichenfläche, Zoom springt nicht (`ui/CommandLine.tsx` `cmdline-row`, `styles.css`) · Cursor-HUD beschriftet Felder mit ihrer Bezeichnung statt der Feld-ID („pos/Δx/Δy/sill“ → „Abstand/Breite/Höhe/Brüstung“, „steps/rise“ → „Stufen/Steighöhe“, `tools/hudFormat.ts`) · Optionswerte der Befehlszeile übersetzt („Art=window“, „Grundform=straight“, „Auf/Ab=up“, „Trittmass=without“, „Modus=inside“, `cmds/opening.ts`, `stair.ts`, `room.ts`) · Fangmarker tragen die Fangart als Kurztext („Mitte“, „Endpunkt“, „Schnittpunkt“ …, `planView/overlays.tsx`) · Statusleiste links zeigt bei aktivem Werkzeug/Befehl dessen Namen statt „Auswahl“ (`App.tsx`). Offen, nach Ärger sortiert: (1) Griff-/Verschiebe-Zug übernimmt beim Loslassen nicht, sondern bleibt „bewaffnet“ bis zum nächsten Klick (Wand/Fenster wirken verschoben, sind es aber nicht; Esc/Ctrl+Z verwirft) — Archicad/VW setzen beim Loslassen, bekannt aus [204](h) als „gewollt“, `state/useGripEditing.ts` · M; (2) ERLEDIGT 18.11.: Wandzug — Esc beendet einen offenen Zug (≥ 2 Punkte) und BEHÄLT die Wände (nur die Gummiband-Wand fällt weg), zweites Esc verlässt das Werkzeug; die Vorgabe [99] („Esc = ein Punkt zurück“) gilt damit nur noch für die übrigen Befehle, weil Archicad/Vectorworks so arbeiten und Esc-Esc vorher stumm alles verwarf (`Command.onEscape`, `cmds/wall.ts`, `engine.ts` `escape`, vitest `engine.keys.test.ts`) · (3) ERLEDIGT 18.11.: Länge + Enter legt das Segment sofort in Mausrichtung an (Richtung klar), Winkel nur mit Tab zusätzlich; die Vorschau folgt dem getippten Wert beim Tippen (`Command.commitsOnLock`, `engine.previewTyped`, `submitText(…, viaTab)`) · (4) ERLEDIGT 18.11.: Fenster/Tür mit EINEM Klick auf die Wand (Wand aus dem Treffer), beim Überfahren Vorschau mit Abständen zu Wandanfang/-ende; ein vorher getippter Abstand gilt statt der Maus (`cmds/opening.ts`, `openingDistance.test.ts`) · (5) ERLEDIGT 18.11.: ein Buchstabe auf der Zeichenfläche ohne Kürzel und ohne Eingabefokus öffnet die Befehlszeile, „w“ + Enter startet die Wand (`useTypeToCommandLine` in `state/useKeyboardShortcuts.ts`, nur im Ruhezustand, Kürzel gehen vor; e2e `drawingUx287.spec.ts`) · (6) Objekt-Info bei Mehrfachauswahl zeigt die Werte des ersten Elements unter „Wand“, kein „2 Wände“/„gemischt“ (`panels/objectInfo`) · S; (7) Anfangsansicht des leeren Projekts zeigt 60 × 60 m (≈ 21 px/m, Raumtext 3 px hoch) und „1:179 56 %“ neben dem Massstab „1:100“ — zwei Zahlen, die verwirren (`views/plan`, Topbar) · S; (8) Tab „+“ öffnet eine zweite Ansicht „Erdgeschoss“ mit gleichem Namen, kein neues Geschoss (Geschoss-Plus steht in der Ebenenliste) · S; (9) Fangmarker bleiben ≈ 5 px klein und gelb auf schwarzem Wandfüll; grösser/mit Kontrastring (`overlays.tsx` `markSize`) · S; (10) Ctrl+V fügt am selben Ort ohne Vorschau ein (Kopie unsichtbar, nur „Auswahl: 2 Wände“) · S; (11) Prompt „Nächster Punkt ( Fertig Zurück ):“ ohne Trennzeichen, Wand-Optionen „Bogen=aus“/„Wandtyp=aktiv“ uneinheitlich; Prompt bleibt bei aktivem Werkzeug zwischen zwei Objekten „Befehl:“ (`i18n`, `cmds/*`) · S; (12) Werkzeug-Tooltips nennen kein Tastenkürzel (Wand = „w“ + Enter über die Befehlszeile, jetzt auch direkt auf der Fläche getippt) · S. Nicht in der Tauri-App geprüft. · M Wandzug wird erst mit Enter/Leertaste/Rechtsklick angelegt und Esc-Esc verwirft alles ohne Rückfrage (Vorgabe [99]) — für offene Züge Esc = „beenden und behalten“ (≥ 2 Punkte), `cmds/wall.ts` `onCancel` · S; Länge tippen + Enter sperrt nur die Länge, das Winkelfeld braucht ein zweites Enter, und die Vorschau folgt dem getippten Winkel erst nach Tab/Enter, nicht beim Tippen (`commands/engine.ts` `lockActiveField`; Vorschlag: Enter übernimmt mit Mauswinkel, Tab für Winkel) · S–M; Fenster/Tür: zwei Klicks (erst Wand, dann Position) und beim Überfahren der Wand keine Öffnungs-Vorschau; Archicad setzt mit einem (`cmds/opening.ts`) TiLine truncated
|
||||
- ◐ **[289]** Linux-App auf Mac-Niveau (18.11., Befund Maintainer): (1) Kürzel: zentraler Helfer `isPrimaryMod(e)` (`state/platform.ts`; Mac = Cmd, sonst nur Strg, Super löst unter Linux nichts mehr aus — vorher undo auf Meta+Z) in `comboMatches`/`comboFromEvent`, Rich-Text, Objekt-Fenster, Alles-wählen; neu ausserhalb von Tauri Strg+N, Strg+P (PDF-Dialog), Strg+Q, Strg+Plus/Minus (Plan-Zoom), bisher nur im Mac-Menü bzw. gar nicht; Kürzel-Anzeige im Menü (Datei/Bearbeiten) und in Rich-Text-Tooltips plattformgerecht (`Strg+S`/`⌘S`). (2) UI: Fensterknöpfe rechts in Reihenfolge Minimieren/Maximieren/Schliessen (statt Mac-Ampel-Reihenfolge links), `topbar-native-inset` nur auf macOS, `data-platform` am Wurzelelement, dezente Scrollbalken und Schrift-Fallbacks (Cantarell, Noto Sans, DejaVu) unter Linux. (3) Gedoppelte Schrift: unter WASM (Browser, Linux/Electron) zeichnete das SVG-Overlay alle waagrechten `drawingText` zusätzlich zur render2d-Szene; jetzt Regel `svgDrawsTextOverGpu` (`plan/nativeText.ts`, vitest): jeder Text genau einmal, SVG nur gedrehte. Tests: `platform.test.ts`, `nativeText.test.ts`, `linuxApp170.spec.ts` (Strg+Z/Umschalt+Z/Y/S/N/P, Meta tut nichts), `commandKeys` grün. Bild `doc/review-289/linux.png` (vorher `linux-vorher.png`). Offen: Doppeltext nur per Regel-Test belegt, im Container zeichnet render2d unter SwiftShader nicht (SVG-Ersatz), echte GPU nicht geprüft; Text im Editor bleibt unter dem weissen Editorfeld in der Szene (kein Skip-Index wie bei Metal); native Datei-/Kontextmenüs und Desktop-Datei nicht angefasst; Mac/Tauri nicht geprüft. · S
|
||||
- ◐ **[288]** Fangpunkte und Griffe wie Vectorworks (18.11., Wunsch Maintainer): je Fangart ein eigenes Symbol mit Kontrastrand (Endpunkt Quadrat, Mitte Dreieck, Schnittpunkt X, Lot Winkel, Zentrum Kreis, auf Kante Raute, Ortho/Verlängerung Plus) und Hinweis-Schildchen am Zeiger, bei Ortho/Verlängerung mit Richtung/Abstand (`tools/snapGlyph.ts` + vitest, `planView/overlays.tsx`; löst [287] (9)); Auswahlgriffe als kleine gefüllte Quadrate fester Bildschirmgrösse, Hover grösser/hohl, Einfüge-Griffe kleiner hohl (`PlanView.tsx`, `constants.ts` `gripSquareHalfPx`, 3D-Eckgriffe ebenso); Kanten-Anfasser zum Parallelverschieben erst nach Kantenauswahl: zweiter Klick auf eine Kante des Gewählten markiert sie, Esc hebt nur sie auf (`planView/edgeSelection.ts` + vitest, e2e `edgeSelect288.spec.ts`, `kataster`/`roofGrips` angepasst). Bilder `doc/review-288/`. Offen: Cmd/Ctrl-Klick als zweiter Weg nicht umgesetzt (öffnet bereits die Objektliste [137]); Griff-Zug übernimmt weiter erst beim nächsten Klick ([287] (1), 11 e2e-Specs setzen das voraus); 3D-Kanten-Anfasser unverändert; nicht in der Tauri-App/auf dem Mac geprüft.
|
||||
- ◐ **[285]** Referenz-Ablauf zum zweiten Mal durchgespielt (18.11., Chromium/Linux, Haus 18 × 11 m, 2 Geschosse, 4 Wohnungen, Bilder `doc/review-285/`; nicht auf dem Mac, kein 3D-Live/Rendering/Druck). Behoben: Gesamthöhe (Baurecht, Kennzahlen) zählt die Attika (`site_rules.rs` `model_top`; vorher 5.80 statt Oberkante Attika, Ansicht zeigte +6.30; `KURZANLEITUNG` „Höhe 9.50" nicht neu geprüft). Offen, nach Schritt: Baurecht: Meldung „Gebäude innerhalb der zulässigen Fläche" steht grün schon ohne Bauteil (`panels/SiteRulesSection.tsx`) · S. Volumen: `decke` setzt die Decke immer oben ans aktive Geschoss, Bodenplatte unter EG und Balkonplatte brauchen je 6 Schritte in der Objekt-Info (OK/UK „Eigene"), kein Befehl/Option dafür (`cmds/ceiling.ts`) · S; `wand` hat keine Wandtyp-Option (Innenwände nachträglich umstellen) und setzt „Aussenbauteil"/„Tragend" nie, dadurch kein IsExternal an Aussenwänden im IFC und U-Wert „unvollständig (4 Schicht(en) ohne λ)" für den Standardaufbau (`cmds/wall.ts`, Standard-Wandtypen) · S; Zeichnungsebene „kataster" liegt im Arbeitsgrundriss über den neuen Wänden (Kataster-Gebäude deckt sie zu, bis man die Ebene ausblendet) · S; Fenster-Befehl: eine Zahl bei „Position entlang der Wand (Abstand tippen)" setzt stillschweigend die Breite (3 m statt Abstand 3 m, `cmds/opening.ts`) · S; Rampe: falsche Richtung (Anfang aussen, +6 %) hebt die Rampe über Geschosshöhe ohne Hinweis (`cmds/ramp.ts`) · S. Räume/Einheiten: `raum` legt je Aufruf nur einen Raum an, Name/Nutzung/Kategorie je Raum einzeln (10 Räume ≈ 40 Eingaben) · M; Einheit löschen/verschieben lässt leere Einheiten („0 Zi · 0.0 m²") und zählt Nummern weiter (Whg 5, 6) · S; Statusleiste: Feld „Ebene" zeigt die Klasse („20 Wände"), „Geschoss" die Zeichnungsebene (Bezeichnungen nach [180] vereinheitlichen, `ui/StatusBar.tsx`) · S; Projektname bleibt „Leeres Projekt" (Titel von Plakat/Spiegel), bis er im Mappe-Panel gesetzt wird · S. Abgabe (18.11. behoben, `presentation_sheet.rs`/`presentationSheet.ts`/`PresentationDialog.tsx`: Dialog bietet feineren Massstab (≥ 1:100) mit Knopf an, wenn er aufs Blatt passt; Situation = Parzelle (`siteRules.parcel`) ∪ Haus ± 10 m statt Haus ± 40 m, ohne Parzelle ± 30 m; Wohnungsspiegel als dritte Plakat-Tabelle bei Projekten mit Einheiten (`posterExtrasDefault`); nur Chromium/Vitest geprüft, Prüfbild `doc/review-285/r4-plakat-nachher.png` ist eine Rahmen-Skizze der Anordnung, kein gerenderter Plan; Tabellen füllen das Blatt weiter nur rechts neben der letzten Zeile, bei 3 Tabellen im Beispiel 2. Blatt; Axo-Bild bleibt auf die Grösse des grössten Grundrisses begrenzt — beides am 18.11. behoben, s. „Plakat gefüllt“) · Axo: Bäume fehlen (Entourage-Objekte da), Rampe/Haustür auf der abgewandten Seite nicht zu sehen (`plan/axo.rs`) · S. Geprüft ok: Kataster-Import und Baurecht-Zahlen (484 m² zulässig, AZ 0.41, ÜZ 0.23), GV mit Bodenplatte (686.8 = 603.5 + 83.3 m³), Wohnungsspiegel CSV/SVG, Kosten (1'094 CHF/m³), Plakat anonym (Kennwort im Titel, Projektname nirgends im PDF), PDF-Ebenen (17 OCG), IFC (Geländer, Träger, Rampe, Treppe, Dach, Räume), DXF. Nicht durchgespielt: Umbau (Abbruch Kataster-Bestand) und Varianten (nur Hinweise „noch kein Variantensatz"/„Zuerst Bauteile wählen" gesehen), Rendering-Fenster, Mac. · M Behoben (19.11., Bedienung/Modell): Baurecht-Meldung „innerhalb der zulässigen Fläche" erst mit Gebäude (sonst „Noch kein Gebäude gezeichnet", neutral) · `decke`: Option „Lage" (oben / unter dem Geschoss = Bodenplatte / frei mit getippter Oberkante, Kern `top`) · `wand`: Optionen „Wandtyp" (reihum durch die Projekt-Typen) und „Aussenbauteil" (nach Typ / ja / nein); Vorgabe `isExternal` nach dem Wandtypnamen („Aussenwand" ⇒ aussen, „Innenwand" ⇒ innen), der IFC-Export schreibt `IsExternal` nur mit Angabe im Modell (`ifc_data.rs`) · Standard-Baustoffe des Beispiel-/Leerprojekts (`sampleProject.ts`) haben λ (SIA-Richtwerte, wie `core/standards.rs`), U-Wert nicht mehr „unvollständig" · Fenster/Tür: getippte Zahl im Positionsschritt = Abstand (neues erstes Tab-Feld „Abstand"), nicht Breite · Rampe: Hinweis, wenn sie über die Geschosshöhe steigt bzw. tiefer als eine Geschosshöhe fällt · Axo: Bäume (Stamm + Krone) wie im 3D (`furniture_3d::with_context_meshes`). Nicht auf dem Mac/in der Tauri-App geprüft. Entschieden und behoben (18.11., Koordinator; Chromium/Linux, nicht auf dem Mac): Kataster/Kontext deckt im Arbeitsgrundriss die Wände nicht mehr zu — Gruppenreihenfolge und Goldens bleiben, stattdessen zeigt der Arbeitsgrundriss (Bildschirm, `contextUnderlay` aus `viewportContent.tsx`, nie Druck/PDF/SVG/CLI) Klassen „als Unterlage“ mit Deckkraft 0.35 (`drawings.rs` `underlay_class`, über den vorhandenen Transparenz-Rahmen der Senke, auch in der kompakten Linien-Unterlage); Schalter „Als Unterlage“ je Klasse (`LayerCategory.underlay`, KlLine truncated
|
||||
- ◐ **[270]** Blickrichtungen überall gleich (3D-Spiegelung behoben, Marken weichen aus; 17.11.). Offen: 3D-Bild nur numerisch (Kameramatrix, Pick-Strahl) geprüft, kein Bild aus render3d unter Linux, nicht auf dem Mac/Metal (`doc/RELEASE-1.0.md` 13.36); natives Spike-Fenster `src-tauri/src/native.rs` (Orbit-Richtung) nicht angepasst. · M
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 94 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 105 KiB |
+46
-1
@@ -16,6 +16,7 @@ import { tmpdir } from "node:os";
|
||||
import { join, resolve } from "node:path";
|
||||
|
||||
const BIN = process.env.DOSSIER_ELECTRON_BIN ?? "";
|
||||
const SHOT_DIR = process.env.DOSSIER_SHOT_DIR ?? "";
|
||||
|
||||
test.skip(!BIN || !existsSync(BIN), "kein Electron-Paket (DOSSIER_ELECTRON_BIN), s. npm run test:linux-app");
|
||||
test.describe.configure({ mode: "serial" });
|
||||
@@ -377,7 +378,6 @@ test("Cycles: mitgeliefert, cyclesAvailable, runCycles rendert haus (8 Samples)
|
||||
// Vorgabe), 320 × 180 mit 8 Samples rendern, Fortschritt „Sample n von 8“ wird angezeigt (ein Beobachter hält jeden Text fest, das Rendern
|
||||
// ist schneller als ein Abfragetakt), Bild erscheint, „Ins Layout einsetzen“, Arbeitsordner aufgeräumt. Zweiter Test: Abbrechen mitten im
|
||||
// Lauf. Läuft nur, wenn das Paket mit Cycles gebaut wurde. Mit `DOSSIER_SHOT_DIR=<ordner>` legt der Test Bilder des Dialogs ab.
|
||||
const SHOT_DIR = process.env.DOSSIER_SHOT_DIR ?? "";
|
||||
async function dialogShot(page: Page, name: string): Promise<void> {
|
||||
if (SHOT_DIR) {
|
||||
mkdirSync(SHOT_DIR, { recursive: true });
|
||||
@@ -512,3 +512,48 @@ test("Cycles im Rendering-Dialog: Abbrechen mitten im Lauf beendet den Prozess u
|
||||
expect(renderDirs().filter((d) => !before.includes(d))).toEqual([]);
|
||||
await close(r);
|
||||
});
|
||||
|
||||
// [289] Tastenkürzel mit Strg in der echten Linux-App (kein natives Menü): Undo/Redo, Speichern, Neu, Drucken. Die Super-Taste
|
||||
// (Meta) löst unter Linux nichts aus. Mit `DOSSIER_SHOT_DIR=<ordner>` legt der Test ein Bild der Oberfläche als `linux.png` ab.
|
||||
test("Strg-Kürzel: Undo/Redo, Speichern, Neu, PDF-Dialog; Meta tut nichts; Titelleiste ohne Mac-Einrückung", async () => {
|
||||
const r = await launch();
|
||||
const { page } = r;
|
||||
await page.getByRole("button", { name: /Neues Projekt/ }).first().click();
|
||||
await expect(page.getByRole("group", { name: "Befehlszeile" })).toBeVisible({ timeout: 60_000 });
|
||||
await page.getByRole("tab", { name: "Elemente", exact: true }).click();
|
||||
await drawWalls(page, ["0,0", "6,0"]);
|
||||
await expect(elementRows(page)).toHaveCount(1);
|
||||
await drawWalls(page, ["6,0", "6,4"]);
|
||||
await expect(elementRows(page)).toHaveCount(2);
|
||||
if (SHOT_DIR) {
|
||||
mkdirSync(SHOT_DIR, { recursive: true });
|
||||
await page.screenshot({ path: join(SHOT_DIR, "linux.png") });
|
||||
}
|
||||
const blur = () => page.evaluate(() => (document.activeElement as HTMLElement | null)?.blur());
|
||||
await blur();
|
||||
await page.keyboard.press("Meta+z"); // Super: nichts
|
||||
await expect(elementRows(page)).toHaveCount(2);
|
||||
await page.keyboard.press("Control+z");
|
||||
await expect(elementRows(page)).toHaveCount(1);
|
||||
await page.keyboard.press("Control+Shift+z");
|
||||
await expect(elementRows(page)).toHaveCount(2);
|
||||
await page.keyboard.press("Control+z");
|
||||
await expect(elementRows(page)).toHaveCount(1);
|
||||
await page.keyboard.press("Control+y");
|
||||
await expect(elementRows(page)).toHaveCount(2);
|
||||
// Titelleiste: keine Mac-Einrückung für Ampeln, Plattform am Wurzelelement.
|
||||
expect(await page.evaluate(() => document.documentElement.dataset.platform)).toBe("linux");
|
||||
expect(await page.evaluate(() => getComputedStyle(document.querySelector("header.topbar")!).paddingLeft)).not.toBe("88px");
|
||||
await page.keyboard.press("Control+s");
|
||||
await expect.poll(() => existsSync(obp) && wallsIn(obp)).toBe(2);
|
||||
await page.keyboard.press("Control+p");
|
||||
await expect(page.getByRole("dialog", { name: "PDF/SVG exportieren" })).toBeVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(page.getByRole("dialog", { name: "PDF/SVG exportieren" })).toBeHidden();
|
||||
await blur();
|
||||
await page.keyboard.press("Control+n");
|
||||
const discard = page.getByRole("button", { name: "Nicht speichern" });
|
||||
if (await discard.isVisible({ timeout: 1500 }).catch(() => false)) await discard.click();
|
||||
await expect(elementRows(page)).toHaveCount(0);
|
||||
await close(r);
|
||||
});
|
||||
+16
-2
@@ -418,7 +418,7 @@ export default function App() {
|
||||
);
|
||||
const {
|
||||
projectFileInputRef, projectTemplateFileInputRef, openImportForFile, onSaveProject, onSaveProjectAs, onRestoreBackup,
|
||||
onNewProject, onNewProjectFromSample, onNewProjectFromComplexSample, onNewProjectFromWettbewerbSample, onNewProjectFromUmbauSample, onNewProjectFromVariantenSample, onNewProjectFromTemplate,
|
||||
onNewProject, onQuitApp, onNewProjectFromSample, onNewProjectFromComplexSample, onNewProjectFromWettbewerbSample, onNewProjectFromUmbauSample, onNewProjectFromVariantenSample, onNewProjectFromTemplate,
|
||||
onProjectTemplateFileChosen, onExportIfc, onExportObj, onExportStl, onOpenProject, onProjectFileChosen,
|
||||
} = files;
|
||||
|
||||
@@ -607,7 +607,21 @@ export default function App() {
|
||||
const fitSelectionKey = () => (planViewRef.current ? planViewRef.current.fitSelection() : fitView3d());
|
||||
registerSelectionActions({ fitAll: fitAllKey, fitSelection: fitSelectionKey });
|
||||
useFitShortcuts(fitAllKey, fitSelectionKey, shortcutOverrides);
|
||||
useFileShortcuts({ save: onSaveProject, saveAs: onSaveProjectAs, open: onOpenProject }); // [170] ohne natives Menü
|
||||
// [170] ohne natives Menü; [289] auch Neu/Drucken/Beenden/Zoom (wie CmdOrCtrl im Mac-Menü)
|
||||
const zoomKey = (f: number) => {
|
||||
const v = planViewRef.current;
|
||||
if (v) v.setCamera(v.viewCenterModel(), v.pxPerMeter() * f);
|
||||
};
|
||||
useFileShortcuts({
|
||||
save: onSaveProject,
|
||||
saveAs: onSaveProjectAs,
|
||||
open: onOpenProject,
|
||||
new: onNewProject,
|
||||
print: () => setExportOpen(true),
|
||||
quit: onQuitApp,
|
||||
zoomIn: () => zoomKey(1.25),
|
||||
zoomOut: () => zoomKey(0.8),
|
||||
});
|
||||
// Papier-Massstab anwenden: gewählten Nenner merken UND den Plan-Zoom exakt
|
||||
// auf 1:N setzen (PlanView rechnet die viewBox aus N + Canvas + dpi).
|
||||
const applyScale = (n: number) => {
|
||||
|
||||
@@ -149,6 +149,7 @@ export {
|
||||
NativeTextSync,
|
||||
isGpuText,
|
||||
isSceneText,
|
||||
svgDrawsTextOverGpu,
|
||||
} from "../plan/nativeText";
|
||||
|
||||
export {
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
// zwischen Block-Elementen (div/p) zählt je eine Absatzgrenze als +1. So entsteht
|
||||
// ein linearer Zeichen-Offset, der mit TextRange kompatibel ist.
|
||||
|
||||
import { formatCombo } from "../state/keyboardShortcuts";
|
||||
import { isPrimaryMod } from "../state/platform";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { t } from "../i18n";
|
||||
import { docToHtml } from "../text/renderHtml";
|
||||
@@ -568,7 +570,7 @@ export function RichTextEditor({
|
||||
|
||||
// Standard-WYSIWYG-Kürzel (Cmd auf macOS, Ctrl sonst) — bisher fehlten
|
||||
// sie komplett, nur die Toolbar-Buttons konnten Marks umschalten.
|
||||
const mod = e.metaKey || e.ctrlKey;
|
||||
const mod = isPrimaryMod(e);
|
||||
if (mod && !e.altKey) {
|
||||
const k = e.key.toLowerCase();
|
||||
if (k === "b" || k === "i" || k === "u") {
|
||||
@@ -688,7 +690,7 @@ export function RichTextEditor({
|
||||
<button
|
||||
type="button"
|
||||
className={`rt-btn${isBold ? " rt-btn--active" : ""}`}
|
||||
title={`${t("rt.bold")} (Cmd/Ctrl+B)`}
|
||||
title={`${t("rt.bold")} (${formatCombo("mod+b")})`}
|
||||
onMouseDown={(e) => {
|
||||
e.preventDefault();
|
||||
handleToggleMark("bold");
|
||||
@@ -701,7 +703,7 @@ export function RichTextEditor({
|
||||
<button
|
||||
type="button"
|
||||
className={`rt-btn${isItalic ? " rt-btn--active" : ""}`}
|
||||
title={`${t("rt.italic")} (Cmd/Ctrl+I)`}
|
||||
title={`${t("rt.italic")} (${formatCombo("mod+i")})`}
|
||||
onMouseDown={(e) => {
|
||||
e.preventDefault();
|
||||
handleToggleMark("italic");
|
||||
@@ -714,7 +716,7 @@ export function RichTextEditor({
|
||||
<button
|
||||
type="button"
|
||||
className={`rt-btn${isUnderline ? " rt-btn--active" : ""}`}
|
||||
title={`${t("rt.underline")} (Cmd/Ctrl+U)`}
|
||||
title={`${t("rt.underline")} (${formatCombo("mod+u")})`}
|
||||
onMouseDown={(e) => {
|
||||
e.preventDefault();
|
||||
handleToggleMark("underline");
|
||||
|
||||
+3
-1
@@ -1,5 +1,6 @@
|
||||
// Einstieg der Oberfläche (Vite, `index.html`): setzt Hell/Dunkel, unterdrückt Browser-Gesten, lädt den
|
||||
// Rust-Kern (`initCore`) und mountet dann die App oder, je nach `?window=…`, ein macOS-Nebenfenster.
|
||||
import { isPrimaryMod, platformName } from "./state/platform";
|
||||
import { StrictMode } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import App from "./App";
|
||||
@@ -24,6 +25,7 @@ import "./text/fonts.css";
|
||||
// eigenes Dokument und mountet über dieselbe main.tsx) — verhindert einen
|
||||
// Hell/Dunkel-Flackerer beim Laden.
|
||||
applyThemeMode(getStoredThemeMode());
|
||||
document.documentElement.dataset.platform = platformName(); // [289] CSS-Haken je Plattform (Scrollbalken, Schrift)
|
||||
|
||||
/** Eigenes natives Nebenfenster statt der Haupt-App? Steuert per URL-Query,
|
||||
* welcher Root gemountet wird (siehe native/resourceWindow.ts bzw.
|
||||
@@ -74,7 +76,7 @@ document.addEventListener("contextmenu", (e) => e.preventDefault());
|
||||
// 2) Ctrl/Cmd+A („Alles markieren") außerhalb echter Eingaben unterbinden.
|
||||
// In Eingaben bleibt es das normale Markieren des Feldinhalts.
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if ((e.ctrlKey || e.metaKey) && (e.key === "a" || e.key === "A")) {
|
||||
if (isPrimaryMod(e) && (e.key === "a" || e.key === "A")) {
|
||||
if (!isTextEntry(document.activeElement)) e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
// seine Projekt-Änderungen gehen als Ops ans Hauptfenster (`changeSink.ts`), Host-Handler ebenso. Cmd+Z/
|
||||
// Cmd+Shift+Z wirken auf den Verlauf des Hauptfensters; Esc schliesst das Fenster.
|
||||
|
||||
import { isPrimaryMod } from "../state/platform";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { t } from "../i18n";
|
||||
import { PanelHostProvider } from "../panels/host";
|
||||
@@ -75,7 +76,7 @@ export function ObjectSettingsWindowApp() {
|
||||
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (isTextEntry(document.activeElement)) return;
|
||||
const mod = e.metaKey || e.ctrlKey;
|
||||
const mod = isPrimaryMod(e);
|
||||
if (mod && (e.key === "z" || e.key === "Z")) {
|
||||
e.preventDefault();
|
||||
send(e.shiftKey ? "redo" : "undo");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import type { Primitive } from './generatePlan';
|
||||
import { NativeTextSync, cssColorToRgba, isGpuText, isRotated, isSceneText } from './nativeText';
|
||||
import { NativeTextSync, cssColorToRgba, isGpuText, isRotated, isSceneText, svgDrawsTextOverGpu } from './nativeText';
|
||||
|
||||
const txt = (id: string, over: Record<string, unknown> = {}) =>
|
||||
({ kind: 'drawingText', drawingId: id, at: { x: 1, y: 2 }, text: 'A', heightM: 2, angle: 0.5, color: '#ff0000', ...over }) as unknown as Primitive;
|
||||
@@ -62,3 +62,24 @@ describe('NativeTextSync.delta', () => {
|
||||
expect(d.remove).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('svgDrawsTextOverGpu [289]: jeder Text genau einmal', () => {
|
||||
const stamp = { kind: 'text', at: { x: 0, y: 0 } } as unknown as Primitive;
|
||||
const flat = txt('f', { angle: 0 });
|
||||
const rotated = txt('r', { angle: 0.5 });
|
||||
const line = { kind: 'line' } as unknown as Primitive;
|
||||
|
||||
it('WASM (Browser, Linux/Electron): die Szene zeichnet Stempel und waagrechte Texte, das SVG nur gedrehte', () => {
|
||||
const e = { wasm: true, native: false };
|
||||
expect(svgDrawsTextOverGpu(stamp, e)).toBe(false);
|
||||
expect(svgDrawsTextOverGpu(flat, e)).toBe(false); // vorher true: gedoppelte Schrift
|
||||
expect(svgDrawsTextOverGpu(rotated, e)).toBe(true);
|
||||
expect(svgDrawsTextOverGpu(line, e)).toBe(false);
|
||||
});
|
||||
it('native Fläche: Glyphen-Pass und Vektor-Glyphen, sonst SVG', () => {
|
||||
expect(svgDrawsTextOverGpu(flat, { wasm: false, native: true, sceneTexts: true, gpuTexts: true })).toBe(false);
|
||||
expect(svgDrawsTextOverGpu(rotated, { wasm: false, native: true, sceneTexts: true, gpuTexts: true })).toBe(false);
|
||||
expect(svgDrawsTextOverGpu(rotated, { wasm: false, native: true, sceneTexts: true, gpuTexts: false })).toBe(true);
|
||||
expect(svgDrawsTextOverGpu(flat, { wasm: false, native: true, sceneTexts: false })).toBe(true);
|
||||
});
|
||||
});
|
||||
@@ -135,3 +135,20 @@ export class NativeTextSync {
|
||||
return { upsert, remove };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [289] Zeichnet das SVG-Overlay diesen Text-Eintrag, obwohl die GPU-Fläche den Plan zeichnet? Jeder Text genau EINMAL:
|
||||
* `text`/`drawingText` setzt der Kern in die Szene ({@link isSceneText}; render2d/WASM und native Fläche zeichnen sie),
|
||||
* das SVG behält nur, was die Szene auslässt (gedrehte Einzeltexte, bei der nativen Fläche ohne `isGpuText`).
|
||||
* Vorher zeichnete das SVG unter WASM (Browser, Linux/Electron) alle `drawingText` ZUSÄTZLICH zur Szene: gedoppelte Schrift.
|
||||
*/
|
||||
export function svgDrawsTextOverGpu(
|
||||
p: Primitive,
|
||||
engine: { wasm: boolean; native: boolean; sceneTexts?: boolean; gpuTexts?: boolean },
|
||||
): boolean {
|
||||
if (p.kind !== 'text' && p.kind !== 'drawingText') return false;
|
||||
if (engine.wasm) return !isSceneText(p);
|
||||
if (engine.native && engine.sceneTexts && isSceneText(p)) return false;
|
||||
if (engine.native && engine.gpuTexts && isGpuText(p)) return false;
|
||||
return true;
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { beforeAll, afterAll, describe, expect, it, vi } from "vitest";
|
||||
// [289] Die Tests gehen von Strg als Primär-Modifikator aus (Linux), egal auf welchem Rechner sie laufen.
|
||||
beforeAll(() => vi.stubGlobal("navigator", { platform: "Linux x86_64", userAgent: "" }));
|
||||
afterAll(() => vi.unstubAllGlobals());
|
||||
import { setLanguage } from "../i18n";
|
||||
import {
|
||||
comboFromEvent,
|
||||
@@ -64,16 +67,16 @@ describe("[190] Archicad-Kürzel", () => {
|
||||
expect(new Set(all).size).toBe(all.length);
|
||||
// Cmd+D (Duplizieren) und d (Drehen) sind verschiedene Kombinationen.
|
||||
expect(matchesShortcut(key("d"), "duplicate", {})).toBe(false);
|
||||
expect(matchesShortcut(key("d", { metaKey: true }), "duplicate", {})).toBe(true);
|
||||
expect(matchesShortcut(key("d", { metaKey: true }), "transformRotate", {})).toBe(false);
|
||||
expect(matchesShortcut(key("d", { ctrlKey: true }), "duplicate", {})).toBe(true);
|
||||
expect(matchesShortcut(key("d", { ctrlKey: true }), "transformRotate", {})).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("comboMatches", () => {
|
||||
it("erkennt Ctrl/Cmd+Z (mod+z)", () => {
|
||||
expect(comboMatches(key("z", { ctrlKey: true }), "mod+z")).toBe(true);
|
||||
expect(comboMatches(key("z", { metaKey: true }), "mod+z")).toBe(true);
|
||||
expect(comboMatches(key("Z", { metaKey: true }), "mod+z")).toBe(true); // Grossbuchstabe (Caps/Shift-Ambiguität) egal
|
||||
expect(comboMatches(key("z", { ctrlKey: true }), "mod+z")).toBe(true);
|
||||
expect(comboMatches(key("Z", { ctrlKey: true }), "mod+z")).toBe(true); // Grossbuchstabe (Caps/Shift-Ambiguität) egal
|
||||
});
|
||||
|
||||
it("verlangt exakte Modifikator-Übereinstimmung (kein zusätzliches Shift)", () => {
|
||||
@@ -100,7 +103,7 @@ describe("comboFromEvent", () => {
|
||||
});
|
||||
|
||||
it("baut die Kombination in fester Reihenfolge mod+shift+alt+key", () => {
|
||||
expect(comboFromEvent(key("g", { metaKey: true, shiftKey: true }))).toBe("mod+shift+g");
|
||||
expect(comboFromEvent(key("g", { ctrlKey: true, shiftKey: true }))).toBe("mod+shift+g");
|
||||
expect(comboFromEvent(key("G", { ctrlKey: true }))).toBe("mod+g");
|
||||
expect(comboFromEvent(key("q"))).toBe("q");
|
||||
});
|
||||
@@ -206,7 +209,7 @@ describe("[252] tabKeyAction", () => {
|
||||
describe("[170] Datei-Kürzel ausserhalb von Tauri (Browser/Electron-Linux)", () => {
|
||||
it("Strg/Cmd+S speichert, +Umschalt speichert unter, Strg/Cmd+O öffnet", () => {
|
||||
expect(fileShortcutFor(key("s", { ctrlKey: true }))).toBe("save");
|
||||
expect(fileShortcutFor(key("s", { metaKey: true }))).toBe("save");
|
||||
expect(fileShortcutFor(key("s", { metaKey: true }))).toBeNull(); // [289] Super/Meta ist unter Linux kein Primär-Modifikator
|
||||
expect(fileShortcutFor(key("S", { ctrlKey: true, shiftKey: true }))).toBe("saveAs");
|
||||
expect(fileShortcutFor(key("o", { ctrlKey: true }))).toBe("open");
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
// Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
|
||||
|
||||
import { getLanguage } from "../i18n/translate";
|
||||
import { isMacPlatform, isPrimaryMod } from "./platform";
|
||||
|
||||
export type ShortcutId =
|
||||
| "undo"
|
||||
@@ -300,7 +301,7 @@ const MODIFIER_KEYS = new Set(["Control", "Meta", "Shift", "Alt"]);
|
||||
export function comboFromEvent(e: KeyboardEvent): string | null {
|
||||
if (MODIFIER_KEYS.has(e.key)) return null;
|
||||
const parts: string[] = [];
|
||||
if (e.ctrlKey || e.metaKey) parts.push("mod");
|
||||
if (isPrimaryMod(e)) parts.push("mod");
|
||||
if (e.shiftKey) parts.push("shift");
|
||||
if (e.altKey) parts.push("alt");
|
||||
const key = e.key.length === 1 ? e.key.toLowerCase() : e.key;
|
||||
@@ -316,7 +317,7 @@ export function comboMatches(e: KeyboardEvent, combo: string): boolean {
|
||||
const wantMod = mods.includes("mod");
|
||||
const wantShift = mods.includes("shift");
|
||||
const wantAlt = mods.includes("alt");
|
||||
if ((e.ctrlKey || e.metaKey) !== wantMod) return false;
|
||||
if (isPrimaryMod(e) !== wantMod) return false;
|
||||
if (e.shiftKey !== wantShift) return false;
|
||||
if (e.altKey !== wantAlt) return false;
|
||||
const k = e.key.length === 1 ? e.key.toLowerCase() : e.key;
|
||||
@@ -324,10 +325,10 @@ export function comboMatches(e: KeyboardEvent, combo: string): boolean {
|
||||
}
|
||||
|
||||
/** [170] Datei-Kürzel ausserhalb von Tauri. */
|
||||
export type FileShortcut = "save" | "saveAs" | "open";
|
||||
export type FileShortcut = "save" | "saveAs" | "open" | "new" | "print" | "quit" | "zoomIn" | "zoomOut";
|
||||
|
||||
/**
|
||||
* [170] Strg/Cmd+S, Strg/Cmd+Umschalt+S, Strg/Cmd+O im Browser und in der Linux-App (Electron, ohne native Menüleiste).
|
||||
* [170] Strg/Cmd+S, Strg/Cmd+Umschalt+S, Strg/Cmd+O ([289]: auch N, P, Q, Zoom +/-) im Browser und in der Linux-App (Electron, ohne native Menüleiste).
|
||||
* Unter Tauri liefert das native Menü dieselben Kürzel (`native/appMenu.ts`, Accelerator) — dort nicht verwenden.
|
||||
* Fest wie die Menü-Accelerators, nicht umbelegbar (nicht in {@link SHORTCUT_DEFS}).
|
||||
*/
|
||||
@@ -335,6 +336,13 @@ export function fileShortcutFor(e: KeyboardEvent): FileShortcut | null {
|
||||
if (comboMatches(e, "mod+shift+s")) return "saveAs";
|
||||
if (comboMatches(e, "mod+s")) return "save";
|
||||
if (comboMatches(e, "mod+o")) return "open";
|
||||
// [289] Dieselben Kürzel wie im nativen Mac-Menü (CmdOrCtrl+N/Q) plus Drucken und Zoom, die es dort nicht gibt.
|
||||
if (comboMatches(e, "mod+n")) return "new";
|
||||
if (comboMatches(e, "mod+p")) return "print";
|
||||
if (comboMatches(e, "mod+q")) return "quit";
|
||||
// Zoom: „+" liegt auf deutscher Tastatur auf „+", auf US-Tastatur auf „=" (Shift) — beide gelten; NumPad-„+/-" ebenso.
|
||||
if (isPrimaryMod(e) && !e.altKey && (e.key === "+" || e.key === "=")) return "zoomIn";
|
||||
if (isPrimaryMod(e) && !e.altKey && (e.key === "-" || e.key === "_")) return "zoomOut";
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -383,10 +391,6 @@ export function tabKeyAction(e: Pick<KeyboardEvent, "key" | "ctrlKey" | "metaKey
|
||||
return "commandLine";
|
||||
}
|
||||
|
||||
function isMacPlatform(): boolean {
|
||||
if (typeof navigator === "undefined") return false;
|
||||
return /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent || "");
|
||||
}
|
||||
|
||||
const KEY_DISPLAY_LABELS: Record<string, string> = {
|
||||
Delete: "Entf",
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
// [289] Primär-Modifikator je Plattform und die Zuordnung der Datei-/Zoom-Kürzel.
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { isPrimaryMod, platformName } from "./platform";
|
||||
import { comboMatches, fileShortcutFor, formatCombo } from "./keyboardShortcuts";
|
||||
|
||||
const ev = (init: Partial<KeyboardEvent> & { key: string }): KeyboardEvent =>
|
||||
({ ctrlKey: false, metaKey: false, shiftKey: false, altKey: false, ...init }) as KeyboardEvent;
|
||||
|
||||
function platform(p: string, ua = "") {
|
||||
vi.stubGlobal("navigator", { platform: p, userAgent: ua });
|
||||
}
|
||||
afterEach(() => vi.unstubAllGlobals());
|
||||
|
||||
describe("isPrimaryMod", () => {
|
||||
it("Mac: nur Cmd; sonst nur Strg", () => {
|
||||
expect(isPrimaryMod({ ctrlKey: false, metaKey: true }, true)).toBe(true);
|
||||
expect(isPrimaryMod({ ctrlKey: true, metaKey: false }, true)).toBe(false);
|
||||
expect(isPrimaryMod({ ctrlKey: true, metaKey: false }, false)).toBe(true);
|
||||
expect(isPrimaryMod({ ctrlKey: false, metaKey: true }, false)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Kürzel je Plattform", () => {
|
||||
it("Linux: Strg+Z/Umschalt+Strg+Z/S/N/P gelten, Super nicht", () => {
|
||||
platform("Linux x86_64", "X11; Linux x86_64");
|
||||
expect(platformName()).toBe("linux");
|
||||
expect(comboMatches(ev({ key: "z", ctrlKey: true }), "mod+z")).toBe(true);
|
||||
expect(comboMatches(ev({ key: "Z", ctrlKey: true, shiftKey: true }), "mod+shift+z")).toBe(true);
|
||||
expect(comboMatches(ev({ key: "z", metaKey: true }), "mod+z")).toBe(false);
|
||||
expect(fileShortcutFor(ev({ key: "s", ctrlKey: true }))).toBe("save");
|
||||
expect(fileShortcutFor(ev({ key: "S", ctrlKey: true, shiftKey: true }))).toBe("saveAs");
|
||||
expect(fileShortcutFor(ev({ key: "o", ctrlKey: true }))).toBe("open");
|
||||
expect(fileShortcutFor(ev({ key: "n", ctrlKey: true }))).toBe("new");
|
||||
expect(fileShortcutFor(ev({ key: "p", ctrlKey: true }))).toBe("print");
|
||||
expect(fileShortcutFor(ev({ key: "q", ctrlKey: true }))).toBe("quit");
|
||||
expect(fileShortcutFor(ev({ key: "=", ctrlKey: true }))).toBe("zoomIn");
|
||||
expect(fileShortcutFor(ev({ key: "+", ctrlKey: true, shiftKey: true }))).toBe("zoomIn");
|
||||
expect(fileShortcutFor(ev({ key: "-", ctrlKey: true }))).toBe("zoomOut");
|
||||
expect(fileShortcutFor(ev({ key: "s", metaKey: true }))).toBeNull();
|
||||
expect(fileShortcutFor(ev({ key: "s" }))).toBeNull();
|
||||
});
|
||||
it("Mac: Cmd gilt, Ctrl nicht", () => {
|
||||
platform("MacIntel", "Macintosh");
|
||||
expect(platformName()).toBe("mac");
|
||||
expect(comboMatches(ev({ key: "z", metaKey: true }), "mod+z")).toBe(true);
|
||||
expect(comboMatches(ev({ key: "z", ctrlKey: true }), "mod+z")).toBe(false);
|
||||
expect(fileShortcutFor(ev({ key: "s", metaKey: true }))).toBe("save");
|
||||
expect(fileShortcutFor(ev({ key: "s", ctrlKey: true }))).toBeNull();
|
||||
});
|
||||
it("Anzeige: Strg+S unter Linux, ⌘S auf dem Mac", () => {
|
||||
platform("Linux x86_64");
|
||||
expect(formatCombo("mod+s")).toMatch(/^(Strg|Ctrl)\+S$/);
|
||||
platform("MacIntel");
|
||||
expect(formatCombo("mod+s")).toBe("⌘S");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
// [289] Plattform und Primär-Modifikator an EINER Stelle: Mac = Cmd (metaKey), sonst (Linux/Windows, Browser) = Strg (ctrlKey).
|
||||
// Alle Tastenkürzel prüfen darüber, nie `ctrlKey || metaKey` (Super/Windows-Taste unter Linux löst sonst Kürzel aus,
|
||||
// Ctrl+Klick unter macOS ist das Kontextmenü und kein Kürzel).
|
||||
|
||||
/** macOS/iOS-Plattform? */
|
||||
export function isMacPlatform(): boolean {
|
||||
if (typeof navigator === "undefined") return false;
|
||||
return /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent || "");
|
||||
}
|
||||
|
||||
/** Plattformname für `data-platform` am Wurzelelement (CSS: Scrollbalken, Schrift, Titelleiste). */
|
||||
export function platformName(): "mac" | "linux" | "windows" | "other" {
|
||||
if (typeof navigator === "undefined") return "other";
|
||||
const s = `${navigator.platform || ""} ${navigator.userAgent || ""}`;
|
||||
if (/Mac|iPhone|iPad|iPod/.test(s)) return "mac";
|
||||
if (/Win/.test(s)) return "windows";
|
||||
if (/Linux|X11|CrOS/.test(s)) return "linux";
|
||||
return "other";
|
||||
}
|
||||
|
||||
/** Ist der Primär-Modifikator gedrückt? Mac: Cmd; sonst Strg. (`mac` überschreibt die Erkennung, für Tests.) */
|
||||
export function isPrimaryMod(e: { ctrlKey: boolean; metaKey: boolean }, mac: boolean = isMacPlatform()): boolean {
|
||||
return mac ? e.metaKey : e.ctrlKey;
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
// Registry (`ALIASES` + Nutzer-Kürzel). Nichts wird von Hand gepflegt; neue Kürzel erscheinen von selbst.
|
||||
// Reine Funktion (kein React), Anzeige in `ui/ShortcutOverviewDialog.tsx`.
|
||||
|
||||
import { isMacPlatform } from "./platform";
|
||||
import { ALIASES, COMMANDS } from "../commands/registry";
|
||||
import {
|
||||
SHORTCUT_DEFS,
|
||||
@@ -51,7 +52,7 @@ export function buildShortcutOverview(
|
||||
aliasOverrides: Record<string, string> = {},
|
||||
mac?: boolean,
|
||||
): ShortcutOverview {
|
||||
const isMac = mac ?? (typeof navigator !== "undefined" && /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent || ""));
|
||||
const isMac = mac ?? isMacPlatform();
|
||||
const combos: ComboGroup[] = CATEGORY_ORDER.map((category) => ({
|
||||
category,
|
||||
rows: [
|
||||
|
||||
@@ -33,6 +33,7 @@ import {
|
||||
import type { ElementClipboard, ElementSelectionIds, PastedIds } from "../editors/elementClipboard";
|
||||
import { parseClipboardText, serializeClipboardText } from "../editors/elementClipboardSerialize";
|
||||
import { SHORTCUT_DEFS, fileShortcutFor, matchesShortcut, tabKeyAction, type FileShortcut, type ShortcutId, type ShortcutOverrides } from "./keyboardShortcuts";
|
||||
import { isPrimaryMod } from "./platform";
|
||||
import { isTauriRuntime } from "../native/projectFile";
|
||||
import { isolateSelectionLayerCodes, showAllLayerCodes } from "./layerIsolate";
|
||||
import { isInModalDialog } from "./modalScope";
|
||||
@@ -70,7 +71,7 @@ export function useUndoRedoShortcut(
|
||||
undo();
|
||||
return;
|
||||
}
|
||||
const mod = e.ctrlKey || e.metaKey;
|
||||
const mod = isPrimaryMod(e);
|
||||
if (mod && !e.shiftKey && !e.altKey && e.key.toLowerCase() === "y") {
|
||||
e.preventDefault();
|
||||
redo();
|
||||
|
||||
+18
-6
@@ -55,9 +55,9 @@
|
||||
--shadow-3: 0 6px 24px rgba(26, 26, 24, 0.18);
|
||||
--overlay: rgba(26, 26, 24, 0.36);
|
||||
|
||||
--font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
|
||||
--font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Cantarell, "Noto Sans", "DejaVu Sans",
|
||||
sans-serif;
|
||||
--font-mono: "DM Mono", ui-monospace, "SF Mono", monospace;
|
||||
--font-mono: "DM Mono", ui-monospace, "SF Mono", "DejaVu Sans Mono", monospace;
|
||||
/* Schrift für GEZEICHNETEN Planinhalt (Text-/Textspalten-Objekte, Raum-
|
||||
Stempel) — bewusst NICHT `--font` (das ist die App-UI-Schrift für
|
||||
Buttons/Panels/Dialoge). Deckt sich mit dem Export-Font-Stack
|
||||
@@ -7717,16 +7717,17 @@ body {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
/* Ganz links in der randlosen Titelleiste (macOS-Konvention). */
|
||||
margin-right: 4px;
|
||||
/* [289] Ganz rechts in der randlosen Titelleiste (Linux-/Windows-Konvention; macOS nutzt die nativen Ampeln). */
|
||||
order: 1000;
|
||||
margin-left: 8px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.win-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 26px;
|
||||
height: 22px;
|
||||
width: 32px;
|
||||
height: 26px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
@@ -10652,3 +10653,14 @@ body {
|
||||
color: var(--ink-2);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* [289] Linux (Chromium/Electron): dezente Scrollbalken statt der dicken GTK-Standardbalken; Schrift ohne Subpixel-Fransen auf
|
||||
dunklem Grund. `data-platform` setzt main.tsx. Die Oberleiste hat eigene Regeln (s. `.topbar::-webkit-scrollbar`). */
|
||||
html[data-platform="linux"] *:not(.topbar) {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent;
|
||||
}
|
||||
html[data-platform="linux"] body {
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import { memo } from "react";
|
||||
//
|
||||
// Bezeichner englisch, UI-Text über i18n (CONVENTIONS.md).
|
||||
|
||||
import { formatCombo, loadShortcutOverrides, resolveCombo } from "../state/keyboardShortcuts";
|
||||
import { Dropdown } from "./Dropdown";
|
||||
import type { DropdownItem } from "./Dropdown";
|
||||
import { t } from "../i18n";
|
||||
@@ -113,8 +114,9 @@ export const AppMenuBar = memo(function AppMenuBar({
|
||||
onOpenHistory,
|
||||
onOpenDesignOptions,
|
||||
}: AppMenuBarProps) {
|
||||
const ov = loadShortcutOverrides();
|
||||
const fileItems: DropdownItem[] = [
|
||||
{ label: t("file.new"), onSelect: onNewProject },
|
||||
{ label: t("file.new"), onSelect: onNewProject, shortcut: formatCombo("mod+n") },
|
||||
{ label: t("file.newFromSample"), onSelect: onNewProjectFromSample },
|
||||
{ label: t("file.newFromComplexSample"), onSelect: onNewProjectFromComplexSample },
|
||||
{ label: t("file.newFromWettbewerbSample"), onSelect: onNewProjectFromWettbewerbSample },
|
||||
@@ -122,16 +124,16 @@ export const AppMenuBar = memo(function AppMenuBar({
|
||||
...(onNewProjectFromVariantenSample ? [{ label: t("file.newFromVariantenSample"), onSelect: onNewProjectFromVariantenSample }] : []),
|
||||
{ label: t("file.newFromTemplateFile"), onSelect: onNewProjectFromTemplate },
|
||||
{ divider: true },
|
||||
{ label: t("file.open"), onSelect: onOpenProject },
|
||||
{ label: t("file.save"), onSelect: onSaveProject },
|
||||
{ label: t("menu.native.saveAs"), onSelect: onSaveProjectAs },
|
||||
{ label: t("file.open"), onSelect: onOpenProject, shortcut: formatCombo("mod+o") },
|
||||
{ label: t("file.save"), onSelect: onSaveProject, shortcut: formatCombo("mod+s") },
|
||||
{ label: t("menu.native.saveAs"), onSelect: onSaveProjectAs, shortcut: formatCombo("mod+shift+s") },
|
||||
{ label: t("menu.native.restoreBackup"), onSelect: onRestoreBackup },
|
||||
{ divider: true },
|
||||
{ label: t("file.import"), onSelect: onImport },
|
||||
...(onImportPointCloud ? [{ label: t("menu.native.importPointCloud"), onSelect: onImportPointCloud }] : []),
|
||||
...(onImportMesh ? [{ label: t("menu.native.importMesh"), onSelect: onImportMesh }] : []),
|
||||
...(onExportPdf || onExportDxf || onExportIfc || onExportObj || onExportStl ? [{ divider: true }] : []),
|
||||
...(onExportPdf ? [{ label: `${t("menu.native.export")}: PDF`, onSelect: onExportPdf }] : []),
|
||||
...(onExportPdf ? [{ label: `${t("menu.native.export")}: PDF`, onSelect: onExportPdf, shortcut: formatCombo("mod+p") }] : []),
|
||||
...(onExportDxf ? [{ label: `${t("menu.native.export")}: DXF`, onSelect: onExportDxf }] : []),
|
||||
...(onExportIfc ? [{ label: `${t("menu.native.export")}: IFC`, onSelect: onExportIfc }] : []),
|
||||
...(onExportObj ? [{ label: `${t("menu.native.export")}: OBJ`, onSelect: onExportObj }] : []),
|
||||
@@ -139,8 +141,8 @@ export const AppMenuBar = memo(function AppMenuBar({
|
||||
];
|
||||
|
||||
const editItems: DropdownItem[] = [
|
||||
{ label: t("menu.edit.undo"), onSelect: onUndo, disabled: !canUndo },
|
||||
{ label: t("menu.edit.redo"), onSelect: onRedo, disabled: !canRedo },
|
||||
{ label: t("menu.edit.undo"), onSelect: onUndo, disabled: !canUndo, shortcut: formatCombo(resolveCombo("undo", ov)) },
|
||||
{ label: t("menu.edit.redo"), onSelect: onRedo, disabled: !canRedo, shortcut: formatCombo(resolveCombo("redo", ov)) },
|
||||
...(onOpenHistory ? [{ label: t("nav.history"), onSelect: onOpenHistory }] : []),
|
||||
...(onOpenDesignOptions ? [{ label: t("designOption.title"), onSelect: onOpenDesignOptions }] : []),
|
||||
{ divider: true },
|
||||
|
||||
+3
-1
@@ -8,6 +8,7 @@
|
||||
// aus App, Aktionen melden sich über Callbacks zurück. Bezeichner englisch,
|
||||
// UI-Text/Kommentare deutsch (CONVENTIONS.md).
|
||||
|
||||
import { platformName } from "../state/platform";
|
||||
import { setAboutDialogOpener } from "../state/aboutDialogHook";
|
||||
import { TEXT_FONTS } from "../text/fontList";
|
||||
import { t } from "../i18n";
|
||||
@@ -1555,8 +1556,9 @@ export const TopBar = memo(function TopBar({
|
||||
return () => setAboutDialogOpener(null);
|
||||
}, []);
|
||||
|
||||
// [289] Nur der macOS-Overlay-Titel lässt Platz für die Ampeln; Tauri unter Linux/Windows hat sie nicht.
|
||||
const tauriNativeTitlebar =
|
||||
typeof window !== "undefined" && "__TAURI_INTERNALS__" in window;
|
||||
typeof window !== "undefined" && "__TAURI_INTERNALS__" in window && platformName() === "mac";
|
||||
|
||||
return (
|
||||
// `data-tauri-drag-region`: die Titelleiste ist selbst der Fenster-Ziehbereich
|
||||
|
||||
+17
-17
@@ -49,25 +49,9 @@ export function WindowControls() {
|
||||
|
||||
if (!api) return null;
|
||||
|
||||
// Reihenfolge (macOS-Titelleiste links): Schliessen · Minimieren · Maximieren.
|
||||
// [289] Electron läuft auf Linux/Windows: Fensterknöpfe rechts, Reihenfolge Minimieren · Maximieren · Schliessen.
|
||||
return (
|
||||
<div className="win-controls" role="group" aria-label={t("window.controls")}>
|
||||
<button
|
||||
type="button"
|
||||
className="win-btn win-btn-close"
|
||||
onClick={() => api.close()}
|
||||
title={t("window.close")}
|
||||
aria-label={t("window.close")}
|
||||
>
|
||||
<svg width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
|
||||
<path
|
||||
d="M1 1 L9 9 M9 1 L1 9"
|
||||
stroke="currentColor"
|
||||
strokeWidth="1.2"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="win-btn"
|
||||
@@ -109,6 +93,22 @@ export function WindowControls() {
|
||||
</svg>
|
||||
)}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="win-btn win-btn-close"
|
||||
onClick={() => api.close()}
|
||||
title={t("window.close")}
|
||||
aria-label={t("window.close")}
|
||||
>
|
||||
<svg width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
|
||||
<path
|
||||
d="M1 1 L9 9 M9 1 L1 9"
|
||||
stroke="currentColor"
|
||||
strokeWidth="1.2"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
// `PlanView`; die Reihenfolge der Hooks und Effekte ist wie vor der Aufteilung.
|
||||
|
||||
import { useRef, useEffect, useMemo, useState, useLayoutEffect } from "react";
|
||||
import { PlanPickIndex, planTextEntries, materializeGreyed, materializeUnderlay, roomStampAt, buildDrawingIndex, isGpuText, isSceneText, meetScale, PLAN_DASH_VAR, toScreen, scaleFromView, PX_PER_M } from "../../../core";
|
||||
import { PlanPickIndex, planTextEntries, materializeGreyed, materializeUnderlay, roomStampAt, buildDrawingIndex, svgDrawsTextOverGpu, meetScale, PLAN_DASH_VAR, toScreen, scaleFromView, PX_PER_M } from "../../../core";
|
||||
import { useNativeAvailable, useNativePlanRenderer } from "../useNativePlanRenderer";
|
||||
import { useWasmPlanRenderer } from "../useWasmPlanRenderer";
|
||||
import type { UnderlayGroup, DrawingIndex, Primitive, ViewBox__plan_planView_geometry as ViewBox } from "../../../core";
|
||||
@@ -194,17 +194,10 @@ export function usePlanEngine(inp: UsePlanEngineArgs) {
|
||||
const svgCandidates = useMemo(() => {
|
||||
const out: Array<{ p: Primitive; i: number }> = [];
|
||||
const items: ReadonlyArray<{ p: Primitive; i: number }> = useGpuRenderer ? planTextEntries(plan) : plan.primitives.map((p, i) => ({ p, i }));
|
||||
const engine = { wasm: wantWasm, native: wantNative, sceneTexts: nativeHook.sceneTexts, gpuTexts: nativeHook.gpuTexts };
|
||||
for (const { p, i } of items) {
|
||||
const drawnElsewhere = useGpuRenderer
|
||||
? wantWasm
|
||||
? p.kind !== "drawingText"
|
||||
: p.kind !== "text" && p.kind !== "drawingText"
|
||||
: p.kind === "line" && !!p.drawingId;
|
||||
// Texte zeichnet die native Fläche selbst, im selben Frame wie die Linien ([194]): Raumstempel und
|
||||
// waagrechte Textfelder über den Glyphen-Pass, gedrehte Einzeiler als Vektor-Glyphen.
|
||||
if (useGpuRenderer && wantNative && nativeHook.sceneTexts && isSceneText(p)) continue;
|
||||
if (useGpuRenderer && wantNative && nativeHook.gpuTexts && isGpuText(p)) continue;
|
||||
if (!drawnElsewhere) out.push({ p, i });
|
||||
// Mit GPU zeichnet das SVG nur Texte, und nur die, die die Szene auslässt ([289]: jeder Text genau einmal).
|
||||
if (useGpuRenderer ? svgDrawsTextOverGpu(p, engine) : !(p.kind === "line" && !!p.drawingId)) out.push({ p, i });
|
||||
}
|
||||
return out;
|
||||
}, [plan, useGpuRenderer, wantWasm, wantNative, nativeHook.gpuTexts, nativeHook.sceneTexts]);
|
||||
|
||||
Reference in new issue
Block a user