diff --git a/docs/current-architecture.md b/docs/current-architecture.md index 1ad0eab..0fd4c14 100644 --- a/docs/current-architecture.md +++ b/docs/current-architecture.md @@ -386,6 +386,10 @@ Gerätezeilen atomar. Delete/Undo erfasst denselben Datensatz vollständig. Im Editor sind die bisherigen Schutzspalten deshalb nur noch eine schreibgeschützte Projektion der 1:1-Daten; Änderungen erfolgen über ein geräteabhängiges Schutzgeräte-Modal und `circuit-protection.update`. +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 +`circuit-group.reorder`; Gruppennummer, Präfix und Kind-BMK bleiben unverändert. `distribution-board.update` versioniert Etage, Netzart und den verteilerweiten Gleichzeitigkeitsfaktor gemeinsam und stellt alle Werte über dauerhaftes Undo/Redo wieder her. Der Faktor liegt zwischen `0` und `1` und diff --git a/docs/spec/08-current-product-backlog.md b/docs/spec/08-current-product-backlog.md index b44aa9a..b8db24d 100644 --- a/docs/spec/08-current-product-backlog.md +++ b/docs/spec/08-current-product-backlog.md @@ -38,7 +38,8 @@ requirements and intended sequencing, not proof of implementation. - [x] Phase E3b1: create, rename and safely delete empty circuit groups. - [x] Phase E3b2a: persistent circuit-protection update command. - [x] Phase E3b2b: circuit-protection defaults on insert and editor modal. -- [ ] Phase E4: group reorder, renumber, circuit moves and populated-delete warning. +- [x] Phase E4a: persistent same-category group reorder controls. +- [ ] Phase E4b: explicit group renumber, circuit moves and populated-delete warning. - [ ] Phase E: editor projection and editing. - [ ] Phase F: documentation and full GUI verification. - [ ] Keep full electrical sizing and cable-dimensioning rules separate until diff --git a/docs/spec/09-distribution-board-components-and-protection-groups.md b/docs/spec/09-distribution-board-components-and-protection-groups.md index 236fcd2..ff96ed6 100644 --- a/docs/spec/09-distribution-board-components-and-protection-groups.md +++ b/docs/spec/09-distribution-board-components-and-protection-groups.md @@ -789,6 +789,8 @@ Implemented in E1/E2a/E2b/E3a: together with the circuit and all device rows - the editor modal exposes only fields valid for the selected protection type; the old flat protection columns now project the new 1:1 data read-only +- group controls move a group only to the adjacent peer of the same category; + the complete list order is one persistent command and no number or BMK changes Acceptance: diff --git a/src/frontend/components/circuit-tree-editor.tsx b/src/frontend/components/circuit-tree-editor.tsx index d3ce898..2869c86 100644 --- a/src/frontend/components/circuit-tree-editor.tsx +++ b/src/frontend/components/circuit-tree-editor.tsx @@ -52,6 +52,7 @@ import { buildCircuitSectionRenumberAssignments, } from "../utils/circuit-section-renumber-command"; import { + buildCircuitGroupReorderAssignments, buildNewCircuitGroupSnapshot, canDeleteCircuitGroup, renameCircuitGroupSnapshot, @@ -95,6 +96,7 @@ import { moveCircuitDeviceRowsToNewCircuitCommand, reorderCircuitSectionCommand, reorderCircuitSectionsCommand, + reorderCircuitGroupsCommand, renumberCircuitSectionCommand, redoProjectCommand, updateCircuitById, @@ -1235,6 +1237,36 @@ export function CircuitTreeEditor(props: { projectId: string; circuitListId: str }); } + async function handleMoveCircuitGroup( + groupId: string, + direction: -1 | 1 + ) { + if (!data) { + return; + } + const assignments = buildCircuitGroupReorderAssignments( + data.sections, + groupId, + direction + ); + if (!assignments) { + return; + } + await runCommand({ + label: "Stromkreisgruppen sortieren", + redo: async () => { + const result = await reorderCircuitGroupsCommand( + projectId, + getExpectedProjectRevision(), + circuitListId, + assignments + ); + applyProjectCommandResult(result); + return null; + }, + }); + } + async function handleSaveCircuitProtection( protection: CircuitTreeProtectionDeviceDto ) { @@ -3477,6 +3509,40 @@ export function CircuitTreeEditor(props: { projectId: string; circuitListId: str > Gruppe bearbeiten + +