From 888bd602ca566a97d6e5a17cd8e2b702fc909fd2 Mon Sep 17 00:00:00 2001 From: Xiao Date: Fri, 10 Apr 2026 17:00:21 +0200 Subject: [PATCH] Fix unit visibility change not propagating to other views `get_visible_unit_ids()` returned a direct reference to the internal `_visible_unit_ids` list. Callers that snapshot the list before and after `set_unit_visibility()` to detect changes were comparing the same mutated object, so the comparison always found no difference and never triggered `notify_unit_visibility_changed()`. Return a copy instead so before/after comparisons work correctly. Co-Authored-By: Claude Opus 4.6 (1M context) --- spikeinterface_gui/controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spikeinterface_gui/controller.py b/spikeinterface_gui/controller.py index 3ddea2d..e150888 100644 --- a/spikeinterface_gui/controller.py +++ b/spikeinterface_gui/controller.py @@ -600,7 +600,7 @@ def set_visible_unit_ids(self, visible_unit_ids): def get_visible_unit_ids(self): """Get list of visible unit_ids""" - return self._visible_unit_ids + return list(self._visible_unit_ids) def get_visible_unit_indices(self): """Get list of indices of visible units"""