Closed Carifio24 closed 1 year ago
Rebased to get CI fixes
@Carifio24 - do you think it would be easy to add a test for this, or would it be non-trivial?
@astrofrog I think it should actually be pretty straightforward. I'll try adding one and see if that is indeed the case.
@astrofrog I just added a test - it creates a new subset and checks that the table model and the row ordering are preserved afterwards.
This PR implements a change(/bugfix?) requested by @aagoodman. Currently, after a user makes a selection to create a new subset after having sorted the table, the sorting is undone once the subset is created. This leads to a not-great UX - if one is trying to create multiple selections based on a column's values, having to re-sort each time is annoying.
The reason for this is that the table model is recreated any time the layers change, which resets any sorting. This PR modifies the layer changed callback to only recreate the table model if the actual
Data
layer has changed - otherwise, we just call the model's_update_visible
. This also necessitates making the masks in_update_visible
aware of the current order.