#17697·jupyterlab

Visibility of command toolbar buttons not updated with `many-changed`

Author: brichetCreated Jul 16, 2025Updated Sep 27, 2026
Labelsbugpkg:ui-components

Description

When using the CommandRegistry.notifyCommandChanged() without command id, it triggers a signal with many-changed type.

The many-changed signal is caught by the the CommandToolbarButtonComponent, which actually toggles its lm-mod-hidden class. But this signal is not caught by the parent widget CommandToolbarButton, which therefore keep its lm-mod-hidden class.

Reproduce

Add a command button (in notebook toolbar for example), and try to update its visibility by triggering the notifyCommandChanged() without arguments.

Expected behavior

The button to toggle its visibility.

Suggestions

  1. Update the condition to trigger an update of the button widget

    typescript
    if (change.id === props.id || change.type === 'many-changed') {
  2. The signal caught by the parent widget has been added in https://github.com/jupyterlab/jupyterlab/pull/15533. Maybe updating the visibility of the parent widget is not required, as it was before.