Skip to content

Add an explorer/title menu contribution point #108271

Closed

Description

@eamodio

Currently extensions can't contribute to the Explorer's title menu

image

It would be great to allow this. For example it would allow for a better UX in the Toggle Excluded Files to add the toggle there rather than omni-present in the statusbar (See #103536 for an ask)

Activity

  1. isidorn commented on Oct 20, 2020

    @isidorn

    Eric Amodio (@eamodio) I think this is a fair request.
    However, I would be worried that too many actions end up being there which would lead to too many details.

    So for now no immediate plans but let's leave in the backlog and I am open to allow this in the future if there are more good use cases.

  2. eamodio commented on Oct 24, 2020

    @eamodio
    ContributorAuthor

    😢

  3. gjsjohnmurray commented on Feb 6, 2021

    @gjsjohnmurray
    Contributor

    However, I would be worried that too many actions end up being there which would lead to too many details.

    Isidor Nikolic (@isidorn) that could be mitigated by implementing a '...' secondary actions menubutton which would appear if at least one contribution to explorer/title specified a group that disqualifies it from being a button on the title. The `scm/title' menu operates this way.

  4. JacksonKearl commented on Aug 13, 2021

    @JacksonKearl
    Contributor

    An "Add config files to project" extension would be a good client of this menu, probably others. Following SCM view's lead as John Murray (@gjsjohnmurray) suggests sounds reasonable.

  5. jaredbroad commented on Nov 30, 2021

    @jaredbroad

    🙏 Please reconsider for the backlog VS Code Issue Triage Bot (@vscode-triage-bot)

  6. JacksonKearl commented on Nov 30, 2021

    @JacksonKearl
    Contributor

    On Deck is higher than Backlog

  7. jaredbroad commented on Dec 1, 2021

    @jaredbroad

    Awesome thank you Jackson Kearl (@JacksonKearl)! Maybe for the December 2021 milestone then 😁 🙏

    '...' secondary actions menu button

    Also -- is this issue generally "panels adding to their title bars" or specifically the explorer panel? It would be nice if all panels operated this operated as an overflow -- e.g. 3 buttons can appear in the bar but on the 4th it appears in the ... section.

  8. JacksonKearl commented on Dec 1, 2021

    @JacksonKearl
    Contributor

    Explorer panel only. Some of the other panels already support contributions, such as SCM.

  9. jaredbroad commented on Dec 1, 2021

    @jaredbroad

    Do custom panels support buttons Jackson Kearl (@JacksonKearl)? We couldn't find anything about it.

  10. JacksonKearl commented on Dec 1, 2021

    @JacksonKearl
    Contributor

    Jared (@jaredbroad) yes, I know GitLens's panels have actions, I assume the code is pretty much the same as core's panels.

  11. dmalan commented on Sep 7, 2022

    @dmalan

    Just to add to the mix with a use case we have in mind in educational contexts, Codespaces tends to assume that a user's default workspace is /workspaces/foo, but users can open a specific subfolder therein, as file File > Open Folder. E.g., if a user opens bar, they'll find themselves at a URL like https://{name}.github.dev/?folder=%2Fworkspaces%2Ffoo%2Fbar. Once there, though, it's not particularly obvious in GUI how to pop the stack to escape bar, except via, e.g., File > Open Folder again or by changing the URL to https://{name}.github.dev/?folder=%2Fworkspaces%2Ffoo.

    Via an extension, then, we're hoping to add a "parent folder" icon to Explorer that takes students to .. with a single click or perhaps even a "home folder" icon that takes students back to /workspaces/$RepositoryName.

    We can contribute such now via view/title, but the icons then end up appearing in multiple views, not just Explorer. Ideally, it'd be possible to scope such to that specific view, a la:

    {
      "command": "extension.home",
      "group": "navigation",
      "when": "view == explorer"
    }

    Many thanks!

    CC Rongxin Liu (@rongxin-liu) John Keech (@jkeech)

  12. lramos15 commented on Sep 7, 2022

    @lramos15
    Member

    We can contribute such now via view/title, but the icons then end up appearing in multiple views, not just Explorer. Ideally, it'd be possible to scope such to that specific view, a la:

    The explorer already has 4 icons which is where we normally cap number of displayed icons in a view panel. As John Murray (@gjsjohnmurray) stated once this is implemented these contributions are likely to exist as a ... menu within the explorer. I'm curious if you feel this will hinder student's discovery of the action

  13. lramos15 commented on Oct 12, 2026

    @lramos15
    Member

    This actually works via existing menu vie titles contribs.

    "menus": {
      "view/title": [
        { "command": "myExt.toggle", "when": "view == workbench.explorer.fileView", "group": "navigation" }
      ]
    }
    

    Fixed via 063ecfe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestRequest for new features or functionalityfile-explorerExplorer widget issues

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions