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

Introduce a freshness indicator for the goal screen #537

Merged

Conversation

krugerk
Copy link
Contributor

@krugerk krugerk commented Dec 3, 2024

Summary

In line with #246, this provides an indicator of freshness on the goal screen. It reuses the one from the gallery screen.

Media

last.fetch.on.gallery.and.goalvc.mp4

Validation

Ran app in simulator
Viewed both gallery and goal, navigating back and forth.
Sent the app to background, back into foreground, varying sometimes with the gallery open, sometimes with a goal open.
Also watched the last updated since label be updated while just leaving the app open with the goal view showing

Fixes #246

@krugerk krugerk force-pushed the feature/246-loading-indicator-for-goal branch from 660661c to 1228e01 Compare December 16, 2024 13:57
@krugerk krugerk force-pushed the feature/246-loading-indicator-for-goal branch from 1228e01 to 6616f94 Compare December 16, 2024 22:28
@krugerk krugerk requested a review from theospears December 19, 2024 09:20
Copy link
Collaborator

@theospears theospears left a comment

Choose a reason for hiding this comment

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

Overall approach looks good, and I like the idea of extracting FreshnessIndicatorView as its own component. I added some requests for local changes.

When testing, could you also verify the time since update changes when you just leave the app open with the goal view showing?

BeeKit/Managers/GoalManager.swift Outdated Show resolved Hide resolved
BeeKit/Managers/RequestManager.swift Outdated Show resolved Hide resolved
BeeSwift/GoalViewController.swift Outdated Show resolved Hide resolved
}

self.updateLastUpdatedLabel()
Timer.scheduledTimer(timeInterval: 60, target: self, selector: #selector(GoalViewController.updateLastUpdatedLabel), userInfo: nil, repeats: true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

[Consider] Wouldn't this timer make more sense being part of the FreshnessIndicatorView ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason I placed it here is because this is also a Controller whereas the Freshness one is just a view.

@krugerk krugerk force-pushed the feature/246-loading-indicator-for-goal branch from 01efea0 to 67b1c7a Compare December 28, 2024 10:55
@krugerk krugerk requested a review from a team as a code owner December 28, 2024 10:55
@krugerk krugerk requested review from theospears and removed request for a team December 28, 2024 10:55
Copy link
Collaborator

@theospears theospears left a comment

Choose a reason for hiding this comment

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

Still waiting on changes to GoalViewController

a variation of _a loading indicator for goals_
DRY the view showing both the gallery's
and a goal's freshness (last fetched date)
@krugerk krugerk force-pushed the feature/246-loading-indicator-for-goal branch from 67b1c7a to b3d893c Compare December 29, 2024 16:21
@krugerk krugerk force-pushed the feature/246-loading-indicator-for-goal branch from 5975456 to d68cdbd Compare December 29, 2024 16:31
@krugerk krugerk requested a review from theospears December 29, 2024 16:35
Comment on lines 35 to 30
fileprivate var goalImageView = GoalImageView(isThumbnail: false)
fileprivate var datapointTableController = DatapointTableViewController()
fileprivate var dateTextField = UITextField()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
fileprivate var goalImageView = GoalImageView(isThumbnail: false)
fileprivate var datapointTableController = DatapointTableViewController()
fileprivate var dateTextField = UITextField()
fileprivate let goalImageView = GoalImageView(isThumbnail: false)
fileprivate let datapointTableController = DatapointTableViewController()
fileprivate let dateTextField = UITextField()

Comment on lines 27 to 28
var deadbeatView = UIView()
var outofdateView = UIView()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
var deadbeatView = UIView()
var outofdateView = UIView()
private let deadbeatView = UIView()
private let outofdateView = UIView()

BeeKit/Managers/RequestManager.swift Outdated Show resolved Hide resolved
BeeSwift/GoalViewController.swift Outdated Show resolved Hide resolved
@theospears theospears merged commit 971f9e5 into beeminder:master Dec 29, 2024
1 check passed
@theospears
Copy link
Collaborator

LGTM, merged!

@krugerk krugerk deleted the feature/246-loading-indicator-for-goal branch December 29, 2024 23:00
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.

Loading indicator for goals
2 participants