PolyMeilex / rfd

Rusty File Dialog
MIT License
524 stars 60 forks source link

feat(macos): add `set_can_create_directories` #172

Closed amrbashir closed 4 months ago

amrbashir commented 4 months ago

ref: https://github.com/tauri-apps/plugins-workspace/issues/949

PolyMeilex commented 4 months ago

Are there any disadvantages of just always enabling it, and not exposing it in public API?

amrbashir commented 4 months ago

Not that I know of but seeing that electron decided to provide an explicit option for it, and from experience in Tauri, users always ask for the option.

I think we can enable it by default and come back to an API if more users ask for it?

PolyMeilex commented 4 months ago

Now that I look at the linked issue, it seems like it is referring to directory picker, but tauri is stuck on old rfd version that used to not enable create-dir for those.

Perhaps I can just do a backport release for the version tauri uses, so it can pin to that instead and get the new directory picker behavior on macos?


Would be great to just switch from problematic gtk based rfd to xdg-portal based rfd in tauri and allow it to update to new versions, but that will probably flood the issue tracker with people that don't want to have xdg-portal on their systems (don't ask why some people don't want to have a core system component installed, that's how life on Linux looks like at times XD)

amrbashir commented 4 months ago

Now that I look at the linked issue, it seems like it is referring to directory picker, but tauri is stuck on old rfd version that used to not enable create-dir for those.

I think creating directories should still be enabled for file dialogs specially in the save dialog.

Perhaps I can just do a backport release for the version tauri uses, so it can pin to that instead and get the new directory picker behavior on macos?

That would be really nice, thanks.

Would be great to just switch from problematic gtk based rfd to xdg-portal based rfd in tauri and allow it to update to new versions, but that will probably flood the issue tracker with people that don't want to have xdg-portal on their systems (don't ask why some people don't want to have a core system component installed, that's how life on Linux looks like at times XD)

I can relate to the pain, developers simply don't want to require their users to have certain dependency installed. Linux users can be masochistic when it comes to reducing the number of packages on their system.

PolyMeilex commented 4 months ago

should still be enabled for file dialogs specially in the save dialog.

macOs does that by default for save dialogs

I don't mind the additional API afterall, let's merge this as is.

I will ping you once I do the backport release. We really have to figure something out long term tho :smile:

amrbashir commented 4 months ago

macOs does that by default for save dialogs

good to know, don't have a macOS to test 😄

I will ping you once I do the backport release. We really have to figure something out long term tho 😄

yeah, it is something we will need to do before tauri v2 goes into stable

PolyMeilex commented 4 months ago

Decided to just drop the idea of doing backports, I've added zenity fallback for xdg portal backend instead, for people with broken systems.

XDG Portal backend is now the default, and GTK3 became opt-in (and will probably be remove in the future)

This is now published as 0.14.0, and tauri should be able to switch to it.

amrbashir commented 4 months ago

No worries, we will be updating soon, thanks