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

Tree/List commands should only be enabled when they can execute #53950

Closed
jrieken opened this issue Jul 10, 2018 · 7 comments
Closed

Tree/List commands should only be enabled when they can execute #53950

jrieken opened this issue Jul 10, 2018 · 7 comments
Assignees
Labels
debt Code quality issues keybindings VS Code keybinding issues list-widget List widget issues *out-of-scope Posted issue is not in scope of VS Code tree-widget Tree widget issues
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Jul 10, 2018

The WorkbenchTree in combination with the IListService and its commands bind some keys overly aggressive. For instance, ArrowLeft and ArrowRight always try to collapse/expand elements in a tree even though there is nothing to collapse or Escape tries to clear the selection when there is no selection. The consequence is that those keys cannot be used for other commands when a tree is focused (like the breadcrumbs).

@jrieken jrieken added bug Issue identified by VS Code Team member as probable bug keybindings VS Code keybinding issues labels Jul 10, 2018
@bpasero bpasero added debt Code quality issues and removed bug Issue identified by VS Code Team member as probable bug labels Jul 10, 2018
@bpasero
Copy link
Member

bpasero commented Jul 10, 2018

Maybe one way out is to add more context keys depending on:

  • current element can be expanded or not
  • there is an element selected in the tree

This would result in quite a bit of context key changes I guess when navigating around the key.

@bpasero bpasero added tree-widget Tree widget issues list-widget List widget issues labels Jul 10, 2018
@jrieken
Copy link
Member Author

jrieken commented Jul 10, 2018

Yeah, more context keys is always the answer to this and I wouldn't be worries about them changing

@bpasero
Copy link
Member

bpasero commented Jul 10, 2018

@jrieken I added a listHasSelectionOrFocus context that is only true if the list/tree has a selection or focused item and added it for the list.clear command (ESC).

I don't know why the list never implemented this command properly but I also went ahead and now the list will get its selection or focus cleared when pressing escape key.

@bpasero bpasero changed the title arrow-keys and escape are bound to aggressively List commands should only be enabled when they can execute Jul 10, 2018
@bpasero bpasero changed the title List commands should only be enabled when they can execute Tree/List commands should only be enabled when they can execute Jul 12, 2018
@joaomoreno
Copy link
Member

What to do here?

@bpasero
Copy link
Member

bpasero commented Aug 6, 2018

@joaomoreno the tree/list needs to expose some additional APIs so that the WorkbenchTree/List can set some appropriate context keys properly. E.g.:

  • is first/last element
  • is expanded/collapsed

@joaomoreno joaomoreno added this to the Backlog milestone Aug 6, 2018
@joaomoreno joaomoreno assigned joaomoreno and unassigned joaomoreno Sep 19, 2018
@bpasero bpasero added the *out-of-scope Posted issue is not in scope of VS Code label Oct 9, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 9, 2019

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@OliverJAsh
Copy link
Contributor

OliverJAsh commented Feb 2, 2021

Two other issues have been marked as duplicates of this one: #58318 and #98321. I was also about to file a new issue until I found this. Can we re-open this as it's quite an important one?

Until this is fixed the breadcrumbs are extremely difficult to use for keyboard users. Unfortunately,
the workaround mentioned here is far from sufficient because once the breadcrumbs list is open, there is no way to return focus to the breadcrumb menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Code quality issues keybindings VS Code keybinding issues list-widget List widget issues *out-of-scope Posted issue is not in scope of VS Code tree-widget Tree widget issues
Projects
None yet
Development

No branches or pull requests

4 participants