Skip to content

Fix unit visibility change not propagating to other views#264

Open
xiao-1011 wants to merge 1 commit intoSpikeInterface:mainfrom
xiao-1011:fix/get-visible-unit-ids-return-copy
Open

Fix unit visibility change not propagating to other views#264
xiao-1011 wants to merge 1 commit intoSpikeInterface:mainfrom
xiao-1011:fix/get-visible-unit-ids-return-copy

Conversation

@xiao-1011
Copy link
Copy Markdown

Summary

  • get_visible_unit_ids() returned a direct reference to the internal _visible_unit_ids list
  • Callers that snapshot before/after set_unit_visibility() to detect changes were comparing the same mutated object, so the comparison always found no difference
  • This prevented notify_unit_visibility_changed() from firing, causing other widgets (waveforms, ISI, correlograms, etc.) to not refresh when toggling unit visibility in the unit list
  • Fix: return list(self._visible_unit_ids) instead of the raw reference

Test plan

  • Open spikeinterface-gui with a sorting analyzer
  • Toggle unit visibility checkboxes in the unit list
  • Verify that other widgets (waveform, ISI, correlogram, probe, etc.) update automatically

🤖 Generated with Claude Code

`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) <noreply@anthropic.com>
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.

2 participants