-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
When uploading a single file, offer input field to change file name #16298
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
PhilLab
commented
Jan 15, 2026
|
@kra-mo I recreated the PR in the main repo now, so the automated tests are executed. Regarding your comment:
I added one commit which introduces padding at the top. See the comparison:
|
4c117e7 to
3b1907f
Compare
This streamlines the upload from files, e.g. from email attachments. Closes #9215. The approach via the listener mFileDisplayNameTransformer was chosen because this allows a potential extension to multiple files (with multiple input fields). Alternatively, ReceiveExternalFilesActivity#uploadFile() could've been used, which requires the storage to a temporary file first. nextFocusForward and nextFocusDown are both needed to support navigation with the Tab key as well as the Enter key Signed-off-by: Philipp Hasper <vcs@hasper.info>
This streamlines the renaming and speeds up the process. Signed-off-by: Philipp Hasper <vcs@hasper.info>
When running the screenshot tests, the following error was raised: com.owncloud.android.ui.activity.ReceiveExternalFilesActivityIT > openMultiAccount[uiComparison(AVD) - 9] FAILED java.lang.AssertionError: Can't create multiple screenshots with the same name: com.owncloud.android.ui.activity.ReceiveExternalFilesActivityIT_open at com.facebook.testing.screenshot.internal.AlbumImpl.addRecord This happened because openMultiAccount() simply calls the open() test which "hardcodes" the screenshot name Signed-off-by: Philipp Hasper <vcs@hasper.info>
The UI only allows to proceed with the upload, if the permissions are given accordingly, so the test setup needs access to the corresponding permission keys. Instead of only making one of the keys available, all were made public. Because why should these magic strings be private after all? This only invites duplication and hinders maintenance. Signed-off-by: Philipp Hasper <vcs@hasper.info>
The automated test only tests this partially, because the only invalid name was an emtpy name. All other characters which are typically unsuitable for a filename, like the directory separator '/' are not properly rejected during the test run, because the FileNameValidator is based on the user capabilities, which are null because this is a sever-less test. Signed-off-by: Philipp Hasper <vcs@hasper.info>
Signed-off-by: Philipp Hasper <vcs@hasper.info>
To reduce duplication, the file and folders are setup in a @before method, but this also affects the existing screenshot tests. Signed-off-by: Philipp Hasper <vcs@hasper.info>
Working around the limitation of returns as well as the condition complexity was attempted but made the code just less readable. Ignoring these two specific findings is more appropriate here. Signed-off-by: Philipp Hasper <vcs@hasper.info>
Signed-off-by: Philipp Hasper <vcs@hasper.info>
blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/16298.apk
qrcode
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
PhilLab
commented
Jan 24, 2026
@alperozturk96 your comment on the old PR (link) said
I tested and codewise looks okay. However, better to get feedback from the designer.
Given that we have positive feedback from @kra-mo above, can we merge this now?
alperozturk96
commented
Jan 26, 2026
@tobiasKaminsky Could you please check this?
Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.
We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.
Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6
Thank you for contributing to Nextcloud and we hope to hear from you soon!
(If you believe you should not receive this message, you can add yourself to the blocklist.)
Before, the filename from FairScan just was <unixTimestamp>.pdf. Now, we are giving it our own timestamped name, just like we do for images and videos captured via the camera intent. This uses the same fileDisplayNameTransformer as PR #16298 Signed-off-by: Philipp Hasper <vcs@hasper.info>
Before, the filename from FairScan just was <unixTimestamp>.pdf. Now, we are giving it our own timestamped name, just like we do for images and videos captured via the camera intent. This uses the same fileDisplayNameTransformer as PR #16298 Signed-off-by: Philipp Hasper <vcs@hasper.info>
Uh oh!
There was an error while loading. Please reload this page.
Original PR: #16215
This streamlines the upload from files, e.g. from email attachments.
Closes #9215.
Also offers a convenient pre-selection of the filename without extension when entering the input field, as well as file name validation.
Recording of the automated test:
(The upload failure in the end is expected, as there is no server mocked)
Screen_recording_20260102_124130.mp4
Technical details
@Beforemethod which apply to all tests. Screenshot tests are broken on master right now, so I did not feel confident to provide updated screenshots with no way of verifying them. Either they need to be updated later, or the tests should be separated in two files