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

Allow the user to use the tab switcher with in-order tab switching #8076

Merged
15 commits merged into from
Nov 5, 2020

Conversation

zadjii-msft
Copy link
Member

Summary of the Pull Request

Changes the way the useTabSwitcher setting works. It now accepts either a boolean or a string:

  • true, "mru": Use the tab switcher with MRU tab switching
  • "inOrder": Use the tab switcher, with in-order tab switching
  • false, "disabled": Don't use the tab switcher. Tabs will switch in-order.

This is following the discussion chronicled in #8025, as well as the follow-up investigation in that thread.

References

PR Checklist

Validation Steps Performed

I've been switching tabs all day and all night, with different settings values, and hot-reloading the setting.

I also ran the test I added.

@ghost ghost added Area-Settings Issues related to settings and customizability, for console or terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. labels Oct 28, 2020
…order-best-order

# Conflicts:
#	src/cascadia/TerminalSettingsModel/GlobalAppSettings.h
#	src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl
DHowett pushed a commit that referenced this pull request Oct 28, 2020
All our JSON files are _actually_ JSONC files - json with comments. 

A well-behaved application that accepts JSON should accept and ignore
comments. However, `jsonlint` is not a well behaved application in this
regard.

So, to prevent the linter from complaining about our JSON comments, we
need to disable it entirely. THAT'S RIGHT, there's not a setting to
allow JSONC. 

See #8076 as an example of this working.

This will also unblock #7462.
@@ -684,8 +684,20 @@
},
"useTabSwitcher": {
"default": true,
"description": "When set to \"true\", the \"nextTab\" and \"prevTab\" commands will use the tab switcher UI.",
"type": "boolean"
"description": "When set to \"true\" or \"mru\", the \"nextTab\" and \"prevTab\" commands will use the tab switcher UI, with most-recently-used ordering. When set to \"inOrder\", the tab switcher will switch tabs in their current ordering. Set to \"false\" to disable the tab switcher.",
Copy link
Member

Choose a reason for hiding this comment

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

Took me a minute here. So the UI is used for either true, MRU, or inOrder. And false is no UI. The way it's described its sort of like "true"/"mru" = UI and MRU, "inorder" = ???? and in order, "false" = No UI. Like it's weirdly implicit that the UI is used for in order and explicit for the other two options.

Or maybe I'm just crazy.

src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
@@ -684,8 +684,20 @@
},
"useTabSwitcher": {
"default": true,
"description": "When set to \"true\", the \"nextTab\" and \"prevTab\" commands will use the tab switcher UI.",
"type": "boolean"
"description": "When set to \"true\" or \"mru\", the \"nextTab\" and \"prevTab\" commands will use the tab switcher UI, with most-recently-used ordering. When set to \"inOrder\", the tab switcher will switch tabs in their current ordering. Set to \"false\" to disable the tab switcher.",
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm is there a way we can only accept the three strings "mru", "inOrder", and "disabled"? imo that's clearer than giving the option of true/false as well

Copy link
Member Author

Choose a reason for hiding this comment

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

It's too late, we already started accepting true and false, and telling people to use those settings ;___;

So now they've gotta mean something sensible in the enum world as well

@leonMSFT leonMSFT assigned zadjii-msft and unassigned leonMSFT Oct 29, 2020
@zadjii-msft zadjii-msft assigned leonMSFT and unassigned zadjii-msft Nov 4, 2020
Copy link
Contributor

@leonMSFT leonMSFT left a comment

Choose a reason for hiding this comment

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

nice nice

@zadjii-msft zadjii-msft added the Needs-Second It's a PR that needs another sign-off label Nov 4, 2020
@ghost ghost requested a review from carlos-zamora November 4, 2020 21:06
@ghost ghost requested review from DHowett and PankajBhojwani November 4, 2020 21:06
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

Dizzying complexity. There's a lot of moving parts here.

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Nov 5, 2020
@ghost
Copy link

ghost commented Nov 5, 2020

Hello @zadjii-msft!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 6639df9 into main Nov 5, 2020
@ghost ghost deleted the dev/migrie/f/8025-in-order-best-order branch November 5, 2020 14:28
@DHowett
Copy link
Member

DHowett commented Nov 5, 2020

@zadjii-msft did you doc this? ;P

@ghost
Copy link

ghost commented Nov 11, 2020

🎉Windows Terminal Preview v1.5.3142.0 has been released which incorporates this pull request.:tada:

Handy links:

@brunosantosrhsenso
Copy link

Tab switch behavior changed on me out of nowhere. I've been using terminal for almost an year and this whole time tab switch was always in order, and that's how I like it. All of a sudden it changed to mru. May I suggest, next time a change like that is made, that the previous default behavior remains the default for old installations?

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Second It's a PR that needs another sign-off Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a setting for in-order tab traversal with the tab switcher
6 participants