Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebook: status bar is not floating window aware #210383

Open
bpasero opened this issue Apr 15, 2024 · 0 comments · May be fixed by #211997
Open

Notebook: status bar is not floating window aware #210383

bpasero opened this issue Apr 15, 2024 · 0 comments · May be fixed by #211997
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook workbench-auxwindow Issues related to use of auxiliary ("floating") windows.
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Apr 15, 2024

This is a missing adoption when notebooks became floating window capable. Notice how the status bar entry appears in the main window and not the floating window:

Screenshot 2024-04-15 at 11 56 20

We have had a similar issue with the text editor status bar and solved it by instantiating it per-window:

// Main Editor Status
const mainInstantiationService = instantiationService.createChild(new ServiceCollection(
[IEditorService, editorService.createScoped('main', this._store)]
));
this._register(mainInstantiationService.createInstance(EditorStatus, mainWindow.vscodeWindowId));
// Auxiliary Editor Status
this._register(editorGroupService.onDidCreateAuxiliaryEditorPart(({ part, instantiationService, disposables }) => {
disposables.add(instantiationService.createInstance(EditorStatus, part.windowId));
}));

I think a similar approach would work for notebooks too.

The key for this to work is that you get a scoped IEditorService in the onDidCreateAuxiliaryEditorPart that allows you to listen only to editor change events in the respective window. Consequently, you use a main-window scoped editor service for the main-window status bar:

[IEditorService, editorService.createScoped('main', this._store)]

Let me know if you have questions, but I think its easy to copy what we do for editor status here.

@bpasero bpasero added notebook workbench-auxwindow Issues related to use of auxiliary ("floating") windows. labels Apr 15, 2024
@rebornix rebornix added the bug Issue identified by VS Code Team member as probable bug label Apr 23, 2024
@rebornix rebornix added this to the May 2024 milestone Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug notebook workbench-auxwindow Issues related to use of auxiliary ("floating") windows.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants