Use freedesktop portal for file picker

Is your feature request related to a problem? Please describe.
On KDE plasma, I want anytype to use the KDE file picker instead of the GTK file picker

Describe the solution you’d like
Use the freedesktop “portal” protocol Portal Documentation for file picker.

Describe alternatives you’ve considered
Create a Qt and GTK app separately

I’m not familiar enough to know whether this could be something configurable like when you open an unknown file type for the first time on Windows, allowing you to choose the application you want to use to open the file (and check a box to remember this choice). @954m3not do you happen to know that?

I’m not sure what you mean. Using/following the portal specification means Anytype will use the file picker native to the user’s environment if the user doesn’t have a portal setup it should just the default file picker Anytype already uses (in this case, the GTK file picker)

A toggle could be added in Anytype’s setting to explicitly disable using portal though

@954m3not Anytype is using Electron for the desktop app, therefore as long as electron supports KDE File picker, Anytype should also be supporting it. The support for a different file picker seems to have landed in electron 14

and anytype is using Electron 16, therefore you should be able to use the KDE’s file picker.

Do you have xdg-desktop-portal and xdg-desktop-portal-kde packages installed? If not, can you please try installing them and after installing the above two packages, Kindly try opening the Anytype app with environment variable GTK_USE_PORTAL=1 set.

Please do note that there is still a Github issue tracking few cases where this feature is not properly working on few distros

Thanks for the additional explanation. I only wanted to check whether such a setup would be configurable within Anytype.