Is there a tracker that can track the widget when navigating away

In jupyterlab 4, is there a tracker i can use to track the tabs in main area. e.g. i want the signal to emit when i navigate (from tabs) from a notebook to console/launcher/file/terminal. currently INotebookTracker can only track open a nb, close a nb, and navigate from one nb to another nb. Is there anything i could do to track navigating from one nb to some other widget?

The ILabShell token is available from @jupyterlab/application, and has a currentChanged signal. A function connected to that will fire any time focus changes, which can be combined with existing switching code.

2 Likes