Skip to content

show when healthkit linked goal was last synced with healthkit#601

Draft
krugerk wants to merge 1 commit intobeeminder:masterfrom
krugerk:feature/when-was-goal-last-synced-with-apple-health
Draft

show when healthkit linked goal was last synced with healthkit#601
krugerk wants to merge 1 commit intobeeminder:masterfrom
krugerk:feature/when-was-goal-last-synced-with-apple-health

Conversation

@krugerk
Copy link
Contributor

@krugerk krugerk commented Jan 2, 2025

Summary

The user can see the most recent datapoints and can infer from that when the last sync took place. This PR displays the date directly so the user need not infer when that might have been.

For UI changes including screenshots of before and after is great.

when synced today

showing time
last synced with healthkit

previous

showing the full date/time

Image

Validation

ran app in simulator

Tickets

Fixes #193


private func refreshPullDown() {
let dateFormatter = ISO8601DateFormatter()
dateFormatter.formatOptions = [.withFullDate, .withFullTime]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dreeves
Copy link
Member

dreeves commented Jan 3, 2025

Proposal: strip that down to nothing but HH:MM -- no date, no seconds, no am/pm, no timezone, nothing. I would've thought that too extreme but it's what Stripe does on their mobile app and I realized it works because you figure it out by experimentation.

@krugerk krugerk force-pushed the feature/when-was-goal-last-synced-with-apple-health branch from 26eb85c to c2374bb Compare January 5, 2025 13:47
@krugerk
Copy link
Contributor Author

krugerk commented Jan 5, 2025

Proposal: strip that down to nothing but HH:MM -- no date, no seconds, no am/pm, no timezone, nothing. I would've thought that too extreme but it's what Stripe does on their mobile app and I realized it works because you figure it out by experimentation.

updated to show date too (in user's preferred format) when last sync was not in the same day and to show the time in the user's preferred format

@krugerk krugerk marked this pull request as ready for review January 5, 2025 13:47
@krugerk krugerk requested a review from a team as a code owner January 5, 2025 13:47
@krugerk krugerk requested review from theospears and removed request for a team January 5, 2025 13:47
<attribute name="id" attributeType="String"/>
<attribute name="initDay" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="lastModifiedLocal" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="lastSyncedWithHealthKit" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

The convention for the app is for attributes which are not synced from the server to have names ending in ...Local. Could you update this and also add to the newest data model version rather than the base one now there are multiple?

@krugerk krugerk marked this pull request as draft February 1, 2026 16:37
@krugerk krugerk force-pushed the feature/when-was-goal-last-synced-with-apple-health branch 2 times, most recently from 56355b0 to 7c8ca7c Compare February 1, 2026 16:41
@krugerk krugerk force-pushed the feature/when-was-goal-last-synced-with-apple-health branch from 7c8ca7c to cec1769 Compare February 1, 2026 16:42
/// This does mean users who have very little buffer, and are not regularly unlocking their phone, may erroneously derail. There is nothing we
/// can do about this.
static let daysToUpdateOnChangeNotification = 7

Copy link
Collaborator

Choose a reason for hiding this comment

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

Any idea where all these whitespace changes came from? I would have guessed swift format, but I've confirmed this doesn't happen for me when I trigger reformatting of this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No I am not sure and I noticed too and have not looked into it further, yet.

@krugerk
Copy link
Contributor Author

krugerk commented Feb 2, 2026

Still marked as draft because as is a goalVC will not update as the goal does to show the more recent last synced time. It just shows it as it was when the gaolVC was opened.

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.

App should indicate when it last auto-fetched from Apple Health

3 participants