Skip to content

Conversation

FabianLars
Copy link
Member

fixes #2423
fixes #2826
closes #2866

from a bit of googling around it seems like there's no reason to use ACTION_PICK like ever. Replacing it with what we use when no filters are set was enough to fix the issue. From quite a bit of testing there also seems no reason for that setIntentMimeTypes function to exist. I did not see any difference in behavior so i'd prefer to remove it.

And yes, setting / even if you set a single filter is totally fine.

@FabianLars FabianLars requested a review from a team as a code owner July 24, 2025 15:39
Copy link
Contributor

Package Changes Through 42f62f9

There are 2 changes which include dialog with patch, dialog-js with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.31 2.0.32
api-example-js 2.0.27 2.0.28
dialog 2.3.1 2.3.2
dialog-js 2.3.1 2.3.2

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@FabianLars FabianLars changed the title fix(dialog): fix file picker not opening on android when filters are set fix(dialog): remove use of ACTION_PICK Jul 24, 2025
@FabianLars
Copy link
Member Author

successfully tested by community #2423 (comment)

Copy link
Contributor

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like Android got tons of different APIs for doing this, from ACTION_GET_CONTENT's docs, it seems like we should almost always prefer it over ACTION_PICK

Note: didn't test

Comment on lines +60 to +61
// TODO: ACTION_OPEN_DOCUMENT ??
val intent = Intent(Intent.ACTION_GET_CONTENT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the docs I read about were using ACTION_OPEN_DOCUMENT, and https://developer.android.com/guide/components/intents-common#GetFile seems to suggest that EXTRA_MIME_TYPES is not available for ACTION_GET_CONTENT, but from testing it does work

And seems like if I use ACTION_OPEN_DOCUMENT, I'll be limited to just the files, but with ACTION_GET_CONTENT I can pick files from other apps (so I would probably prefer ACTION_GET_CONTENT as the one you're currently using)

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc (already forget 4 days later) other similar frameworks use open_document instead as well. One thing that seems like a major advantage of open_document is that is opens them in-place without copying them into your app cache or whatever. so i guess offering it as an option (after more investigation) sounds valuable to me.

And seems like if I use ACTION_OPEN_DOCUMENT, I'll be limited to just the files

not sure what you mean

it seems like we should almost always prefer it over ACTION_PICK

yep, action_pick only makes sense if we already have a list of data/files which i can't really think of a usecase for here

Copy link
Contributor

@Legend-Master Legend-Master Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what you mean

This is with ACTION_OPEN_DOCUMENT (there's no side bar available and you can't choose files from Photos for example)

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah got it. i guess that makes sense though with how it opens files without copying them. hard to do if the file may be in the cloud.

@FabianLars FabianLars merged commit af08c66 into v2 Jul 28, 2025
8 checks passed
@FabianLars FabianLars deleted the fix/dialog/android-filters branch July 28, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] open from Dialog plugin has issues with filters on android Tauri dialog box not opening in Android 15
2 participants