Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] "New Folder" option for Mac file dialogs #949

Closed
begleynk opened this issue Jun 14, 2022 · 7 comments
Closed

[feat] "New Folder" option for Mac file dialogs #949

begleynk opened this issue Jun 14, 2022 · 7 comments
Labels
platform: macos macOS specific issues status: upstream This issue needs to be fixed in an upstream project

Comments

@begleynk
Copy link

begleynk commented Jun 14, 2022

Describe the problem

I'm not able to show the native "New Folder" button in Mac file dialogs to let users create a new folder directly in the dialog according to the docs.

I'm building an app where the user has to choose a location for their "project". The project location likely doesn't exist yet, so they'll have to create it. Because they can't create the location inline in the file dialog, they have to jump out of the app, create the directory, come back to the app, and then select it.

Describe the solution you'd like

In Electron, you can pass the createDirectory flag to show a native "New Folder" button in the Mac file dialog (link to relevant docs).

Seems like this is the cleanest solution, and Tauri could expose this option.

Alternatives considered

User can always go outside the app to create the directory.

Additional context

I understand Tauri uses rfd for file dialogs. Maybe this needs to be implemented there first? It seems it's not supported at the moment.

Love what you folks are doing with Tauri! 🎉

@FabianLars FabianLars added status: upstream This issue needs to be fixed in an upstream project platform: macos macOS specific issues labels Apr 10, 2023
@FabianLars
Copy link
Member

@jecsham
Copy link

jecsham commented Feb 9, 2024

Is there an alternative way to get the "New Folder" button in the meanwhile?

@Nick-Fanelli
Copy link

Yeah, has anyone figured anything out yet?

@amrbashir
Copy link
Member

As far as I can see in rfd source code, they are using the needed APIs, unfortunately since I don't have access to macOS, I can't investigate further

@amrbashir
Copy link
Member

amrbashir commented Feb 13, 2024

After a second look, seems like rfd are only enabling it for when picking directories, will open a PR later at rfd

@amrbashir
Copy link
Member

Opened a PR and since this will require a new version of rfd that we can't update to in v1, will move this issue to plugins-workspace to target v2 instead.

@amrbashir amrbashir transferred this issue from tauri-apps/tauri Feb 14, 2024
@Nick-Fanelli
Copy link

Thanks!

amrbashir added a commit that referenced this issue Feb 23, 2024
* feat(dialog): allow setting `canCreateDirectories` on macOS

closes #949

* Discard changes to plugins/log/src/api-iife.js

* Discard changes to plugins/store/src/api-iife.js

* Discard changes to plugins/window-state/src/api-iife.js

* Update plugins/dialog/src/commands.rs

Co-authored-by: Fabian-Lars <[email protected]>

* Update plugins/dialog/src/commands.rs

Co-authored-by: Fabian-Lars <[email protected]>

* Update plugins/dialog/src/lib.rs

Co-authored-by: Fabian-Lars <[email protected]>

* Update plugins/dialog/guest-js/index.ts

Co-authored-by: Fabian-Lars <[email protected]>

* Update plugins/dialog/guest-js/index.ts

Co-authored-by: Fabian-Lars <[email protected]>

---------

Co-authored-by: Fabian-Lars <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: macos macOS specific issues status: upstream This issue needs to be fixed in an upstream project
Projects
Status: 📬Proposal
Development

No branches or pull requests

5 participants