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

Remove command's knowledge of its keys #17215

Merged
merged 96 commits into from
Jun 6, 2024
Merged

Remove command's knowledge of its keys #17215

merged 96 commits into from
Jun 6, 2024

Conversation

PankajBhojwani
Copy link
Contributor

@PankajBhojwani PankajBhojwani commented May 8, 2024

With the move to Action IDs, it doesn't quite make sense anymore for a Command to know which keys map to it. This PR removes all Keys from Command, and any callers to that now instead query the ActionMap for that Command's keys.

Closes #17160
Closes #13943

This comment has been minimized.

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

Pressing "comment" so I can see my comments before making a ruling...

Comment on lines 958 to 960
if (_actionMap)
{
auto actionPaletteItem{ winrt::make<winrt::TerminalApp::implementation::ActionPaletteItem>(action) };
auto filteredCommand{ winrt::make<FilteredCommand>(actionPaletteItem) };
_allCommands.Append(filteredCommand);
}
_allCommands.Clear();
Copy link
Member

Choose a reason for hiding this comment

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

this has a behavior difference - if you call SetCommands(nullptr) it clears allCommands. Now if you call SetActionMap(nullptr) it does not clear allCommands

Is this important?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this was ever being called with nullptr but I've fixed it to have the same behaviour!

src/cascadia/TerminalApp/CommandPalette.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/CommandPalette.h Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/SuggestionsControl.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/SuggestionsControl.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalSettingsModel/ActionMap.cpp Outdated Show resolved Hide resolved
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

Only an open question on the behavior difference

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jun 3, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jun 3, 2024

This comment has been minimized.

Base automatically changed from dev/pabhoj/action_refactor to main June 4, 2024 01:01
@DHowett DHowett dismissed stale reviews from carlos-zamora and zadjii-msft June 4, 2024 01:01

The base branch was changed.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@zadjii-msft zadjii-msft requested a review from DHowett June 6, 2024 10:40
@DHowett DHowett added this pull request to the merge queue Jun 6, 2024
Merged via the queue into main with commit d6b6aac Jun 6, 2024
20 checks passed
@DHowett DHowett deleted the dev/pabhoj/command_keys branch June 6, 2024 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants