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

joh/notebook toolbar #161098

Merged
merged 10 commits into from Sep 16, 2022
Merged

joh/notebook toolbar #161098

merged 10 commits into from Sep 16, 2022

Conversation

jrieken
Copy link
Member

@jrieken jrieken commented Sep 16, 2022

This is for #154804

We now have WorkbenchToolBar and MenuWorkbenchToolBar. The latter is better/simpler but a little harder to adopt. This PR is about adopting each in notebook land. This will brings the ability to right click an item and hide it.

I couldn't get this to work with notebook title toolbar. There must be some extra filtering that I didn't understand... Some work is left but I leave it to @roblourens or @rebornix


  • Use MenuWorkbenchToolBar in interactive editor
  • use WorkbenchToolBar in cellOutput but not MenuWorkbenchToolBar because some custom action things are going on
  • use MenuWorkbenchToolBar in BetweenCellToolBar
  • use WorkbenchToolBar in codeCellRunToolbar
  • use WorkbenchToolBar in notebook editor toolbar
  • use WorkbenchToolBar in notebook diff land
  • Revert "use WorkbenchToolBar in notebook editor toolbar"
  • show a disabled placeholder action when right clicking a none MenuItemAction, e.g the ... button
  • tweak delete cell toolbar
  • tweak hiddenItemStrategy for run toolbar

…ecause some custom action things are going on
@roblourens this removes listening and rebuilding the menu when `insertToolbarAlignment` changes. This might be wrong but I couldn't get see how that event relates to the number of menu items (which are context key driven)

use `WorkbenchToolBar` in CellTitleToolbarPart, doesn't use `MenuWorkbenchToolBar` because of `updateAction` things
@jrieken jrieken self-assigned this Sep 16, 2022
@VSCodeTriageBot VSCodeTriageBot added this to the September 2022 milestone Sep 16, 2022
this._toolbar.setActions(actions);
menu.dispose();
Copy link
Member Author

Choose a reason for hiding this comment

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

I changed this to be a local because I don't see any other references and disposing a menu quickly is better - since it stops listening on CKS events

@@ -40,6 +40,7 @@ export class RunToolbar extends CellPart {

const menu = this._register(menuService.createMenu(this.notebookEditor.creationOptions.menuIds.cellExecutePrimary!, contextKeyService));
const secondaryMenu = this._register(menuService.createMenu(this.notebookEditor.creationOptions.menuIds.cellExecuteToolbar, contextKeyService));
// TODO@roblourens what does secondaryMenu actually do? where/when is it rendered?
Copy link
Member Author

Choose a reason for hiding this comment

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

@roblourens wasn't sure what this secondaryMenu is about. It's like not needed, right?

Copy link
Member

Choose a reason for hiding this comment

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

This is the dropdown for the run button (has Debug Cell). For some reason I create that menu again here:

const menu = actionViewItemDisposables.add(this.menuService.createMenu(this.notebookEditor.creationOptions.menuIds.cellExecuteToolbar, contextKeyService));
I think that's the result of refactoring, I'll clean it up after your PR is merged.

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

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

Thanks!

@jrieken jrieken merged commit 107f6ca into main Sep 16, 2022
@jrieken jrieken deleted the joh/notebook-toolbar branch September 16, 2022 16:22
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants