Renumber queue slots
Renumber the items of a list — change the value of an ordering field such as the backlog app's :queue-slot on many rows at once — as one operation rather than N individual edits. Today a reorder means one /api/update per row: N round trips, N permission checks, N :updated-at bumps, and (with no transactions) N failure points that can strand the list half-renumbered. It looks like a frontend task, but it is better served by a new API endpoint that crafts a single SQL statement for the whole change: the client submits the reordered state (the list of ids in their new order, or an id → new-slot map), the server resolves it into one UPDATE shaped statement (e.g. UPDATE ... FROM (VALUES ...)), checks permissions once, and returns the new ordering. Renumber-on-collision (a write colliding with an existing slot reindexes the tail — the backlog app's planned engine rule) becomes a natural sibling of the same endpoint. Open questions for the plan: the wire shape (ordered id list vs slot map), the permission gate (type-level update on every affected row, checked how), whether :updated-at should be touched at all (a reorder is list-level, not row-level), and whether the endpoint is generic over any ordering field or shaped to one convention.
- Slot
- 17400
- Status
- 10 Open
- Tags
- backend, frontend
- Contributors
- Donnie