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

Redesign color schemes page #9196

Merged
9 commits merged into from Feb 19, 2021
Merged

Redesign color schemes page #9196

9 commits merged into from Feb 19, 2021

Conversation

carlos-zamora
Copy link
Member

@carlos-zamora carlos-zamora commented Feb 18, 2021

This PR performs a large overall polish of the color schemes page:

  • Ensures keyboard navigation is holistically improved (i.e. fully
    accessible, no lost focus, etc...)
  • Adds tooltips and automation properties to all controls
  • Redesigns the page according to @mdtauk's approved design
    (link).
    Note, there are some minor modifications to the design that were
    approved by @cinnamon-msft.
  • Automatically reflow's the color buttons when they do not fit in
    horizontal mode

Detailed Description of the Pull Request / Additional comments

  • Redesign
    • a data template was introduced to make color representation
      consistent and straightforward
    • ContentControl is used to hold a reference to the
      ColorTableEntry and represent it properly using the aforementioned
      data template.
    • The design is mainly a StackPanel holding two grids: color table &
      functional colors.
    • The color table is populated via code. After much thought, this
      seems to be the easiest way to correctly bind 16 controls that are
      very similar.
    • The functional colors are populated via XAML manually.
    • We need a grid to separate the text and the buttons. This allows for
      scenarios like "selection background is the longest string" to force
      the buttons and text to be aligned.
  • Reflow
    • A VisualStateManager uses an AdaptiveTrigger to change the
      orientation of the color tables' stack panel. The adaptive trigger
      was carefully calculated to align with the navigation view's
      breakpoint.
  • Keyboard Navigation
    • (a lesson from SettingContainer) ContentControl can be focused
      as opposed to the content inside of it. We don't want that, so we
      set IsTabStop to false on it. That basically fixes all of our
      keyboard navigation issues in this new design.
  • Automation Properties and ToolTips
    • As in my previous PRs, I can't seem to figure out how to bind to a
      control's automation property to its own tooltip. So I had to do
      this in the code and add a few x:Name around.

Validation Steps Performed

  • Manually tested...
    • tab navigation
    • accessibility insights
    • NVDA
    • changing color schemes updates color table
  • specific scenario:
    • change a color table color and a functional color
    • navigate to a different color scheme
    • navigate back to the first color scheme
    • if the colors persist, the changes were propagated to the settings model

References #8997 - Based on the work from @Chips1234
References #6800 - Settings UI Epic
Closes #8765 - Polish Color Schemes page
Closes #8899 - Automation Properties
Closes #8768 - Keyboard Navigation

@ghost ghost added Area-Settings UI Anything specific to the SUI Issue-Bug It either shouldn't be doing this or needs an investigation. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Feb 18, 2021
@carlos-zamora
Copy link
Member Author

Demos

Resizing Demo

Keyboard Navigation Demo

@DHowett
Copy link
Member

DHowett commented Feb 18, 2021

Note, there are some minor modifications to the design that were approved by @cinnamon-msft.

just for awareness, can you explain what they were and where they were approved?

@htcfreek
Copy link

htcfreek commented Feb 18, 2021

@carlos-zamora
I am a bit confused on this PR because #8997 isn't ready to merge.

  1. There are some ideas not implemented (column title, improved tooltip).
  2. You have copied a bug into your PR that isn't fixed completely in [Settings UI] [Colour schemes page] Redesign Colour Buttons  #8997.
    (See my reviews on the other PR.)

@cinnamon-msft
Copy link
Contributor

Tweaks to @mdtauk's design include moving the color buttons closer to the labels on the left and also making the "Color table" and "Functional colors" text subtitles. Also, we moved the functional colors closer to the color table to keep it more compact.

@carlos-zamora
Copy link
Member Author

@carlos-zamora
I am a bit confused on this PR because #8997 isn't ready to merge.

  1. There are some ideas not implemented (column title, improved tooltip).
  2. You have copied a bug into your PR that isn't fixed completely in [Settings UI] [Colour schemes page] Redesign Colour Buttons  #8997.
    (See my reviews on the other PR.)

Sorry for the confusion. I gave #8997 a deadline of 2/15 here because it's blocking closing a few bugs for the Settings UI. As we're preparing for release, I'd like to make sure the keyboard navigation and accessibility story are complete, and the redesign kinda encompasses that.

Regarding some other feedback from #8997...

From this comment:

I think you should add a small header above the two columns to indicate that the first color column are the non-bright version and the second color column are the bright version of the color.

Personally, I think adding the extra small headers would make it feel more cluttered. The format of the color table is already standard across terminal color schemes. That said, to make it more inclusive, maybe a link to the docs or a small description would be nice? @cinnamon-msft Thoughts?

From this comment:

I have looked at the tooltip text and want to bring up one point: As example the tooltip for the red non-bright color element says "red". But isn't this confusing if I choose an other color because I create a special color sheme? (Example: color=purple, tooltip say "red")

This could be a special problem for people with eye problems like people with a red-green weakness.

First off, I'm trying to minimize localization changes so if we go with this, I'll want it to be a follow up. Aside from that, this really is the same kind of issue as your last comment. "Red" actually being some hex code that doesn't look red at all is pretty standard across terminals. In fact, when you use something like PowerShell and get the "Red" color, you just get the color table's "red", not the actual red color. Again, in an effort to make it more inclusive, I'd say adding a link to the docs or a small description might work. @cinnamon-msft Thoughts?

