[PR #18915] Add reflection to the ActionArgs in the settings model #31649

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

Original Pull Request: https://github.com/microsoft/terminal/pull/18915

State: closed
Merged: Yes


Implements reflection to the various ActionArg types in the settings model, which allows these structs to provide information about themselves (i.e. what args they contain and what types they are). This is necessary as a pre-requisite for the Settings Editor to display and modify these arg values.

Detailed Description of the Pull Request / Additional comments

  • The IActionArgs interface now has additional methods:
    • Get the number of args
    • Get/Set an arg at a specific index
    • Get a vector of arg descriptions; the arg description contains:
      • name of the arg
      • type of the arg
      • whether the arg is required
      • a tag, this is to cover special cases (for example the ColorScheme argument is technically of type "string", but only allows specific values)
  • All the macros in ActionArgsMagic have been updated to support the new interface
  • ActionMap has been updated to support adding/editing/deleting actions and keybindings from outside the SettingsModel
    • It also handles ID change requests for commands
  • EnumMappings have been added to various ActionArg enums that weren't there before

Validation Steps Performed

Bug bashed in conjunction with #18917

**Original Pull Request:** https://github.com/microsoft/terminal/pull/18915 **State:** closed **Merged:** Yes --- Implements reflection to the various ActionArg types in the settings model, which allows these structs to provide information about themselves (i.e. what args they contain and what types they are). This is necessary as a pre-requisite for the Settings Editor to display and modify these arg values. ## Detailed Description of the Pull Request / Additional comments * The `IActionArgs` interface now has additional methods: * Get the number of args * Get/Set an arg at a specific index * Get a vector of arg descriptions; the arg description contains: * name of the arg * type of the arg * whether the arg is required * a tag, this is to cover special cases (for example the ColorScheme argument is technically of type "string", but only allows specific values) * All the macros in `ActionArgsMagic` have been updated to support the new interface * `ActionMap` has been updated to support adding/editing/deleting actions and keybindings from outside the SettingsModel * It also handles ID change requests for commands * EnumMappings have been added to various ActionArg enums that weren't there before ## Validation Steps Performed Bug bashed in conjunction with #18917
claunia added the pull-request label 2026-01-31 09:48:37 +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#31649