Add section renumber history

This commit is contained in:
2026-07-24 08:34:31 +02:00
parent 332dfdb5d9
commit 4b4603b71b
14 changed files with 1057 additions and 14 deletions
+15 -7
View File
@@ -28,13 +28,14 @@ The public dispatcher currently supports `circuit.update`, `circuit.insert`,
`circuit-device-row.insert`, `circuit-device-row.delete` and
`circuit-device-row.move` plus
`circuit-device-row.move-with-new-circuit` and `circuit.reorder-section`, all
with schema version `1`. Other command types are rejected. Insert commands
contain the complete entity or circuit block with stable ids; delete commands
include the expected parent identity. Circuit snapshots contain zero, one or
multiple complete device rows. Move commands contain each row's expected and
target circuit plus its exact expected and target sort order. This makes
deletion and moves undoable without generating replacement identities or
renumbering circuits. The editor does not consume these endpoints yet.
with `circuit.renumber-section`, all with schema version `1`. Other command
types are rejected. Insert commands contain the complete entity or circuit
block with stable ids; delete commands include the expected parent identity.
Circuit snapshots contain zero, one or multiple complete device rows. Move
commands contain each row's expected and target circuit plus its exact expected
and target sort order. This makes deletion and moves undoable without
generating replacement identities or renumbering circuits. The editor does not
consume these endpoints yet.
`circuit-device-row.move` targets existing circuits in the same circuit list.
`circuit-device-row.move-with-new-circuit` atomically creates exactly one
@@ -48,6 +49,13 @@ in the section. Each assignment records the expected and target `sortOrder`.
The command and its inverse change no circuit field other than `sortOrder`;
equipment identifiers and complete device-row blocks remain unchanged.
`circuit.renumber-section` is an explicit operation requiring one assignment
for every circuit in the section. Assignments contain expected and target
equipment identifiers. The store rejects stale values, duplicate targets and
targets occupied by other sections, then applies swaps through collision-safe
temporary identifiers. Undo restores the exact prior identifiers; sort
positions and device rows remain unchanged.
Example:
```json
+5 -2
View File
@@ -99,8 +99,11 @@ Felder und vollständiger Zeilenbestand unverändert sind.
`circuit.reorder-section` speichert die erwartete und neue Sortierposition
jedes Stromkreises eines vollständigen Abschnitts. Forward, Undo und Redo
ändern ausschließlich `sortOrder`; Stromkreisblöcke, Gerätezeilen und BMKs
bleiben unverändert. Neunummerierung und Synchronisierung müssen vor der
Frontend-Umstellung noch als persistente Commands modelliert werden.
bleiben unverändert. `circuit.renumber-section` bildet die getrennte,
ausdrücklich ausgelöste Neunummerierung ab. Es speichert alle erwarteten und
neuen BMKs des Abschnitts, löst Tauschkollisionen über temporäre Werte und
ändert weder Sortierung noch Gerätezeilen. Synchronisierung muss vor der
Frontend-Umstellung noch als persistentes Command modelliert werden.
## Projektgeräte
@@ -189,13 +189,16 @@ Completed foundation:
- `circuit.reorder-section` requires the complete section circuit set and
stores exact expected/target sort positions; its inverse changes no
equipment identifier and never splits a circuit block
- `circuit.renumber-section` is the separate explicit renumber operation; it
stores every expected/target equipment identifier, uses collision-safe
temporary values and restores the exact prior identifiers on undo
Remaining constraints before completing persistent history:
- extend the concrete project-scoped command union and executors beyond the
Circuit field/insert/delete and CircuitDeviceRow
field/insert/delete/move plus section-reorder slices; the generic versioned
command envelope is complete
field/insert/delete/move plus section-reorder/renumber slices; the generic
versioned command envelope is complete
- route the remaining structural, synchronization and destructive domain
writes through the shared command, revision and stack transaction boundary
- replace the session-local frontend command stack only after server-side
@@ -403,6 +403,9 @@ Implemented foundation:
unchanged generated circuit, without renumbering
- complete section reorders persist every expected and target circuit
`sortOrder`; undo/redo changes neither equipment identifiers nor device rows
- explicit section renumber commands persist every expected and target
equipment identifier, apply swaps collision-safely and restore exact prior
identifiers without changing sort positions or device rows
- revision metadata, change-set payloads and the project counter are committed
in one SQLite transaction
- a stale expected revision produces no history writes