[WEB-4453] nightscout trio support#603
Conversation
….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.
There was a problem hiding this comment.
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
TRIOmanufacturer 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.
|
|
||
| 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 }); |
There was a problem hiding this comment.
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.
| 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 }), |
There was a problem hiding this comment.
Same as above - the Loop-specific footnotes do not need to run for Trio
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This reverts commit bb9f331.
…prior to the optional Z
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.
WEB-4453
Related PR: tidepool-org/blip#1892