-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Spec for Tab Sizing #4104
Spec for Tab Sizing #4104
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that even
should probably be equal
, but otherwise this looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one clarifying question, otherwise looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, it sounds straightforward to me. I don't think it's really high on the priority list of things for us to add, but if you believe there's sufficient motivation... you're the PM so I'm not going to stand in the way.
My comments are non-blocking.
In addition to `tabWidthMode`, the following global properties will also be available: | ||
|
||
* `tabWidthMin` | ||
* Accepts an integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully they're unsigned integers. Negative minimum and maximum width? Oh boy.
* Accepts an integer | ||
* Value correlates to the minimum amount of pixels the tab width can be | ||
* If value is less than the width of the icon, the minimum width will be the width of the icon | ||
* If value is greater than the width of the tab bar, the maximum width will be the width of the tab bar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it somewhat weird to say the minimum width of your tab will consume the ENTIRE tab bar? Does that mean with 2 tabs you instantly get the arrows because each tab is an entire width?
I realize this is the endgame of the spec, and you've got the signoffs - but is there any way you could maybe enumerate a couple settings examples and how bit the tabs end up being? Case(s) in point: {
"tabWidthMode": "equal",
"tabWidthMax": 300,
"tabWidthMin": 400
} and
What happens with one tab in the second case? What about the following: {
"tabWidthMode": "titleLength"
} If my tab title is excessively long, will "the system-defined minimum width" cut off my tab title? |
Working through my thoughts. I’ll review this when I’m at my desk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still curious about my questions from the original PR.
- this isn't a width, it is a width mode
- should we ditch the names
equal
andsizeToContent
? 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 specify10-300
300
would be shorthand for300-300
(fixed width)300-auto
would be min=300, max = undefinedauto
would be shorthand forauto-auto
- the default would be
auto
(the same behavior as today)
Also, do our users need so many knobs? Can we just expose a single tabWidth
that is fit
or shrink
or expand
or 300
? It seems like we're popping out 3 settings when one would do.
How would the settings UI look for this? Would there be one dropdown and two different sliders?
Tab Width Mode
[ Equal v ]
Tab Minimum Width
-[]-------------- 30
Tab Maximum Width
-------------[]-- 350
it seems . . . cumbersome.
* `equal` | ||
* All tabs are equal in width | ||
* If the tab bar has filled, tabs will shrink as additional tabs are added | ||
* Utilizes the `equal` setting from WinUI's TabView |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How big is equal if I do not specify sizes?
|
||
* `tabWidthMin` | ||
* Accepts an integer | ||
* Value correlates to the minimum amount of pixels the tab width can be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the value correlate with the # of pixels, or is it just literally the # of pixels? Using correlation here is unusual.
* Accepts an integer | ||
* Value correlates to the minimum amount of pixels the tab width can be | ||
* If value is less than the width of the icon, the minimum width will be the width of the icon | ||
* If value is greater than the width of the tab bar, the maximum width will be the width of the tab bar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why must we impose such a restriction/
* Value correlates to the minimum amount of pixels the tab width can be | ||
* If value is less than the width of the icon, the minimum width will be the width of the icon | ||
* If value is greater than the width of the tab bar, the maximum width will be the width of the tab bar | ||
* If not set, the tab will have the system-defined minimum width |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which is?
|
||
* `tabWidthMax` | ||
* Accepts an integer | ||
* Value correlates to the maximum amount of pixels the tab width can be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it correlatE?
* If not set, the tab will have the system-defined minimum width | ||
|
||
* `tabWidthMax` | ||
* Accepts an integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I not specify infinite
?
* Value correlates to the maximum amount of pixels the tab width can be | ||
* If value is less than the width of the icon, the minimum width will be the width of the icon | ||
* If value is greater than the width of the tab bar, the maximum width will be the width of the tab bar | ||
* If not set, the tab will have the system-defined maximum width |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Accepts an integer | ||
* Value correlates to the maximum amount of pixels the tab width can be | ||
* If value is less than the width of the icon, the minimum width will be the width of the icon | ||
* If value is greater than the width of the tab bar, the maximum width will be the width of the tab bar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I beg to differ. Why can't I have the maximum width be truly insane if I want it to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a maximum.
* If value is less than the width of the icon, the minimum width will be the width of the icon | ||
* If value is greater than the width of the tab bar, the maximum width will be the width of the tab bar | ||
* If not set, the tab will have the system-defined maximum width | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if min>max?
|
||
## UI/UX Design | ||
|
||
[This tweet](https://twitter.com/cinnamon_msft/status/1203094776117022720) displays how the `equal` and `titleLength` values behave for the `tabWidthMode` property. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the screenshot from the tweet into the spec itself. Twitter is not a durable data store.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that animations are painful, it'd be nicer if the individual frames were split out and labeled :-)
Given that the comments are only about the |
* Value correlates to the maximum amount of pixels the tab width can be | ||
* If value is less than the width of the icon, the minimum width will be the width of the icon | ||
* If value is greater than the width of the tab bar, the maximum width will be the width of the tab bar | ||
* If not set, the tab will have the system-defined maximum width |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
### Accessibility | ||
|
||
This feature could impact accessibility if the tab title isn't stored within the metadata of the tab. If the tab width is the width of the icon, then the title isn't visible. The tab title will have to be accessibile by a screen reader. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tab title is stored in the tab XAML element itself so you don't have to worry about accessibility. Even for low-vision users, the tooltip serves as a way to display the full tab title.
Hey so this spec got to 3 sign-offs, but since @DHowett-MSFT is now @DHowett, it's not technically blocked on his review anymore. We should probably leave this open till we get hist check on it too. |
This has been hanging out a long time. I asked @DHowett this morning and he said "just merge it". I think it's sufficient for now and we can make a future PR if this needs to evolve further. |
Summary of the Pull Request
This is the spec for #597
I am proposing the
tabWidthMode
feature be added first, thentabWidthMin
andtabWidthMax
be added in a later release.References
PR: #3876
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed