Add cell copy/paste, multi-row edits and a context menu to the circuit grid

Ctrl+C/Ctrl+V copy and paste grid cells without opening an editor, using
the document copy/paste events so it also works over plain HTTP in the
LAN. Protection and cable summaries copy the complete circuit record;
tab-separated blocks from Excel spread over visible rows and columns.
With a Ctrl/Shift multi-selection, typing, pasting and the protection
dialog apply to every selected row that can take the value, including
device power and GZF; other cells are skipped and reported.

All of these writes use the new circuit-list.bulk-update command. It
carries complete circuit.update, circuit-device-row.update and
circuit-protection.update commands, applies them with the single-command
rules in one transaction and stores the reversed inverses, so each edit
is one undo step. The single-command apply logic is extracted for reuse.

A right-click menu (also context-menu key / Shift+F10) offers copy,
paste, edit, protection, cable sizing, insert circuit below, add device
and delete. The protection summary is now selected by click and opened
by double click, Enter or F2. Existing numbers open in the inline editor
with a decimal comma, so confirming an unchanged decimal no longer fails.

Refs #26

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian Appel 2026-10-30 07:38:28 +01:00
parent 07bc52a134
commit 17a3945813
18 changed files with 2548 additions and 391 deletions

View file

@ -453,6 +453,24 @@ Gerätezeilen atomar. Delete/Undo erfasst denselben Datensatz vollständig.
Im Editor sind die Schutzspalten deshalb eine
schreibgeschützte Projektion der 1:1-Daten; Änderungen erfolgen über ein
geräteabhängiges Schutzgeräte-Modal und `circuit-protection.update`.
Mehrfachänderungen und Einfügen im Editor laufen über
`circuit-list.bulk-update`: Der Befehl enthält vollständige Einzelbefehle
`circuit.update`, `circuit-device-row.update` und `circuit-protection.update`
(je Ziel höchstens einer, maximal 2000) und wendet sie mit denselben Regeln wie
die Einzelbefehle in einer Transaktion an
(`circuit-list-bulk-update-project-command.repository.ts`). Die Inverse ist die
umgekehrte Liste der angewendeten Inversen, sodass Undo/Redo nichts neu
plant. Die reine Planung im Client liegt in
`src/frontend/utils/circuit-grid-clipboard.ts`: Strg+C/Strg+V über die
`copy`/`paste`-Ereignisse (funktioniert auch über HTTP im LAN), Schutz- und
Kabelzusammenfassung werden als vollständiger Datensatz des Stromkreises
kopiert, Tabulator-Blöcke aus Excel laufen über sichtbare Zeilen und Spalten.
Bei einer Mehrfachauswahl (Strg/Umschalt) gelten Eingabe, Einfügen und das
Schutzgeräte-Modal für alle passenden ausgewählten Zeilen; nicht passende
Zellen werden übersprungen und gemeldet. Ein Rechtsklick-Kontextmenü
(`grid-context-menu.tsx`, auch Kontextmenütaste/Umschalt+F10) bündelt
Kopieren, Einfügen, Bearbeiten, Schutzgerät, Leitungsberechnung, Stromkreis
unterhalb einfügen, Gerät hinzufügen und Löschen.
Gruppen lassen sich im Editor schrittweise nur gegenüber einer benachbarten
Gruppe derselben Kategorie verschieben. Der Client sendet dabei immer die
vollständige erwartete und gewünschte Sortierreihenfolge über