Alternatively, we could extract the hex value from the color picker and display that as the tooltip. But I don't see much value to it, and I think this would be better as a follow-up if we decide to go with it.

@htcfreek

This comment has been minimized.

@cinnamon-msft
Copy link
Contributor

From this comment:

I think you should add a small header above the two columns to indicate that the first color column are the non-bright version and the second color column are the bright version of the color.

Personally, I think adding the extra small headers would make it feel more cluttered. The format of the color table is already standard across terminal color schemes. That said, to make it more inclusive, maybe a link to the docs or a small description would be nice? @cinnamon-msft Thoughts?

I know we want to eventually add docs links to the right side of all of the pages, so maybe we hold off until then? I agree that adding headers over each color may be too cluttered.

From this comment:

I have looked at the tooltip text and want to bring up one point: As example the tooltip for the red non-bright color element says "red". But isn't this confusing if I choose an other color because I create a special color sheme? (Example: color=purple, tooltip say "red")
This could be a special problem for people with eye problems like people with a red-green weakness.

First off, I'm trying to minimize localization changes so if we go with this, I'll want it to be a follow up. Aside from that, this really is the same kind of issue as your last comment. "Red" actually being some hex code that doesn't look red at all is pretty standard across terminals. In fact, when you use something like PowerShell and get the "Red" color, you just get the color table's "red", not the actual red color. Again, in an effort to make it more inclusive, I'd say adding a link to the docs or a small description might work. @cinnamon-msft Thoughts?

Same as my comment above. The colors in the tooltips align directly with how shells interpret their colors, for example Ubuntu uses "blue" and "green" as its colors in the prompt. This means it'll display whatever is set to "blue" and "green" even though they may not actually be blue and green, which is totally fine.

@DHowett
Copy link
Member

DHowett commented Feb 18, 2021

Same as my comment above. The colors in the tooltips align directly with how shells interpret their colors, for example Ubuntu uses "blue" and "green" as its colors in the prompt. This means it'll display whatever is set to "blue" and "green" even though they may not actually be blue and green, which is totally fine.

Sorta yes, sorta no. Ubuntu uses "four" and "two" as the colors for its prompt. The more correct expression for this is, like... "ANSI Color 0 (Usually Black)" "ANSI Color 7 (Usually White)"

@DHowett
Copy link
Member

DHowett commented Feb 18, 2021

But we accept as a shortcut the "usually" part, and boil it down to Red. Bright red. Black. "Bright black", whatever that is.

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.

VERY, very clever with the data templates. That's excellent work. Big/small nits.

src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp Outdated Show resolved Hide resolved
Automation::AutomationProperties::SetName(DeleteButton(), RS_(L"ColorScheme_DeleteButton/Text"));
}

void ColorSchemes::SizeChanged(IInspectable const& /*sender*/, Windows::UI::Xaml::SizeChangedEventArgs const& e)
Copy link
Member

Choose a reason for hiding this comment

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

sorry, we couldn't use a VSM because what now? we would have to retemplate the entire thing? heck naw

Copy link
Member Author

Choose a reason for hiding this comment

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

The VSM honestly just made the code more complex to change this one value. The changes would look something like this...

  • add the VSM; define 2 states (compact and standard)
  • Either...
    • set up an AdaptiveTrigger to switch between the states (I'd probably have to bind that to the _colorPanelHorizontalWidth + indentMargin, which would be annoying to set up in the code)
    • set up SizeChanged (like we do here), and call VisualStateManager::GoToState()

Reference: https://docs.microsoft.com/en-us/windows/uwp/design/layout/layouts-with-xaml#adaptive-layouts-with-visual-states-and-state-triggers

src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalSettingsEditor/ColorSchemes.h Outdated Show resolved Hide resolved
@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Feb 18, 2021
@carlos-zamora
Copy link
Member Author

New Demo

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.

Okay I have a lot of questions and it's 5:09 here

src/cascadia/TerminalSettingsEditor/ColorSchemes.xaml Outdated Show resolved Hide resolved
src/cascadia/TerminalSettingsEditor/ColorSchemes.xaml Outdated Show resolved Hide resolved
src/cascadia/TerminalSettingsEditor/ColorSchemes.xaml Outdated Show resolved Hide resolved
src/cascadia/TerminalSettingsEditor/ColorSchemes.xaml Outdated Show resolved Hide resolved
src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp Outdated Show resolved Hide resolved
@htcfreek
Copy link

htcfreek commented Feb 19, 2021

Same as my comment above. The colors in the tooltips align directly with how shells interpret their colors, for example Ubuntu uses "blue" and "green" as its colors in the prompt. This means it'll display whatever is set to "blue" and "green" even though they may not actually be blue and green, which is totally fine.

Sorta yes, sorta no. Ubuntu uses "four" and "two" as the colors for its prompt. The more correct expression for this is, like... "ANSI Color 0 (Usually Black)" "ANSI Color 7 (Usually White)"

We could use "Show color type as ..." so for light red the tooltipp says "Show light red as ...". This makes clear what the tooltip means.

But I am okay when you let it as is. If the users are confused they will fill issues and the you can think on a solution again.

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.

Now this, I like this

@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Feb 19, 2021
@ghost
Copy link

ghost commented Feb 19, 2021

Hello @DHowett!

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 bb0e1d3 into main Feb 19, 2021
@ghost ghost deleted the dev/cazamor/sui/color-schemes-redesign branch February 19, 2021 18:20
@ghost
Copy link

ghost commented Mar 1, 2021

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

Handy links:

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 UI Anything specific to the SUI AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
5 participants