Skip to content

Add forecasts to the watchapp - #1306

Open
EJM0 wants to merge 10 commits into
nightscout:devfrom
EJM0:feat/watch-app-forecast
Open

Add forecasts to the watchapp#1306
EJM0 wants to merge 10 commits into
nightscout:devfrom
EJM0:feat/watch-app-forecast

Conversation

@EJM0

@EJM0 EJM0 commented Jul 13, 2026

Copy link
Copy Markdown

this PR adds the ability to display the Forecast (model take by the forecasts for the live activity) on watch app

chart in chartview was adjusted to span the y-axis over the min and max value of currently selected time range(values of cone or forecast lines included)

Different view with either cone true and false
incoming-169E9546-3385-470F-B504-10B42D49BB23
incoming-498CD1E5-D3B6-415B-BD5A-04EA17201E4F
incoming-7DA7FB89-6C77-42A7-AB97-B6AD5C9E73C4
(bg color is not altered in this pr only on my branche)

settings:
IMG_3731

@dnzxy

dnzxy commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Forecast is cool 👏 . Combined view does not work out – everything is clashing.
We'll have to be very careful with sending forecasts to the watch; it adds quite a bit of data. Any regressions on in performance or cutouts on a real device?

@EJM0

EJM0 commented Jul 13, 2026

Copy link
Copy Markdown
Author

Sending forecast worked out pretty well. After a fresh install, the watch app loads a bit, but after that, the updates are coming in not any slower than before. Maybe before merging other Peps wanna try out the pr... to really exclude performance issues
That’s sad since a combined view would greatly improve the interaction hassle :( (everything at on view)

bc of performance issues i first tried to calc taylor polynomials but they where not worth the hustle. since when the graph is bottoming out they freakout. thats why I stuck to the live activity implementation, since this also has a tight data envelope.

@dnzxy

dnzxy commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Agreed, good idea. Luckily, we have a few "hardcore" watch users that will be able to support us in testing this.

Re: the view: We designed the watch app following Apple's design guidelines which has "promoted" the crown to be a primary interactor to move between views, and for view to focus on single core contents and the user to "swipe" between content views.

These two screenshots below show that it clearly does not work out, and this is probably not the smallest watch screen available to Trio.

   
image image

@EJM0

EJM0 commented Jul 13, 2026

Copy link
Copy Markdown
Author

okay, I'll remove the combined view. looking forward to some test reports :)

@EJM0

EJM0 commented Jul 13, 2026

Copy link
Copy Markdown
Author

i'd still change the normal chart view behaviour to scale the y-axis range to the min and max value of the glucose+forecast values to that the forecast is better visible

@iampickle
iampickle force-pushed the feat/watch-app-forecast branch from 11ec965 to d5be702 Compare July 14, 2026 14:45
@EJM0 EJM0 changed the title Add a new combined view and forecasts to the watchapp Add forecasts to the watchapp Jul 14, 2026

@marv-out marv-out left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Generally looking good code-wise. Haven't tested it yet. A few comments though that should be addressed before merging. And ideally a few people would test that before that gets in

Comment thread Trio/Sources/Services/WatchManager/AppleWatchManager.swift Outdated
Comment thread Trio.xcodeproj/project.pbxproj Outdated

/* Begin PBXBuildFile section */
041D1E995A6AE92E9289DC49 /* TreatmentsDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D1A7CA8C10C4403D4BBFA7 /* TreatmentsDataFlow.swift */; };
09701ADF300546BE00D4F5C4 /* CombinedGlucoseChartview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09701ADE300546BE00D4F5C4 /* CombinedGlucoseChartview.swift */; };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pls clean the project file as you've removed the CombinedGlucoseChartView

Comment thread Trio Watch App Extension/Views/GlucoseChartView.swift Outdated
Comment thread Trio/Sources/Models/WatchState.swift
Comment thread Trio.xcodeproj/project.pbxproj Outdated
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
09701ADE300546BE00D4F5C4 /* CombinedGlucoseChartview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CombinedGlucoseChartview.swift; sourceTree = "<group>"; };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

see comment above

Comment thread Trio.xcodeproj/project.pbxproj Outdated
BDA25F222D26D62800035F34 /* BolusInputView.swift in Sources */,
BDFF7A882D25F97D0016C40C /* TrioMainWatchView.swift in Sources */,
BDA25F202D26D5FE00035F34 /* CarbsInputView.swift in Sources */,
09701ADF300546BE00D4F5C4 /* CombinedGlucoseChartview.swift in Sources */,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

see above

Comment thread Trio.xcodeproj/project.pbxproj Outdated
DD8262CA2D289297009F6F62 /* BolusConfirmationView.swift */,
BDA25F212D26D62200035F34 /* BolusInputView.swift */,
BDA25F1F2D26D5FB00035F34 /* CarbsInputView.swift */,
09701ADE300546BE00D4F5C4 /* CombinedGlucoseChartview.swift */,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

see above

BD11C001000000000000C001 /* CGMSensorDisplayState.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD11C000000000000000C001 /* CGMSensorDisplayState.swift */; };
BD11C001000000000000C003 /* SensorLifecycleArcView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD11C000000000000000C003 /* SensorLifecycleArcView.swift */; };
BD11C001000000000000C004 /* SensorStatusTagView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD11C000000000000000C004 /* SensorStatusTagView.swift */; };
BD136FAE2F6AC55F002217F9 /* NSFetchedResultsControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD136FAD2F6AC555002217F9 /* NSFetchedResultsControllerDelegate.swift */; };

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i don't know why Xcode for me randomly moves definitions in the project file... seems like it did not change anything

@EJM0
EJM0 requested a review from marv-out July 16, 2026 20:52
@EJM0

EJM0 commented Jul 16, 2026

Copy link
Copy Markdown
Author

Corrected it, sould I ask in the discord?

@dnzxy

dnzxy commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

@EJM0 please update the PR description and its screenshots

@marv-out are the changes sufficient? If so, please resolve the open conversations and approve.

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.

3 participants