Skip to content

fix: dialog file filters and macOS app bundles#47825

Merged
codebytere merged 1 commit intomainfrom
app-file-fix
Jul 21, 2025
Merged

fix: dialog file filters and macOS app bundles#47825
codebytere merged 1 commit intomainfrom
app-file-fix

Conversation

@codebytere
Copy link
Member

Description of Change

Refs #46623
Closes #47815

Fixed a bug where app extensions filters didn't allow for selecting app bundles in macOS file dialogs.

This happened as a result of a bug on macOS with UTTypes where the "app" extension by default
maps to "com.apple.application-file", which is for an Application file (older single-file carbon based apps), and not modern Application Bundles (multi file packages as you'd see for all modern applications).

Checklist

Release Notes

Notes: Fixed a bug where app extensions filters didn't allow for selecting app bundles in macOS file dialogs.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/36-x-y PR should also be added to the "36-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. labels Jul 18, 2025
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jul 18, 2025
@deepak1556
Copy link
Member

What happens when this filter is applied together with treatPackageAsDirectory option, which one takes precedence ?

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jul 19, 2025
@codebytere
Copy link
Member Author

codebytere commented Jul 21, 2025

@deepak1556 it works the same as it did previously - in 36.1.0 (last known working version) treatPackageAsDirectory results in applications being selectable even with filters:

 const { canceled, filePaths } = await dialog.showOpenDialog({
    properties: ['treatPackageAsDirectory'],
    filters: [
      { name: 'Applications', extensions: ['app'] }
    ]
  })

and that is also true with this fix :)

@deepak1556
Copy link
Member

Thanks for checking!

@codebytere codebytere merged commit 2f4a070 into main Jul 21, 2025
112 of 114 checks passed
@codebytere codebytere deleted the app-file-fix branch July 21, 2025 11:57
@release-clerk
Copy link

release-clerk bot commented Jul 21, 2025

Release Notes Persisted

Fixed a bug where app extensions filters didn't allow for selecting app bundles in macOS file dialogs.

@trop
Copy link
Contributor

trop bot commented Jul 21, 2025

I have automatically backported this PR to "37-x-y", please check out #47839

@trop
Copy link
Contributor

trop bot commented Jul 21, 2025

I have automatically backported this PR to "36-x-y", please check out #47840

@trop trop bot removed the target/37-x-y PR should also be added to the "37-x-y" branch. label Jul 21, 2025
@trop
Copy link
Contributor

trop bot commented Jul 21, 2025

I have automatically backported this PR to "38-x-y", please check out #47841

@trop trop bot added in-flight/36-x-y in-flight/38-x-y and removed target/36-x-y PR should also be added to the "36-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. in-flight/36-x-y labels Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/36-x-y PR was merged to the "36-x-y" branch. merged/37-x-y PR was merged to the "37-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] showOpenDialog filters aren't working on MacOs

2 participants