-
Notifications
You must be signed in to change notification settings - Fork 3
fix: Android presents file picker for File block upload #128
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
Conversation
The previous implementation failed to display a file picker due to the `acceptedTypes` parameter being `[""]`.
Expand testing capabilities.
@dcalhoun I set JPAndroid to use the local GutenbergKit build and pulled this branch. I do see that choosing to upload a file now shows the file picker and the appropriate pickers are shown for other media, but after choosing any upload, it fails to be attached to the post. This is with a physical Pixel 8a, API 35. I tried three different sites with the same result, but nothing helpful appeared in logcat. I also duplicated the issue in an emulator. image.mp4 |
@nbradbury that outcome is surprising, and I am unable to reproduce. I do notice the button UI is your recording is misaligned. I'm guessing your local clone does not have a recent build output. Will you try running To elaborate, the GutenbergKit repo does not track Android build out in VCS. So, when you "set JPAndroid to use the local GutenbergKit build and pulled this branch," it could very well use old build output or have no build output at all (if you've never built the project). Running |
@dcalhoun Thanks for the elaboration, and sorry to be such a noob regarding this form of development! I tried running
I've attached the debug log and a screenshot of the Terminal window, but I hate to waste your time tracking down my build issues. Is there a way I can test using a remote hash instead? |
@nbradbury the issue appears to be the issue you've encountered before (p1738080148509469/1738074782.197839-slack-C011BKNU1V5): using an incorrect Node.js version. From your log:
Before running any project commands, the shell session must be using the correct Node.js version. I believe you need to run
You can update the GutenbergKit version to reference a commit on a specific branch, much like many WP-Android PRs that include newer GBK builds. |
Thanks @dcalhoun . I've made a note of the commands I need to run in order to use local builds, so hopefully I won't bother you again with this. I did get file.mp4 |
@nbradbury this is expected—to some degree—as links within the editor's canvas universally disabled. If canvas links were not disabled, it would be difficult edit links, as tapping them would navigate to the link rather than moving the cursor to the edit point. You can verify this existing behavior by performing the same steps in the production web editor in a browser using a cursor device—i.e., a laptop or desktop device. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience with me while testing this. All good, merge when ready!
What?
Present the OS file picker when attempting to upload within the File block.
Why?
Fix the inability to upload files. Fix CMM-344. Fix #124.
How?
Use
ACTION_GET_CONTENT
rather thanACTION_PICK
, as it appears to be a morerobust and appropriate intent for the use case.
Avoid passing along the empty
acceptedTypes
values from the webimplementation—e.g.,
[""]
. It is not clear why this empty value is passed along.Testing Instructions
1: File block allows uploading files
2. Image/Video blocks filter by the appropriate MIME type
types.
Accessibility Testing Instructions
N/A, no navigation changes.
Screenshots or screencast
N/A