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

Clean up boundary between terminal app and terminal page #2208

Conversation

KaiyuWang16
Copy link
Contributor

@KaiyuWang16 KaiyuWang16 commented Aug 2, 2019

This PR is for this project: #1878

Refere

PR Checklist

For now, the new TerminalPage class includes;

global error dialogs
ETW global registration
tab management
tab icons
clipboard management
ETW tab logging
key bindings

And App is responsible for:
settings
settings reload

One issue remaining for now is that I have not figured out how to move the four winrt event handlers in App down to Terminal. I have some work-arounds to attach AppHost methods to the event handlers, but I am still working on this.

Test: According to Griese, we do not have integration/unit tests for now. I have manually tested the app with following actions:

Open new tabs
close tabs
close the last tab
resize window
minimize/restore
ShowTitleBar, true/false
change settings: font size, background color, useAcrylic
Copy/Paste with mouse/keyboard
Tab switch/add/close/ using keys
About button
Split pane vertically and horizontally
Resize panes with keys
Move focus on different panes with keys
Change theme while the app is on.
Change cmd title while the app is on

@codendone
Copy link

    std::shared_mutex _dialogLock;

Looks like this is only used in TerminalPage now, which has its own copy.


Refers to: src/cascadia/TerminalApp/App.h:56 in 26d69a5. [](commit_id = 26d69a5, deletion_comment = False)

@KaiyuWang16 KaiyuWang16 force-pushed the dev/kawa/1878-Clean-up-boundary-between-TerminalApp-and-TerminalPage branch from 26d69a5 to 514222b Compare August 6, 2019 00:48
src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp 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 Aug 8, 2019
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.

So far so good. I have a couple questions, an I know there's a bit more in the works so I'll come back and take another pass when that's all finished.

src/cascadia/TerminalApp/App.cpp Outdated Show resolved Hide resolved
src/cascadia/WindowsTerminal/AppHost.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/App.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/App.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp 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 Aug 9, 2019
Copy link
Contributor Author

@KaiyuWang16 KaiyuWang16 left a comment

Choose a reason for hiding this comment

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

An alternative for ShowDialog is to let TerminalPage call back to App. We can get the App object in this way:

App app = Windows::UI::Xaml::Application::Current().as();

And we can call public methods in App. Example: app.GetLaunchDimensions(dpix)

src/cascadia/TerminalApp/App.cpp Outdated Show resolved Hide resolved
src/cascadia/WindowsTerminal/AppHost.cpp Show resolved Hide resolved
src/cascadia/TerminalApp/App.idl Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.h Outdated Show resolved Hide resolved
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.

This is some preliminary feedback. I haven't gotten through all of it but there are some points here that could be addressed

src/cascadia/WindowsTerminal/AppHost.cpp Outdated Show resolved Hide resolved
src/cascadia/WindowsTerminal/AppHost.h Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/App.h Show resolved Hide resolved
src/cascadia/TerminalApp/App.h Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/App.cpp Show resolved Hide resolved
@KaiyuWang16 KaiyuWang16 force-pushed the dev/kawa/1878-Clean-up-boundary-between-TerminalApp-and-TerminalPage branch from 344655c to c145847 Compare August 19, 2019 18:06
@DHowett-MSFT DHowett-MSFT changed the title Dev/kawa/1878 clean up boundary between terminal app and terminal page Clean up boundary between terminal app and terminal page Aug 19, 2019
src/cascadia/TerminalApp/TerminalPage.h Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/App.idl Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/App.h Show resolved Hide resolved
src/cascadia/TerminalApp/App.h Show resolved Hide resolved
src/cascadia/WindowsTerminal/AppHost.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.idl Show resolved Hide resolved
@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 19, 2019
@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 23, 2019
@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 26, 2019
@DHowett-MSFT DHowett-MSFT dismissed their stale review August 29, 2019 00:44

outdated, need time to look again

@DHowett-MSFT
Copy link
Contributor

@microsoft/windows-console-team time to review this! Thanks alL!

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.

Looks good to me!

@zadjii-msft zadjii-msft added the Needs-Second It's a PR that needs another sign-off label Sep 3, 2019
@ghost ghost requested a review from miniksa September 3, 2019 14:49
src/cascadia/TerminalApp/TerminalPage.h Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.h Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/App.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp 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 Sep 4, 2019
Copy link
Contributor

@DHowett-MSFT DHowett-MSFT left a comment

Choose a reason for hiding this comment

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

Thank you!

@DHowett-MSFT
Copy link
Contributor

The code formatting check failed.

@KaiyuWang16
Copy link
Contributor Author

The code formatting check failed.

Format issue fixed, tested again and there is no bug. Merge.

@KaiyuWang16 KaiyuWang16 merged commit ce3028e into master Sep 4, 2019
hoxha-saber added a commit to hoxha-saber/terminal that referenced this pull request Sep 4, 2019
Clean up boundary between terminal app and terminal page (microsoft#2208)
@ghost
Copy link

ghost commented Sep 24, 2019

🎉Windows Terminal Preview v0.5.2661.0 has been released which incorporates this pull request.:tada:

Handy links:

@DHowett-MSFT DHowett-MSFT deleted the dev/kawa/1878-Clean-up-boundary-between-TerminalApp-and-TerminalPage branch May 5, 2020 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Second It's a PR that needs another sign-off
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up the boundary between TerminalPage and TerminalApp
5 participants