feat: reorder inventory images atomically
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-11 00:13:44 -04:00
parent 72e9a79b67
commit 0e81fc4022
15 changed files with 275 additions and 22 deletions
+10
View File
@@ -119,3 +119,13 @@ retain the last loaded gallery but disable mutations until an explicit reload
succeeds. Failed initial loads show a reload action instead of an empty manager.
Reload restores keyboard focus to the manager or the retry control. Pending
operations block conflicting writes and uploads, including drag-and-drop.
## Atomic adjacent moves
Move up/down uses one server operation. The repository locks the owning Inventory
Item and its images, selects current order by `sortOrder`, `createdAt`, then `id`,
and uses the domain move rule to choose the new order. An actual move assigns
contiguous zero-based positions, resolving tied legacy/upload positions, within
one PostgreSQL transaction. Any failure rolls back all changes. Concurrent moves
within one item serialize; primary selection and image metadata are unchanged.
Boundary moves are no-ops. No database migration is required.