Skip to content

Conversation

@alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented May 2, 2025

  • Tests written, or not not needed

Resolves: #14850

Tested with XLSX and PDF files

Downloading Small PDF

Screen.Recording.2025-05-02.at.15.55.14.mp4

Downloading Large PDF

ddd.mp4

Optional: Showing FileDetailFragment Based on Download Speed:

While 1MB may be considered small under typical internet speeds, it can take several minutes to download for users with slower connections. In such cases, displaying the FileDetailFragment instead of skipping it might be more meaningful. We could potentially detect the user's download speed and, if the estimated download time exceeds 5 seconds, show the FileDetailFragment. However, this may be a feature to consider in the future.

@alperozturk96 alperozturk96 linked an issue May 2, 2025 that may be closed by this pull request
fda.previewAndHandleImageFile(file, searchFragment, currentSearchType);
} else if (file.isDown() && mContainerActivity instanceof FileDisplayActivity fda) {
fda.previewDownloadedFile(file, this::setFabVisible);
} else {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This entire preview logic belongs in FileDisplayActivity and needs to be accessible from there as well,
because after the file download is completed, the fragment is no longer an instance of OCFileListFragment,
so this function cannot be used from FileDisplayActivity.

@alperozturk96 alperozturk96 added the ux-enhancement Improvements that refine user interactions, accessibility, or overall usability label May 2, 2025
@alperozturk96 alperozturk96 force-pushed the improve-file-download-progress branch from f188333 to 70ec2a7 Compare May 26, 2025 04:14
@alperozturk96 alperozturk96 force-pushed the improve-file-download-progress branch 2 times, most recently from 27fddc1 to 5dd26fb Compare May 28, 2025 08:59
@alperozturk96 alperozturk96 force-pushed the improve-file-download-progress branch 4 times, most recently from 5004af8 to 0b5955a Compare June 17, 2025 11:39
@nextcloud nextcloud deleted a comment from github-actions bot Jun 17, 2025
@tobiasKaminsky tobiasKaminsky enabled auto-merge June 18, 2025 07:43
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
@alperozturk96 alperozturk96 force-pushed the improve-file-download-progress branch from 0b5955a to bc92642 Compare June 18, 2025 10:13
@github-actions
Copy link

Codacy

Lint

TypemasterPR
Warnings5150
Errors1111

SpotBugs

CategoryBaseNew
Bad practice6565
Correctness6262
Dodgy code300300
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3535
Performance4848
Security1818
Total538538

@github-actions
Copy link

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/14857.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.

@tobiasKaminsky tobiasKaminsky merged commit 92d23f6 into master Jun 18, 2025
21 of 24 checks passed
@tobiasKaminsky tobiasKaminsky deleted the improve-file-download-progress branch June 18, 2025 11:47
@codecov
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

Attention: Patch coverage is 1.02041% with 97 lines in your changes missing coverage. Please review.

Project coverage is 23.11%. Comparing base (b0b163f) to head (bc92642).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
...cloud/android/ui/activity/FileDisplayActivity.java 2.08% 46 Missing and 1 partial ⚠️
...ncloud/android/ui/fragment/OCFileListFragment.java 0.00% 23 Missing and 1 partial ⚠️
...ncloud/android/ui/fragment/FileDetailFragment.java 0.00% 20 Missing ⚠️
...xtcloud/client/jobs/download/FileDownloadWorker.kt 0.00% 3 Missing ⚠️
...p/src/main/java/com/nextcloud/model/WorkerState.kt 0.00% 2 Missing ⚠️
...in/java/com/owncloud/android/datamodel/OCFile.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master   #14857       +/-   ##
=============================================
+ Coverage          0   23.11%   +23.11%     
- Complexity        0     3223     +3223     
=============================================
  Files             0      712      +712     
  Lines             0    51713    +51713     
  Branches          0     6969     +6969     
=============================================
+ Hits              0    11955    +11955     
- Misses            0    37879    +37879     
- Partials          0     1879     +1879     
Files with missing lines Coverage Δ
...loud/android/operations/DownloadFileOperation.java 32.16% <ø> (ø)
...in/java/com/owncloud/android/datamodel/OCFile.java 81.32% <0.00%> (ø)
...p/src/main/java/com/nextcloud/model/WorkerState.kt 50.00% <0.00%> (ø)
...xtcloud/client/jobs/download/FileDownloadWorker.kt 1.80% <0.00%> (ø)
...ncloud/android/ui/fragment/FileDetailFragment.java 0.00% <0.00%> (ø)
...ncloud/android/ui/fragment/OCFileListFragment.java 34.48% <0.00%> (ø)
...cloud/android/ui/activity/FileDisplayActivity.java 28.01% <2.08%> (ø)

... and 705 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alperozturk96
Copy link
Collaborator Author

/backport to stable-3.32

@alperozturk96 alperozturk96 added this to the Nextcloud App 3.32.3 milestone Jul 21, 2025
@alperozturk96
Copy link
Collaborator Author

/backport to stable-3.32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review ux-enhancement Improvements that refine user interactions, accessibility, or overall usability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve File Download Tracking

3 participants