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

Improve widget specific status bar handling #14239

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

msujew
Copy link
Member

@msujew msujew commented Oct 1, 2024

What it does

Closes #14045

Adds a new dedicated WidgetStatusBarService (and associated WidgetStatusBarContribution) that enables showing status bar items for the currently selected widget.

If no WidgetStatusBarContribution matches the current widget (like if the Explorer was selected), the previous status bar items stay. If another widget like the notebook editor gains focus, the correct contribution is selected and the new status bar items are shown.

Some specific widgets (webview, custom editor, preferences, getting started, etc.) in vscode hide the previous status bar items. For this, we implement a noopWidgetStatusBarContribution function to enable easier disabling of status bar items.

How to test

  1. Select a monaco editor widget.
  2. Ensure that the expected status bar items appear
  3. Select a different widget (like terminal, explorer)
  4. Assert that the status bar items stay where they are
  5. Select a notebook widget (and select a cell within)
  6. Assert that the expected status bar items appear, and the editor ones disappear.
  7. Select the getting started (or webview, custom editor, preferences, etc.) widget
  8. Assert that all editor related status bar items disappear.

Review checklist

Reminder for reviewers

@msujew msujew added editor issues related to the editor statusbar issues related to the statusbar notebook issues related to notebooks labels Oct 1, 2024
@msujew msujew requested a review from jonah-iden October 1, 2024 17:37
Copy link
Contributor

@jonah-iden jonah-iden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool contribution!

Just having to add this noop to all special widget is not the nicest thing.
I still believe having some way to mark "main widget", meaning widgets that in vscode are normally always in the main area and thus affecting things like status bar items and active editor, etc. Then all these "main widgets" would automaticly just do the noop except if a contribution is registered for them.
This would then also greatly help with tracking the active text and notebook editor.
But thats probably something for later

@msujew msujew merged commit a9b01fe into master Oct 2, 2024
11 checks passed
@msujew msujew deleted the msujew/widget-status-bar-service branch October 2, 2024 14:49
@github-actions github-actions bot added this to the 1.55.0 milestone Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor issues related to the editor notebook issues related to notebooks statusbar issues related to the statusbar
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Editor status bar items stay when switching to a custom editor
2 participants