Skip to content
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

Use progress bar with timer updates for live activities #1126

Merged
merged 7 commits into from
Mar 1, 2025

Conversation

BPerlakiH
Copy link
Collaborator

@BPerlakiH BPerlakiH commented Feb 28, 2025

Fixes: #1107


Screenshot 2025-02-28 at 11 32 46

Solution

I replaced the progress indicator, with a linear bar that is updating constantly, so for our users it is more smooth. We do update the "real" progress every 10 seconds, which changes the amount of downloaded values displayed above the bar, and that updates the timer below the bar, and makes the bar either speed up or slow down.

I've also added a timestamp for each update, this helps the system decide which updates can be dropped if they do queue up, so once the system "unblocks" the live activity it can apply the latest update.

I think, this is the best we can do considering the constraints that the iOS (especially above 18.0) puts on us.

The Dynamic Island updated

Screenshot 2025-02-28 at 11 31 56

The compact view remained unchanged:

Screenshot 2025-02-28 at 09 31 54

Localisation

Screenshot 2025-02-28 at 11 40 02

Paused state

Screenshot 2025-02-28 at 15 44 06

Downloads file updates

The original DownloadService file became too long, so I split that up by classes and moved under a new folder.

@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2025

Codecov Report

Attention: Patch coverage is 2.35294% with 83 lines in your changes missing coverage. Please review.

Project coverage is 25.28%. Comparing base (6d17ce0) to head (9b65e7f).

Files with missing lines Patch % Lines
Model/Downloads/DownloadTasksPublisher.swift 3.12% 31 Missing ⚠️
Views/LiveActivity/ActivityService.swift 3.84% 25 Missing ⚠️
Model/Downloads/DownloadState.swift 0.00% 18 Missing ⚠️
Common/DownloadActivityAttributes.swift 0.00% 8 Missing ⚠️
ViewModel/BrowserViewModel.swift 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1126      +/-   ##
==========================================
- Coverage   25.36%   25.28%   -0.09%     
==========================================
  Files         132      134       +2     
  Lines        6958     6981      +23     
==========================================
  Hits         1765     1765              
- Misses       5193     5216      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kelson42
Copy link
Contributor

The black bird part of the logo is too small, it should be like in on the app icon in the dashboard.

@kelson42
Copy link
Contributor

  • Pause/resume should be handled somehow
  • localisation (RTL) should be checked

@BPerlakiH
Copy link
Collaborator Author

@kelson42 the points above are addressed now, it should be good to be merged.

@kelson42
Copy link
Contributor

@BPerlakiH CI fails :(

@BPerlakiH
Copy link
Collaborator Author

Ok, I will have a look, it seems that the SDKRoot to build is too low on CI...

@BPerlakiH
Copy link
Collaborator Author

@kelson42 we need to merge this one first: #1127

@kelson42
Copy link
Contributor

kelson42 commented Mar 1, 2025

@BPerlakiH Still red

@BPerlakiH
Copy link
Collaborator Author

@kelson42 after merging #1128, this should be good as well. I did run a CI job on the combination of this branch and the Xcode branch here:
https://github.com/kiwix/kiwix-apple/actions/runs/13607824062
and that is green.

@kelson42 kelson42 force-pushed the live-activities-update branch from dc10f86 to 9b65e7f Compare March 1, 2025 20:06
@kelson42 kelson42 merged commit 83518f2 into main Mar 1, 2025
8 checks passed
@kelson42 kelson42 deleted the live-activities-update branch March 1, 2025 20:29
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.

Improve LiveActivities
3 participants