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

Introduce KeyMapping and Move TerminalSettings construction #7537

Merged
merged 11 commits into from Sep 14, 2020

Conversation

@carlos-zamora
Copy link
Member

carlos-zamora commented Sep 4, 2020

KeyMapping was introduced to break up AppKeyBindings. KeyMapping
records the keybindings from the JSON and lets you query them.
AppKeyBindings now just holds a ShortcutActionDispatcher to run
actions, and a KeyMapping to record/query your existing keybindings.
This refactor allows KeyMapping to be moved to the
TerminalSettingsModel, and ShortcutActionDispatcher and
AppKeyBindings will stay in TerminalApp.

AppKeyBindings had to be passed down to a terminal via
TerminalSettings. Since each settings object had its own
responsibility to update/create a TerminalSettings object, I moved all
of that logic to TerminalSettings. This helps with the
TerminalSettingsModel refactor, and makes the construction of
TerminalSettings a bit cleaner and more centralized.

References

#885 - this is all in preparation for the TerminalSettingsModel

Validation Steps Performed

  • Tests passed
  • Deployment succeeded
@carlos-zamora carlos-zamora mentioned this pull request Sep 4, 2020
2 of 2 tasks complete
Copy link
Contributor

leonMSFT left a comment

As far as I can see this looks pretty good, but I'd like to get other eyes on it too bc there's a lot here 😄

src/cascadia/TerminalApp/TerminalSettings.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalSettings.cpp Outdated Show resolved Hide resolved
Carlos Zamora added 2 commits Sep 9, 2020
Copy link
Member

miniksa left a comment

This looks like mainly mechanical moves to me. I'm fine with this. But I'd like @DHowett to also sign as he's been closer to this shuffling than me.

@miniksa miniksa requested a review from DHowett Sep 11, 2020
Copy link
Member

DHowett left a comment

I love love love this. Just some fit and finish stuff.

src/cascadia/TerminalApp/ColorScheme.h Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/KeyMapping.idl Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Profile.idl Outdated Show resolved Hide resolved
@@ -1030,8 +1030,7 @@ namespace winrt::TerminalApp::implementation
const auto& profileGuid = focusedTab->GetFocusedProfile();
if (profileGuid.has_value())
{
const auto settingsImpl{ winrt::get_self<implementation::CascadiaSettings>(_settings) };
const auto settings = settingsImpl->BuildSettings(profileGuid.value());
const auto settings{ winrt::make<TerminalSettings>(_settings, profileGuid.value(), *_bindings) };

This comment has been minimized.

@DHowett

DHowett Sep 11, 2020 Member

how is this different from BuildSettings?

This comment has been minimized.

@carlos-zamora

carlos-zamora Sep 14, 2020 Author Member

Function Params
Constructor CascadiaSettings, guid, IKeyBindings
BuildSettings CascadiaSettings, NewTerminalArgs, IKeyBindings

Before, they were both BuildSettings. But the second BuildSettings needs to return a tuple so we can't just make that another constructor :(

src/cascadia/TerminalApp/TerminalPage.h Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalSettings.cpp Outdated Show resolved Hide resolved
Carlos Zamora added 2 commits Sep 14, 2020
@carlos-zamora carlos-zamora assigned DHowett and unassigned leonMSFT Sep 14, 2020
@DHowett DHowett added the AutoMerge label Sep 14, 2020
@msftbot
Copy link
Contributor

msftbot bot commented Sep 14, 2020

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.
@msftbot msftbot bot merged commit abf8805 into master Sep 14, 2020
8 checks passed
8 checks passed
Spell checking
Details
Terminal CI Build #0.0.2009.1408 succeeded
Details
Terminal CI (Audit Mode Static Analysis Build x64) Audit Mode Static Analysis Build x64 succeeded
Details
Terminal CI (Build x64 Build x64 Release) Build x64 Build x64 Release succeeded
Details
Terminal CI (Build x86 Build x86 Release) Build x86 Build x86 Release succeeded
Details
Terminal CI (Code Health Scripts Proper Code Formatting Check) Code Health Scripts Proper Code Formatting Check succeeded
Details
auto-merge.config.enforce No dynamic merge policies are applicable.
license/cla All CLA requirements met.
Details
@msftbot msftbot bot deleted the dev/cazamor/set/key-mapping branch Sep 14, 2020
@msftbot
Copy link
Contributor

msftbot bot commented Sep 22, 2020

🎉Windows Terminal Preview v1.4.2652.0 has been released which incorporates this pull request.🎉

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.