[PR #9543] [CLOSED] Give Command ownership over KeyChord #27619

Open
opened 2026-01-31 09:23:06 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/9543
Author: @carlos-zamora
Created: 3/18/2021
Status: Closed

Base: mainHead: dev/cazamor/tsm/upgrade-command


📝 Commits (7)

  • fd6f9d5 Give Command ownership over KeyChord
  • e3adbb4 remove KeyChordText from Command
  • 03b9a06 fix nested key chords
  • 5ce4f46 Merge branch 'main' into dev/cazamor/tsm/upgrade-command
  • 14ba645 xaml format
  • 100a7a9 add [] notation support to converter
  • e5e91c9 Merge branch 'main' into dev/cazamor/tsm/upgrade-command

📊 Changes

13 files changed (+155 additions, -22 deletions)

View changed files

📝 src/cascadia/TerminalApp/ActionPaletteItem.cpp (+2 -2)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+7 -7)
📝 src/cascadia/TerminalSettingsEditor/Actions.cpp (+1 -1)
📝 src/cascadia/TerminalSettingsEditor/Actions.xaml (+5 -3)
📝 src/cascadia/TerminalSettingsEditor/Converters.idl (+10 -0)
src/cascadia/TerminalSettingsEditor/KeyChordConverter.cpp (+48 -0)
src/cascadia/TerminalSettingsEditor/KeyChordConverter.h (+11 -0)
📝 src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj (+6 -0)
📝 src/cascadia/TerminalSettingsModel/Command.cpp (+4 -2)
📝 src/cascadia/TerminalSettingsModel/Command.h (+1 -1)
📝 src/cascadia/TerminalSettingsModel/Command.idl (+1 -1)
📝 src/cascadia/TerminalSettingsModel/KeyChordSerialization.cpp (+49 -5)
📝 src/cascadia/TerminalSettingsModel/KeyChordSerialization.h (+10 -0)

📄 Description

Transfers ownership of a KeyChord to Command. This includes...

  • Adding an observable getter/setter for KeyChord to Command
  • Add deserialization logic to handle keys
  • Remove recursive updating of Command::KeyChordText
  • removing Command::KeyChordText which caused...
    • Command palette needs to convert the KeyChord to a string
    • Add a few more converters to handle this in the Actions page (SUI)

KeyChordSerialization experienced a minor refactor. I introduced the ConversionTrait<KeyChord> there, and simply use the existing FromString and ToString logic to handle everything.

References

#9428 - Spec

Validation Steps Performed

Checked the following...

  • Command Palette
    • key chord text is still displayed, when applicable
  • Actions Page
    • only actions with keys are displayed

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/9543 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 3/18/2021 **Status:** ❌ Closed **Base:** `main` ← **Head:** `dev/cazamor/tsm/upgrade-command` --- ### 📝 Commits (7) - [`fd6f9d5`](https://github.com/microsoft/terminal/commit/fd6f9d5e3a7f19ac4d70d75361ca7168fab36099) Give Command ownership over KeyChord - [`e3adbb4`](https://github.com/microsoft/terminal/commit/e3adbb4027f991d6886c92262f48950692c5a39a) remove KeyChordText from Command - [`03b9a06`](https://github.com/microsoft/terminal/commit/03b9a06c85bdcc285e2560e762bb21013830d0b7) fix nested key chords - [`5ce4f46`](https://github.com/microsoft/terminal/commit/5ce4f46c0109dbce650467bd124c25607bc8b803) Merge branch 'main' into dev/cazamor/tsm/upgrade-command - [`14ba645`](https://github.com/microsoft/terminal/commit/14ba6453236f55705739b635042bb655eed27be0) xaml format - [`100a7a9`](https://github.com/microsoft/terminal/commit/100a7a9429d690535838e8ca77306fbd7b69a703) add [] notation support to converter - [`e5e91c9`](https://github.com/microsoft/terminal/commit/e5e91c928671f6cd6f6c47a77fd8df7b592d598a) Merge branch 'main' into dev/cazamor/tsm/upgrade-command ### 📊 Changes **13 files changed** (+155 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/ActionPaletteItem.cpp` (+2 -2) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+7 -7) 📝 `src/cascadia/TerminalSettingsEditor/Actions.cpp` (+1 -1) 📝 `src/cascadia/TerminalSettingsEditor/Actions.xaml` (+5 -3) 📝 `src/cascadia/TerminalSettingsEditor/Converters.idl` (+10 -0) ➕ `src/cascadia/TerminalSettingsEditor/KeyChordConverter.cpp` (+48 -0) ➕ `src/cascadia/TerminalSettingsEditor/KeyChordConverter.h` (+11 -0) 📝 `src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj` (+6 -0) 📝 `src/cascadia/TerminalSettingsModel/Command.cpp` (+4 -2) 📝 `src/cascadia/TerminalSettingsModel/Command.h` (+1 -1) 📝 `src/cascadia/TerminalSettingsModel/Command.idl` (+1 -1) 📝 `src/cascadia/TerminalSettingsModel/KeyChordSerialization.cpp` (+49 -5) 📝 `src/cascadia/TerminalSettingsModel/KeyChordSerialization.h` (+10 -0) </details> ### 📄 Description Transfers ownership of a `KeyChord` to `Command`. This includes... - Adding an observable getter/setter for `KeyChord` to `Command` - Add deserialization logic to handle `keys` - Remove recursive updating of `Command::KeyChordText` - removing `Command::KeyChordText` which caused... - Command palette needs to convert the `KeyChord` to a string - Add a few more converters to handle this in the Actions page (SUI) `KeyChordSerialization` experienced a minor refactor. I introduced the `ConversionTrait<KeyChord>` there, and simply use the existing `FromString` and `ToString` logic to handle everything. ## References #9428 - Spec ## Validation Steps Performed Checked the following... - Command Palette - key chord text is still displayed, when applicable - Actions Page - only actions with keys are displayed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:23:06 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27619