Skip to content

[WEB-4453] nightscout trio support#603

Open
clintonium-119 wants to merge 13 commits intodevelopfrom
WEB-4453-nightscout-trio-support
Open

[WEB-4453] nightscout trio support#603
clintonium-119 wants to merge 13 commits intodevelopfrom
WEB-4453-nightscout-trio-support

Conversation

@clintonium-119
Copy link
Copy Markdown
Member

@clintonium-119 clintonium-119 commented Mar 13, 2026

….Trio

Trio (a Nightscout project) has been uploading data using
com.loopkit.Loop,
causing it to appear as DIY Loop. This adds proper detection and display
for Trio using its correct bundle identifier, with "Glucose Targets"
terminology instead of "Correction Range" and a single-value target
column.
Trio does not support settings overrides, so it is excluded from that
path.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds initial support for the Trio pump/app throughout device detection, settings rendering, and terminology so Trio uploads can be recognized and displayed similarly to other Loop-like sources.

Changes:

  • Introduces a new TRIO manufacturer constant + pump vocabulary entry.
  • Adds Trio detection (isTrio) and wires it into automated device classification and upload source inference.
  • Extends settings/print rendering paths with Trio-specific “Glucose Targets” labeling and schema support.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/utils/device.test.js Adds unit tests for isTrio and updates automated-device expectations to include Trio.
test/utils/constants.test.js Adds expected pumpVocabulary labels for constants.TRIO.
src/utils/validation/schema.js Allows trio pumpSettings to validate against the Loop pump settings schema.
src/utils/settings/nonTandemData.js Adds Trio target labeling/columns and attempts to adjust Loop annotations for Trio.
src/utils/settings/data.js Adds Trio display name + tweaks settings labels (e.g., “Glucose Targets”).
src/utils/device.js Adds isTrio and uses it in automated basal/bolus device checks.
src/utils/DataUtil.js Maps Trio pumpSettings to source = 'trio' when building the upload map.
src/utils/constants.js Defines TRIO and adds Trio-specific pump vocabulary terms.
src/utils/basics/data.js Treats Trio similarly to Loop sources for certain basics aggregations and site-change source.
src/modules/print/SettingsPrintView.js Adds Trio-specific label handling in the Loop print layout/footnotes.
src/components/settings/NonTandem.js Adds trio to supported deviceKey prop type list.
src/components/settings/common/PumpSettingsContainer.js Adds trio to supported manufacturer lists.
package.json Bumps version to 1.55.1-rc.4.
.gitignore Ignores .claude/settings.local.json.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/utils/settings/nonTandemData.js Outdated
Comment on lines 268 to 272

this.renderBasalSchedule({ columnIndex: 0 });
this.renderTarget({ columnIndex: 1, heading: { text: t('Correction Range'), subText: ` ${this.bgUnits}\u00B9` } });
const rangeLabel = this.manufacturer === 'trio' ? t('Glucose Targets') : t('Correction Range');
this.renderTarget({ columnIndex: 1, heading: { text: rangeLabel, subText: ` ${this.bgUnits}\u00B9` } });
this.renderRatio({ columnIndex: 2 });
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Trio is not Loop, so we don't want to blindly render everything that we do for Loop. I believe I'm rendering the correct data for Trio.

Comment thread src/modules/print/SettingsPrintView.js Outdated
Comment on lines 321 to 328
renderLoopFootnotes() {
const settings = this.latestPumpUpload.settings;
const device = deviceName(this.manufacturer) || t('Unknown');
const rangeLabel = this.manufacturer === 'trio' ? t('Glucose Targets') : t('Correction Range');

const footnotes = [
t('1 - Correction Range is the glucose value (or range of values) that you want {{device}} to aim for in adjusting your basal insulin and helping you calculate your boluses.', { device }),
t('1 - {{rangeLabel}} is the glucose value (or range of values) that you want {{device}} to aim for in adjusting your basal insulin and helping you calculate your boluses.', { rangeLabel, device }),
t('2 - {{device}} will deliver basal and recommend bolus insulin only if your glucose is predicted to be above this limit for the next three hours.', { device }),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same as above - the Loop-specific footnotes do not need to run for Trio

Comment thread src/utils/settings/nonTandemData.js
clintonium-119 and others added 9 commits April 1, 2026 09:10
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Add trio to bolus/ISF/carb-ratio manufacturer lookup tables, fix
target() to use manufacturer===trio rather than isTrio(settings), route
Trio through renderTherapySettings (renamed from renderLoopSettings),
suppress Loop-specific footnotes and superscripts for Trio, and guard
bgSafetyLimit/insulinModel rows with null checks.
Rename loopDataSetsByIdMap to dosingDecisionDataSetsByIdMap to reflect
its broader purpose, populate it with isTrio() uploads alongside Loop,
and split tagDatum() to set tags.loop or tags.trio based on the actual
upload datum identity. Update isTrio() to recognise tags.trio
analogously to how isLoop() checks tags.loop.
Show dosing decision fields (ISF, carb ratio, IOB, BG input) for Trio
boluses, use "Glucose Targets" label instead of "Correction Range" for
Trio, and show absorption time and food name for Trio food entries.
@clintonium-119 clintonium-119 requested a review from krystophv April 2, 2026 14:47
krystophv
krystophv previously approved these changes Apr 14, 2026
Copy link
Copy Markdown
Member

@krystophv krystophv left a comment

Choose a reason for hiding this comment

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

LGTM 🚢

Base automatically changed from release-1.55.1 to develop April 27, 2026 22:51
@henry-tp henry-tp dismissed krystophv’s stale review April 27, 2026 22:51

The base branch was changed.

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