Skip to content

NGLASS-2431 Clear rejected CATMAID merge previews from Seg - #270

Merged
seankmartin merged 7 commits into
feature/edit-modefrom
codex/nglass-2431-clear-rejected-merge-preview
Nov 13, 2026
Merged

seankmartin merged 7 commits into
feature/edit-modefrom
codex/nglass-2431-clear-rejected-merge-preview

Conversation

@afonsobspinto

@afonsobspinto afonsobspinto commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

When CATMAID rejects a merge, Neuroglancer restores the original skeletons but leaves the temporary merge result visible and starred in Seg. This change removes the temporary ID from Seg during rollback.

When CATMAID rejects a Merge, Undo, or Redo, rollback removes the preview by its exact provisional ID. Before publishing the preview, the runtime uses the explicit Seg reader to capture normal visibility, temporary visibility, and starred state as SegmentVisibilityState, keyed by logical segment handle. On rejection, it applies the captured values to the current rollback hints, including after a rebase. The reader, restore flag, remap hint, and tests use the same visibility-state terminology.

The browser regression holds a join request long enough to see the preview, returns a 409, and checks that both original skeletons and their Seg entries are restored, Undo/Redo has no new entry, and the reverse merge succeeds.

The rejection tests share one helper for holding a CATMAID request and returning a 409. The new regression saves a merge, undoes it, hides a restored Seg entry, and verifies that a rejected Redo keeps the entry hidden and starred. It then retries Redo successfully.

Rollback examples

While tracing a neuron, you might join fragments 10 and 20. Neuroglancer previews the edit while CATMAID processes the request. These examples show what happens in Seg when CATMAID rejects it.

Use case Behaviour before the fix Behaviour with this PR
You join 20 into 10, and CATMAID rejects the join because 20 is linked to a proofreading task. The original skeletons return. The temporary merged entry can stay visible and starred in Seg. The temporary entry disappears. Both originals recover their prior visibility and starred state.
You pick skeleton 20 from the browse view with its eye toggled off in Seg. CATMAID rejects the join. The temporary merged entry can remain, and rollback can make 20 visible. The preview disappears. Skeleton 20 stays hidden and keeps its prior starred state.
You save a Merge, hide its survivor 10, and click Undo. CATMAID rejects the split request. The temporary split-off entry can remain. The rollback can also clear the survivor’s star when the input and merged handles resolve to the same saved ID. The temporary split-off entry disappears. The saved survivor stays hidden and starred.
You undo a saved Merge, hide one of the restored skeletons, and click Redo. CATMAID rejects the new join. The temporary Redo result can remain in Seg, and rollback can make the hidden skeleton visible. The Redo result disappears. The affected entries recover their previous Seg state, including when Undo assigned a new numeric ID.
You click Undo and Redo while the original Merge is still saving. CATMAID rejects the original join. Temporary previews can remain visible and starred after the queued edits are discarded. The graph and edit history return to their pre-Merge state. Seg clears the discarded previews and restores the original entries’ visibility and starred state.

Related pull requests

@afonsobspinto
afonsobspinto marked this pull request as ready for review November 12, 2026 19:05
@seankmartin
seankmartin merged commit a9a5819 into feature/edit-mode Nov 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants