Skip to content

Fix unit visibility change not propagating to other views#264

Merged
chrishalcrow merged 1 commit intoSpikeInterface:mainfrom
xiao-1011:fix/get-visible-unit-ids-return-copy
Apr 15, 2026
Merged

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

Conversation

@xiao-1011
Copy link
Copy Markdown
Contributor

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>
@chrishalcrow chrishalcrow merged commit b6c0a4b into SpikeInterface:main Apr 15, 2026
2 checks passed
@chrishalcrow
Copy link
Copy Markdown
Member

Thanks @xiao-1011 !

@xiao-1011 xiao-1011 deleted the fix/get-visible-unit-ids-return-copy branch April 16, 2026 12:02
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