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 tab width modes: equal and titleLength #3876

Merged
merged 6 commits into from
Jan 10, 2020
Merged

Conversation

cinnamon-msft
Copy link
Contributor

@cinnamon-msft cinnamon-msft commented Dec 6, 2019

Summary of the Pull Request

Created new global setting "tabWidthMode"
Will accept "equal" or "titleLength"
Equal: Similar to browser experience where all tabs are equal width
TitleLength: Original implementation where width will fit whole tab title

Changed default width behavior to Equal

Refs #597

terminal-equal-tabs-pr

@cinnamon-msft cinnamon-msft requested a review from a team December 6, 2019 23:16
@cinnamon-msft cinnamon-msft changed the title Added tab sizing Add tab sizing Dec 6, 2019
Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

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

Not sure about the default yet but the other issue I had is not really worth blocking over.

doc/cascadia/SettingsSchema.md Outdated Show resolved Hide resolved
Co-Authored-By: Carlos Zamora <carlos.zamora@microsoft.com>
Copy link
Contributor

@DHowett-MSFT DHowett-MSFT left a comment

Choose a reason for hiding this comment

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

I think this needs a mini-spec, actually.

Couple thoughts:

  • this isn't a width, it is a width mode
  • should we ditch the names equal and sizeToContent? We inherited them from the tab control, but are they right for our users?
  • should we eventually support a multi-state width syntax?
    • $min - $max, so I could specify 10-300
    • 300 would be shorthand for 300-300 (fixed width)
    • 300-auto would be min=300, max = undefined
    • auto would be shorthand for auto-auto
    • the default would be auto (the same behavior as today)

(I'm not asking for a spec because I want these idea to win; I'm asking because if I'm thinking them, others may be too, and that warrants a discussion 😄)
*

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Dec 6, 2019
@DHowett-MSFT
Copy link
Contributor

  • should it be profile-specific?

@DHowett-MSFT
Copy link
Contributor

  • should it live at the root object? what if we do want to make mode and min/max separate things?

@rkeithhill
Copy link
Contributor

RE equal vs size-to-content, what I'd like to see isn't necessarily either. Ideally, what I want is a tab system that obeys this one simple precept: all tabs are always visible with no need to scroll to see tabs. Well, except when perhaps the tabs get ridiculously narrow e.g.:

image

But ^ is fairly corner case.

Given this particularly precept, when there are a small number of tabs, you could size to content but when those combined tab widths exceed the width of the tab area, then you switch to fixed-width such that all tabs are guaranteed to be visible.

@zadjii-msft zadjii-msft added Area-Settings Issues related to settings and customizability, for console or terminal Area-User Interface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. labels Dec 9, 2019
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

I think I agree with @DHowett-MSFT, I kinda expected a mini-spec laying out the possible states that people would want for this.

I kinda expected that there'd be two settings here: tabMinWidth and tabMaxWidth.

  • tabMinWidth = tabMaxWidth = null (or undefined): the behavior we have now, size to content
  • tabMinWidth = tabMaxWidth = 200 (or whatever): the "equal" behavior from this PR
  • tabMinWidth = null, tabMaxWidth = 200: tabs can be arbitrarily small, but capped at 200px
  • etc.

The only problem I foresaw with that design was the future hypothetical "split" sizing (where tabs take all the space available to them) wasn't really represent-able. I was hoping we'd be able to come up with a combination of settings that would enable all these scenarios.

Plus, now there's @rkeithhill's suggestion, to keep making tabs smaller (to the theoretical tabMinWidth). Not sure how that's functionally possible with the current TabView (probably isn't). We'd probably want to follow up with them to get support for such a mode.
In the meantime, we'll want to make sure that there's a future-proof design that takes that into account.

The implementation looks fine by me, I kinda think this does need a spec, tbh.

@@ -13,6 +13,7 @@ Properties listed below affect the entire window, regardless of the profile sett
| `requestedTheme` | _Required_ | String | `system` | Sets the theme of the application. Possible values: `"light"`, `"dark"`, `"system"` |
| `showTerminalTitleInTitlebar` | _Required_ | Boolean | `true` | When set to `true`, titlebar displays the title of the selected tab. When set to `false`, titlebar displays "Windows Terminal". |
| `showTabsInTitlebar` | Optional | Boolean | `true` | When set to `true`, the tabs are moved into the titlebar and the titlebar disappears. When set to `false`, the titlebar sits above the tabs. |
| `tabWidth` | Optional | String | `equal` | Sets the width of the tabs. Possible values: `"equal"`, `"sizeToContent"` |
Copy link
Member

Choose a reason for hiding this comment

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

This doc suggests sizeToContent, though the rest of the pr says sizetocontent. I'm pretty sure we should go with the camelCase one

@zadjii-msft
Copy link
Member

* should it live at the root object? what if we _do_ want to make mode and min/max separate things?

I think I'm okay with this being in the root (globals) for now. This is an "application" settings, so it should live with the other application settings. In the future, we might want to consider these properties as being a part of the
theme, but I don't think we should hold up putting them in the root for now over that. We can always do a similar colorscheme/foreground (where the property from the profile overrides that from the colorscheme) thing with this once themes exist.

@vadimkantorov
Copy link

So many people raised issues, I hope equal mode is chosen as the default one

@ghost
Copy link

ghost commented Dec 20, 2019

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Dec 20, 2019
@zadjii-msft
Copy link
Member

shh msftbot, it's the holidays. Take a break.

@ghost ghost removed the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Dec 20, 2019
@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Dec 27, 2019
@ghost
Copy link

ghost commented Dec 27, 2019

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@rkeithhill
Copy link
Contributor

msftbot needs to be made aware of extended holiday breaks. :-)

@ghost ghost removed the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Dec 28, 2019
@miniksa
Copy link
Member

miniksa commented Dec 30, 2019

This comment represents me seeing this PR but choosing to not review it because there's already 3 cooks in this kitchen (despite the holiday). It serves to remind me of this decision in the future.

@cinnamon-msft cinnamon-msft mentioned this pull request Jan 3, 2020
5 tasks
@cinnamon-msft
Copy link
Contributor Author

Spec can be found here: #4104

@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jan 3, 2020
@DHowett-MSFT DHowett-MSFT dismissed their stale review January 9, 2020 21:03

Chatted o*line with Kayla

@cinnamon-msft cinnamon-msft changed the title Add tab sizing Add tab width modes: equal and titleLength Jan 9, 2020
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

Sure, there's a spec for the min/max size bits now, so I'm happy with this. I'll unblock it :)

Copy link
Contributor

@DHowett-MSFT DHowett-MSFT left a comment

Choose a reason for hiding this comment

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

please add this to defaults.json

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jan 9, 2020
@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jan 9, 2020
@cinnamon-msft cinnamon-msft merged commit cbdfd0e into master Jan 10, 2020
@cinnamon-msft cinnamon-msft deleted the cinnamon/tab-sizing branch January 10, 2020 00:16
@ghost
Copy link

ghost commented Jan 14, 2020

🎉Windows Terminal Preview v0.8.10091.0 has been released which incorporates this pull request.:tada:

Handy links:

miniksa pushed a commit that referenced this pull request Feb 9, 2021
This is the spec for #597 

I am proposing the `tabWidthMode` feature be added first, then `tabWidthMin` and `tabWidthMax` be added in a later release.

PR: #3876
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 Area-User Interface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants