How to change active panel programmatically

How can I programmatically switch to sqlite.ipynb panel? Also how can I get which panel is currently active? thanks:)

One of many ways is by executing command tabsmenu:activate-by-id, at least this is what I used in ui-profiler

also see the command list Commands — JupyterLab 4.1.0a3 documentation although the arguments are not currently documented.

Also how can I get which panel is currently active?

Generally widget trackers (e.g. INotebookTracker) and JupyterFrontEnd.shell this is ILabShell have .currentWidget attribute and the latter also has .activeWidget.

2 Likes