CmdPal: Add file and list settings controls - #49623
Open
jiripolasek wants to merge 1 commit into
Open
Conversation
Adds reusable Adaptive Card-backed settings controls for Command Palette extensions. - Adds single file, folder, and file-path list settings. - Adds string and key-value list settings with validation and duplicate prevention. - Adds backward-compatible fallbacks for unsupported hosts. - Adds sample implementations and unit tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
This PR adds reusable Command Palette extension settings controls for selecting files and folders and managing lists.
The new controls include:
FilePathSettingfor selecting a single file or folder.FilePathListSettingfor managing multiple file and/or folder paths.StringListSettingfor managing plain string values.KeyValueListSettingfor managing key-value pairs.Pictures? Picture!
PR Checklist
Detailed Description of the Pull Request / Additional comments
This PR extends
Microsoft.CommandPalette.Extensions.Toolkitwith file-path, file-path-list, string-list, and key-value-list settings.The Command Palette host registers custom Adaptive Card input elements during application startup. The controls use native file and folder pickers parented to the window containing the form, so they work correctly in both the Settings window and palette-hosted forms.
List controls render as constrained, scrollable lists with add and remove actions. They support developer-configurable validation, duplicate handling, picker modes, and error messages.
List values crossing the extension/host boundary use a structured codec that preserves unknown properties and remains compatible with the previously accepted bare-string representation. Persisted values can use the default newline representation or developer-provided conversion callbacks.
The SDK emits Adaptive Card
requiresand fallback information so extensions built with the new controls can provide actionable content when loaded by an older Command Palette host.A Sample Pages extension page demonstrates all new setting types and their validation options.
Validation Steps Performed