Skip to content

Conversation

DinahK-2SO
Copy link
Contributor

@DinahK-2SO DinahK-2SO commented Aug 29, 2025

An implementation of

This pull request adds new functionality to the Storage Pickers API, introducing a SuggestedDefaultFolder property to FileOpenPicker, FileSavePicker, and FolderPicker, and enhances file type filtering in FileOpenPicker with a new FileTypeChoices property. It also refactors internal handling of folder and filter properties to provide better validation and precedence logic.

API Additions and Enhancements:

  • Added SuggestedDefaultFolder property (getter/setter) to FileOpenPicker, FileSavePicker, and FolderPicker, allowing callers to specify a default folder path. This property takes precedence over SuggestedStartLocation when both are set. (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
  • Introduced FileTypeChoices property to FileOpenPicker, allowing more granular file type filtering by mapping display names to lists of extensions. (1, 2, 3, 4)

Internal Logic and Validation Improvements:

  • Refactored folder path validation by replacing ValidateSuggestedFolder with a more general ValidateFolderPathProperty, which accepts the property name for clearer error messages. (1, 2, 3)
  • Updated picker parameter logic so that SuggestedDefaultFolder takes precedence over SuggestedStartLocation, and FileTypeChoices takes precedence over FileTypeFilter in FileOpenPicker. (1, 2, 3, 4)

Supporting Infrastructure and Versioning:

  • Updated the IDL contract version to 1.9 and annotated the new properties with the appropriate contract version to ensure compatibility and feature gating. (1, 2, 3, 4)
  • Improved internal filter handling in PickerParameters, including the ability to union file type choices for the "All Files" category and to process both FileTypeFilter and FileTypeChoices appropriately. (1, 2)

These changes provide app developers with more control over picker initialization and file type filtering, while improving validation and internal consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant