Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b209bf3
v1.54.0-rc.1
clintonium-119 Jan 16, 2026
0bb700a
Update bolus summary title text
clintonium-119 Jan 19, 2026
fa946d5
v1.54.0-rc.2
clintonium-119 Jan 19, 2026
e7c7eff
Merge pull request #583 from tidepool-org/WEB-1463-dexcom-data-tweaks
clintonium-119 Jan 19, 2026
e7d1976
WEB-4354 prevent high from going below 0%
henry-tp Jan 26, 2026
9b80eef
WEB-4354 remove erroneous console.log
henry-tp Jan 26, 2026
3facf24
v1.54.0-rc.3
henry-tp Jan 26, 2026
31db38e
v1.54.0-web-4354-bound.1
henry-tp Jan 26, 2026
008dc9e
new branch
henry-tp Jan 26, 2026
cd97d0c
Merge branch 'release-1.54.0' into WEB-4354-bound
henry-tp Jan 26, 2026
f4ca6e9
v1.54.0-web-4354-bound.2
henry-tp Jan 26, 2026
aa913db
WEB-4354 ensure test is wrapped in it() call
henry-tp Jan 28, 2026
cca12f6
v1.54.0-web-4354-bound.3
henry-tp Jan 28, 2026
618b24d
WEB-4354 update JSdoc comment
henry-tp Jan 28, 2026
49eb819
v1.54.0-web-4354-bound.4
henry-tp Jan 28, 2026
3366de2
v1.54.0-rc.4
henry-tp Jan 28, 2026
292b6d7
Merge pull request #589 from tidepool-org/WEB-4354-bound
henry-tp Jan 28, 2026
7a0e281
Add insulin type support to processBolusRange for print data
clintonium-119 Jan 29, 2026
83a0823
v1.54.0-rc.5
clintonium-119 Jan 29, 2026
a297a85
Merge pull request #590 from tidepool-org/WEB-4371-pdf-bolus-scale-fix
clintonium-119 Jan 29, 2026
45496e8
Account for manual insulin data when listing bolus details in daily p…
clintonium-119 Jan 29, 2026
1edba03
v1.54.0-rc.6
clintonium-119 Jan 29, 2026
a7c524b
Clarify operator precedence in spread with fallback array
clintonium-119 Jan 29, 2026
a0be394
v1.54.0-rc.7
clintonium-119 Jan 29, 2026
7e3f553
Merge pull request #591 from tidepool-org/WEB-4371-render-insulin-det…
clintonium-119 Jan 29, 2026
8aff7b7
v1.54.0
clintonium-119 Feb 5, 2026
f984e8d
Merge branch 'develop' into release-1.54.0
clintonium-119 Feb 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"node": "20.8.0"
},
"packageManager": "yarn@3.6.4",
"version": "1.55.0-web-4330-missing-settings.2",
"version": "1.55.0-develop.1",
"description": "Tidepool data visualization for diabetes device data.",
"keywords": [
"data visualization"
Expand Down
4 changes: 2 additions & 2 deletions src/modules/print/DailyPrintView.js
Original file line number Diff line number Diff line change
Expand Up @@ -1106,12 +1106,12 @@ class DailyPrintView extends PrintView {
bolusDetailPositions,
bolusDetailWidths,
bolusScale,
data: { bolus: insulinEvents },
data: { bolus: bolusData, insulin: insulinData },
}) {
this.doc.font(this.font)
.fontSize(this.smallFontSize)
.fillColor('black');

const insulinEvents = [...(bolusData || []), ...(insulinData || [])];
const topOfBolusDetails = bolusScale.range()[0] + 2;

const grouped = _.groupBy(
Expand Down
2 changes: 1 addition & 1 deletion src/utils/basics/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export function defineBasicsAggregations(bgPrefs, manufacturer, pumpUpload = {})

case 'boluses':
title = t('Insulin');
summaryTitle = t('Avg boluses / day');
summaryTitle = t('Avg insulin injections / day');
dimensions = [
{ path: 'summary', key: 'total', label: t('Avg per day'), average: true, primary: true },
{ path: 'summary.subtotals', key: 'wizard', label: t('Calculator'), percentage: true, selectorIndex: 0 },
Expand Down
6 changes: 4 additions & 2 deletions src/utils/print/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ export function processBgRange(dataByDate) {
*/
export function processBolusRange(dataByDate, timezoneName) {
const boluses = _.reduce(
dataByDate, (all, date) => (all.concat(_.get(date, 'bolus', []))), []
dataByDate,
(all, date) => (all.concat(_.get(date, 'bolus', [])).concat(_.get(date, 'insulin', []))),
[]
);
_.each(boluses, (bolus) => {
// eslint-disable-next-line no-param-reassign
bolus.threeHrBin = Math.floor(moment.utc(bolus.normalTime).tz(timezoneName).hours() / 3) * 3;
});
return extent(boluses, (d) => ((d.normal || 0) + (d.extended || 0)));
return extent(boluses, (d) => (_.get(d, 'dose.total') || (d.normal || 0) + (d.extended || 0)));
}

/**
Expand Down
10 changes: 8 additions & 2 deletions src/utils/stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ export const formatDatum = (datum = {}, format, opts = {}) => {
*
* @returns {Object} an object with values corrected to sum up to 100%
* - if the values do not sum up to 100%, the 'high' range is adjusted to compensate
* - in specific edge cases, the values may still sum up to 101%
*/
export const reconcileTIRPercentages = (timeInRanges) => {
const DECIMAL_PRECISION = 2;
Expand All @@ -325,8 +326,13 @@ export const reconcileTIRPercentages = (timeInRanges) => {
// e.g. if sum === 0.99 and high === 0.21, we increase high to 0.22 so that all TIR
// values add up to 1 (or 100%).
const diff = 1 - sum;
const newHigh = bankersRound((modifiedTimeInRanges.high || 0) + diff, DECIMAL_PRECISION);
modifiedTimeInRanges.high = newHigh;

let newHigh = (modifiedTimeInRanges.high || 0) + diff;

if (newHigh < 0) newHigh = 0;
if (newHigh > 1) newHigh = 1;

modifiedTimeInRanges.high = bankersRound(newHigh, DECIMAL_PRECISION);

return modifiedTimeInRanges;
};
Expand Down
22 changes: 22 additions & 0 deletions test/utils/stat.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,28 @@ describe('stat', () => {
});
});
});

describe('does not adjust high below 0% (edge case)', () => {
it('when using standard range', () => {
const timeInRanges = {
veryLow: 0.069767,
low: 0.465116,
target: 0.465116,
high: 0,
veryHigh: 0,
};

// The algorithm would be expected to subtract 1% from High to keep the Total at 100%,
// but we can't go below 0%, so the Total in this case will be 101%
expect(stat.reconcileTIRPercentages(timeInRanges)).to.deep.equal({
veryLow: 0.07,
low: 0.47,
target: 0.47,
high: 0,
veryHigh: 0,
});
});
});
});

describe('reconcileTIRDatumValues', () => {
Expand Down