Drop inserting in capture (changing in-place) and instead just add and then remove frames #233
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #231
So in napari/napari#7150 event handling order was changed in napari.
This is making the key frame list manipulations for inserting a replacement frame not work correctly when the list change event callbacks trigger. I tried passing
position='first'
in the.connect()
in various places and could not get it to resolve properly -- it's events of the SelectableEventedList, which are on the napari side I think.I also tried to keep the name of the frame when
insert=False
, but the hash is still different so selection still fails.In this PR I work around all this event stuff by removing the
insert
kwarg oncapture_frame
and no longer edit the frame in-place when replacing. Instead, the new frame is added and previous is removed.Note that the frame number was already incrementing even when replacing a frame (insert=False) and because one can re-order frames, the numbers lose meaning.