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

Combine progress states in the tab, taskbar #10755

Merged
10 commits merged into from
Aug 10, 2021
Merged

Combine progress states in the tab, taskbar #10755

10 commits merged into from
Aug 10, 2021

Conversation

zadjii-msft
Copy link
Member

Summary of the Pull Request

background-progress-000

This PR causes the Terminal to combine taskbar states at the tab and window level, according to the MSDN docs for SetProgressState.

This allows the Terminal's taskbar icon to continue showing progress information, even if you're in a pane/tab that doesn't have progress state. This is helpful for cases where the user may be running a build in one tab, and working on something else in another.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

This also fixes a related bug where transitioning from the "error" or "warning" state directly to the "indeterminate" state would cause the taskbar icon to get stuck in a bad state.

Validation Steps Performed

progress.cmd
@echo off
setlocal enabledelayedexpansion

set _type=3
if (%1) == () (
    set _type=3
) else (
    set _type=%1
)



if (%_type%) == (0) (
    <NUL set /p =�]9;4�
    echo Cleared progress
)
if (%_type%) == (1) (
    <NUL set /p =�]9;4;1;25�
    echo Started progress (normal, 25^)
)
if (%_type%) == (2) (
    <NUL set /p =�]9;4;2;50�
    echo Started progress (error, 50^)
)
if (%_type%) == (3) (
    @rem start indeterminate progress in the taskbar
    @rem this `<NUL set /p =` magic will output the text _without a newline_

    <NUL set /p =�]9;4;3�
    echo Started progress (indeterminate, {omitted})
)
if (%_type%) == (4) (
    <NUL set /p =�]9;4;4;75�
    echo Started progress (warning, 75^)
)

@ghost ghost added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. labels Jul 22, 2021
@github-actions

This comment has been minimized.

src/cascadia/TerminalApp/TaskbarState.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TaskbarState.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalTab.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@PankajBhojwani PankajBhojwani left a comment

Choose a reason for hiding this comment

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

Looks great!

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Aug 10, 2021
@ghost
Copy link

ghost commented Aug 10, 2021

Hello @zadjii-msft!

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 a14b6f8 into main Aug 10, 2021
@ghost ghost deleted the dev/migrie/b/progress-bugs branch August 10, 2021 11:16
@@ -690,37 +709,39 @@ namespace winrt::TerminalApp::implementation
// - <none>
void TerminalTab::_UpdateProgressState()
{
if (const auto& activeControl{ GetActiveTerminalControl() })
const auto state{ GetCombinedTaskbarState() };
Copy link
Member

Choose a reason for hiding this comment

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

gentle nit: we could compute the "max state" one time and store it, here, because this is the listener for all progress state changes (right?). That would make the call in TerminalPage free (it wouldn't need to min_element the group of winrt objects)

@ghost
Copy link

ghost commented Aug 31, 2021

🎉Windows Terminal Preview v1.11.2421.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-User Interface Issues pertaining to the user interface of the Console or Terminal 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. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combine pane taskbar states in the taskbar
4 participants