microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
94.89k stars 8.22k forks source link

Show error state in progress ring of tab #9481

Open KalleOlaviNiemitalo opened 3 years ago

KalleOlaviNiemitalo commented 3 years ago

Description of the new feature/enhancement

If an application reports progress via OSC 9;4, Windows Terminal nowadays shows that in the task bar and in the tab header (https://github.com/microsoft/terminal/pull/8133). However, if the progress report has the error or warning state, that information goes only to the task bar. I'd like the tab header to display the error or warning, too.

Related to https://github.com/microsoft/terminal/issues/6700 and https://github.com/microsoft/terminal/issues/9435#issuecomment-796667902.

Proposed technical implementation details (optional)

Could perhaps change the color of the progress ring. I don't see any color or error property in Microsoft.UI.Xaml.Controls.ProgressRing, though.

KalleOlaviNiemitalo commented 3 years ago

Changing the colors of a ProgressRing is apparently https://github.com/microsoft/microsoft-ui-xaml/issues/1968.

If Windows Terminal instead displayed the error and warning states by changing the tab color, then it would have to be decided how that interacts with tab colors set by applications (https://github.com/microsoft/terminal/issues/6574); and if the tab color could be set in a color scheme (https://github.com/microsoft/terminal/issues/9413), then perhaps the tab error and warning colors should be configurable there as well.

DHowett commented 3 years ago

If we're willing to dispense with the progress part of the ring during an error state, we could mimic it with an elliptical path. That would give us the freedom to style it and perhaps even animate it. Likely that we'd be able to do that before microsoft/microsoft-ui-xaml#1968 lands ;P

zadjii-msft commented 3 years ago

we could mimic it with an elliptical path. That would give us the freedom to style it and perhaps even animate it

Yea that's a neat idea. If we're in the error/warning states, then we're not in the indeterminate state that needs the interesting animation anyways. A neat workaround 😉

KalleOlaviNiemitalo commented 2 years ago

The WinUI 3.0 documentation for ProgressRing now lists a Foreground property inherited from Microsoft.UI.Xaml.Controls.Control. It seems ProgressRing in WinUI 2.7 already inherited a Foreground property from Windows.UI.Xaml.Controls.Control but this was just not listed in the documentation. From ProgressRing.xaml and ProgressRing.cpp in WinUI 2.7, it looks like the property should affect the displayed color if set. I'm not sure where the WinUI 3.0 ProgressRing source code is, as ProgressRing even on the main branch of microsoft/microsoft-ui-xaml is derived from Windows.UI.Xaml.Controls.Control rather than Microsoft.UI.Xaml.Controls.Control.

mpela81 commented 2 years ago

If we like @KalleOlaviNiemitalo's suggestion the ProgressRing's Foreground property seems to work ProgressRingForeground