Skip to content

CmdPal: Add file and list settings controls - #49623

Open
jiripolasek wants to merge 1 commit into
mainfrom
dev/jpolasek/f/49622-adaptive-list-settings
Open

CmdPal: Add file and list settings controls#49623
jiripolasek wants to merge 1 commit into
mainfrom
dev/jpolasek/f/49622-adaptive-list-settings

Conversation

@jiripolasek

@jiripolasek jiripolasek commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

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:

  • FilePathSetting for selecting a single file or folder.
  • FilePathListSetting for managing multiple file and/or folder paths.
  • StringListSetting for managing plain string values.
  • KeyValueListSetting for managing key-value pairs.
  • Optional regex validation for strings, keys, and values.
  • Optional duplicate prevention for strings and key-value keys.
  • Configurable file picker filters.
  • Custom persisted-string conversion.
  • Fallback content when the Command Palette host does not support a control. But this has no direct impact now, because there's a bug in WinUI3 AC renderer that throws it away (sad panda).

Pictures? Picture!

image

PR Checklist

  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

This PR extends Microsoft.CommandPalette.Extensions.Toolkit with 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 requires and 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

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.
@jiripolasek jiripolasek self-assigned this Aug 2, 2026
@jiripolasek jiripolasek added the Product-Command Palette Refers to the Command Palette utility label Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Command Palette Refers to the Command Palette utility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CmdPal: File and list settings control

1 participant