SetTemplateMetadata previously delegated to a std::wstring-returning
SerializeTemplateParameters defined inside the wrapper's extern "C"
block; a C-linkage function may not return a C++ type (warning C4190,
treated as error). Inline the JSON serialization so both helpers return
void. Verified: KeyboardManagerEditorLibraryWrapper.vcxproj builds.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses correctness, robustness, and round-trip issues found while
reviewing the CLI-command-template work:
- Required-parameter validation: gate Save on IsAllValid and bubble
parameter changes to the host (previously could save "--open-settings=").
- FFI read-back: carry templateId/templateParameters back to C# so a
template mapping survives a rebuild from default.json (struct + both
GetShortcutRemap[ByType] + KeyboardMappingService projection).
- Catalog load: wrap menu build in try/catch so a malformed catalog
degrades gracefully instead of crashing the editor at startup.
- Install location: retarget the per-user PowerToys.exe path to a
machine-wide install when the LOCALAPPDATA path is absent.
- Missing-template "Keep as plain command": preserve the resolved
command instead of leaving an empty, unsavable OpenApp form.
- TemplateResolver: single-pass substitution + CommandLineToArgvW
quoting (prevents substitution-injection and arg-splitting).
- C++ load: type-check templateParameters before reading so malformed
optional metadata no longer drops the whole mapping; dedupe GetObjectW.
- schemaVersion: accept forward-compatible (>=1) catalogs; honor iconGlyph.
- Fix SelectionChanged/AppSpecificCheckBox handler re-subscription leak.
- Add KeyboardManagerEditorUI.UnitTests (resolver + catalog model);
15 tests, wired into PowerToys.slnx.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds templateId / templateParameters round-trip through the full stack:
Shortcut struct → MappingConfiguration (load+save) → EditorLibraryWrapper
(AddShortcutRemap) → C# P/Invoke → KeyboardMappingService. Non-template
mappings produce clean JSON (fields only emitted when non-empty). New
params default to nullptr so existing callers are unaffected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
## Running the Project
**Option 1: Test via runner**
1. Check out branch `niels9001/kbm-ux-consolidation`
2. Build PowerToys project
3. Manually build `Modules/KeyboardManagerEditorUI` project separately
4. Run `runner` project
5. Ensure experimental features are enabled in general settings (should
be on by default)
6. Launch keyboard manager via settings app
**Option 2: Test via installer**
1. Install PowerToys via installer on azure pipeline
1. Launch keyboard manager
## Validation
For each page (Text, Remappings, Programs, URLs):
* Create shortcuts with variable options and ensure they run as expected
* Delete shortcuts and ensure they no longer execute
* Try to create invalid shortcuts to check for proper validation
* Ensure created shortcuts appear in Power Toys Settings Keyboard
manager page
* Try toggling shortcuts
* Try deleting shortcuts while toggled off
### UI
* Any feedback on UI design appreciated as well
<img width="1071" height="671" alt="image"
src="https://github.com/user-attachments/assets/d2e81de0-6d92-4189-9a33-32e94cce74f7"
/>
<img width="2142" height="1341" alt="image"
src="https://github.com/user-attachments/assets/0e4e5685-fdf1-4dfd-ba52-a2e5bc9a66db"
/>
Closes: #15870Closes: #31902Closes: #45302Closes: #36227Closes: #16093Closes: #13409Closes: #9919
Closes: #9482Closes: #8798
Closes: #7054Closes: #2733Closes: #2027Closes: #30167
---------
Co-authored-by: Hao Liu <liuhao3418@gmail.com>
Co-authored-by: chenmy77 <162882040+chenmy77@users.noreply.github.com>
Co-authored-by: Niels Laute <niels.laute@live.nl>
Co-authored-by: Jay <65828559+Jay-o-Way@users.noreply.github.com>
Co-authored-by: Jaylyn Barbee <51131738+Jaylyn-Barbee@users.noreply.github.com>
Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
* Set up KBM WinUI3 Editor UI project
* Test invoking the KBM library via wrapper for WinUI3 C# UI
* Set up Editor Library Wrapper and enable logging
* fix spelling
* update spacing and remove unused file
* fix formatting
* update sln
* update wrapper project config
* import common props
* update UI reference
* gate the new editor with the experimentation toggle in settings