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

Add "Copy As..." core submenu to editor context and Edit titlebar menu #118212

Merged
merged 5 commits into from
Mar 15, 2021

Conversation

joaomoreno
Copy link
Member

@joaomoreno joaomoreno commented Mar 5, 2021

We want to have a core editor/context/copy menu so extensions can contribute menu items to a Copy As... context menu. We want the menu available in the titlebar Edit menu as well.

We want the submenu to render only if it has items inside. This is the default behavior already implemented in the editor context menu. But it wasn't for the titlebar menu. I spent nearly half an hour looking for the right places to make the titlebar menu behave the same way. I found out that we duplicate code not only between the usual menu world and the titlebar world but even between native and custom titlebars... (see both menubarControl.ts files changed) We have so much different code that translates menus into something usable, and none are easy to find. Could we please have a debt item to clean all of this up @bpasero and @sbatten?

Adding @jrieken as well for review, for an API eye.

Fixes #118208

cc @alexr00 and @eamodio for adoption once this gets merged in

@joaomoreno joaomoreno added the menus Menu items and widget issues label Mar 5, 2021
@joaomoreno joaomoreno added this to the March 2021 milestone Mar 5, 2021
@joaomoreno joaomoreno self-assigned this Mar 5, 2021
@joaomoreno joaomoreno changed the title Add "Copy As..." submenu to editor context and Edit titlebar menu Add "Copy As..." core submenu to editor context and Edit titlebar menu Mar 5, 2021
@bpasero bpasero removed their request for review March 8, 2021 06:55
@bpasero
Copy link
Member

bpasero commented Mar 8, 2021

Yielding to @sbatten to review this and follow up on the debt side of things. I believe we should have a "Copy As" also in the file explorer as I remember @egamma expressing some interest in making that menu smaller for all the copy entries we have.

@sbatten
Copy link
Member

sbatten commented Mar 8, 2021

@joaomoreno please verify with native menus on windows or linux as well

@joaomoreno
Copy link
Member Author

Pushed changes which differentiate between editor context and titlebar edit, introduced menuBar/edit/copy menu id.

@joaomoreno joaomoreno merged commit a4adb60 into main Mar 15, 2021
@joaomoreno joaomoreno deleted the joao/editor-copy-as branch March 15, 2021 13:38
@github-actions github-actions bot locked and limited conversation to collaborators Apr 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
menus Menu items and widget issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide platform "Copy As..." submenu
4 participants