Entity ordering in a review¶
AF2 lets reviewers reorder entities within a category using a left-hand drag handle, the handle's left/right arrow keys, or Move earlier / Move later in the entity menu. Dragging reorders the visible page; keyboard actions also cross page boundaries. Moving an entity follows it onto its destination page, restores focus to its handle, and announces its new position. Open entity panels stay open.
Reordering changes position only. Entity IDs, labels, answers, notes, answer ownership, and completion states stay unchanged. New entities still append. Moves are blocked during label editing, persistence, completed reviews, and read-only viewing. An order-only edit enables Save progress and participates in the existing unsaved-review navigation guard. Failed saves retain the local sequence; revert restores the saved sequence.
Persistence contract¶
EntityOrder is optional review data stored on the MongoDB AnnotationSession,
scoped to that review's investigator, stage, and reconciliation state. It is an
ordered array of root annotation GUIDs. It travels through
SessionSubmissionWebDto / SessionSubmissionDto, and both session response
DTOs expose it. AF2 consumes it independently of the unordered Annotations
collection. No entity or annotation is renamed to encode position.
On save the domain filters the requested IDs to roots belonging to that session, deduplicates them, preserves omitted existing positions, appends new roots, and removes deleted roots. IDs from another review or child answers cannot establish positions. A legacy client that omits the field preserves saved order. A legacy document without the field keeps its existing display order until a reviewer saves an explicit sequence. Preview rehearses the same behavior in memory.
Delivery and verification¶
This slice uses the existing annotationFormV2 gate. It does not change flag
defaults, enable production access, or introduce a database migration.
Coverage includes an actual MongoDB insert/read/replace/read roundtrip with two reviewers, API mapping in both directions, snapshot/serializer propagation, order-only save, failed save and revert, reload, cross-page movement, preserved answers/labels/open panels, drag events, keyboard controls, and editing guards.