terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Update MUX to 2.8

Open zadjii-msft opened this issue 3 years ago • 1 comments
trafficstars

Just a draft to make sure it builds in CI

  • [x] closes #13495
  • [x] Should also close MSFT:28297939, which is ESB again 🙄
    • This was tracked as #12413
  • [ ] Seemingly doesn't do #9822
  • [ ] TODO! This breaks the tabview background resource
    • I bet this was https://github.com/microsoft/microsoft-ui-xaml/pull/7110
  • [x] TODO! validate that the nav view crash is really really gone
  • [ ] quite a few crashes in teardown from debugging in VS. make sure they aren't already in main?
  • [ ] VERY noticeable 1px gap between tabs and content

zadjii-msft avatar Aug 02 '22 16:08 zadjii-msft

Ho boy we're in rough shape here. WinUI 2.8 made some changes to how TabViewItems are colorized, and now we can't recolor our tabs.

refer to:

  • https://github.com/microsoft/microsoft-ui-xaml/blame/main/dev/TabView/TabView.xaml#L498
  • https://github.com/microsoft/microsoft-ui-xaml/pull/7110
  • https://github.com/microsoft/microsoft-ui-xaml/pull/6787
  • Also, https://github.com/microsoft/microsoft-ui-xaml/pull/3769#issuecomment-920111293

I think I see what's going on here. The Setter in the visual state - the one that sets the TabContainer.Background. That evaluates the Value when the TabViewItem gets instantiated (so {ThemeResource TabViewItemHeaderBackground} is already evaluated as Transparent), doesn't it. So, when we change the resources later, at runtime, it's already too late. The setter will always reset the background to Transparent, not the current value of TabViewItemHeaderBackground

I'm not sure there's a good way for us to get around this. Certainly not without creative use of a retemplate of the TabView styles.

zadjii-msft avatar Aug 02 '22 20:08 zadjii-msft

Gonna close this out for now. We're too far away from landing this and the crash fix is gonna get hotfixed in a 2.7 update.

zadjii-msft avatar Aug 16 '22 11:08 zadjii-msft

image

https://github.com/microsoft/terminal/pull/new/dev/migrie/mux-2.8.2-march-2023

Notes:

  • Copied the tab view resources into our sln to entirely re-template it.

  • Commented out all the TabContainer.Background. This brought back the color on tabs, but not always, and faintly: image Seems as though there's some visual style that's manually applying a 0.301961 Opacity to the background. But who? image

  • Resizing the window with a colored tab creates a VERY visible visual artifact (working on gif) TODO!

  • Oh right there's this wacky code:

          // In GH#11294 we thought we'd still need to set
          // TabViewItemHeaderBackground manually, but GH#11382 discovered that
          // Background() was actually okay after all.
          TabViewItem().Background(deselectedTabBrush);
          TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush);
          TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush);
          TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush);
    
  • but who

    But doctor, I am pagliacci

          // Start with the current tab color, set to Opacity=.3
          til::color deselectedTabColor{ color };
          deselectedTabColor = deselectedTabColor.with_alpha(77); // 255 * .3 = 77
    

    image

diff:

changes to the winui repo that might be relevant:

git log afa4a59f0d8d22bc2553492a49f6e017797869e1..0c556e89bf4d539c2fb3e5fe0a71e57a79fb3a1b --pretty=format:"%h %ad %s" --date=short -- dev/TabView/TabView.xaml
93e23c22 2022-07-29 Set IsTabStop=False on scroll buttons in TabView (#7539)
8e41f536 2022-06-10 [ TabView ] High contrast scroll buttons fix (#7205)
85167636 2022-05-18 set TabContainer to Transparent on selected (#7110)
6fb99c9e 2022-03-04 [TabView] Update high contrast colors | MicaAlt colors - update high contrast colors (#6787)
ef88a2ff 2022-02-07 fixed bottom right inverted contour (#6679)
2e162a90 2022-01-27 TabView Colours Update (#6573)
4a3921b8 2022-01-20 TabView Miscellaneous Fixes (#6598)
019d045b 2021-11-19 TabView: Separate border lines into being everywhere except the selected tab (#6332)
92fbfcd5 2021-11-18 TabViewItem: Make background of the selected tab all one path (#6282)
f4d71ea4 2021-10-01 Fixes TabView bottom border line is too short #5954 (#5981)

zadjii-msft avatar Mar 06 '23 20:03 zadjii-msft

Upstream: https://github.com/microsoft/microsoft-ui-xaml/issues/8260

zadjii-msft avatar Mar 07 '23 20:03 zadjii-msft