Skip to content

Make carb entry limits configurable - #2669

Draft
damonbayer wants to merge 3 commits into
LoopKit:next-devfrom
damonbayer:dmb/configurable-carb-entry-limits
Draft

damonbayer wants to merge 3 commits into
LoopKit:next-devfrom
damonbayer:dmb/configurable-carb-entry-limits

Conversation

@damonbayer

@damonbayer damonbayer commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

This obviates the need for the Modify Carb Warning & Limit: Low Carb to 49 & 99 and Modify Carb Warning & Limit: High Carb to 201 & 300. Per internal stats, ~3% of Loop users enable one of these changes.

If we accept that there should be some guards against carb entries that are too big, it makes sense that this would differ between users. I eat a low-carb diet, so I would probably lower these to 30g/60g. I imagine it might also be beneficial for children, who eat fewer carbs than adults. I also imagine that meals with more carbs than the default guards might be common for some users.

Summary

  • Add Settings → Therapy Settings → Carb Entry Limits alongside the other therapy cards. The editor follows Delivery Limits for layout, Cancel, and authenticated Save. Both fields reuse the meal carb-entry input and its decimal precision.
  • Default to a 99 g large-meal warning and a 250 g maximum. Save the two values together and keep the warning below the maximum.
  • Use the saved thresholds for iPhone carb entry and Favorite Foods. Use the saved maximum for the simple bolus calculator and remote carb entry. Apple Watch has a separate carb picker.

Depends on LoopKit/LoopKit#692 for the Therapy Settings card. Related discussion in #494.

Image Image

Validation

  • Built the revised app with the LoopKit companion change.
  • Passed all 14 SimpleBolusViewModelTests on an iPhone 18 Pro simulator. The new regression test checks that a 300.5 g maximum accepts 300.5 g and blocks 300.6 g before saving or bolusing.

@damonbayer
damonbayer marked this pull request as draft November 8, 2026 20:39
@ps2

ps2 commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks! Please add a clear description of the use case(s) that are driving this to the PR. Best to hear from those who need this, but you're just devving for others, would be good to hear your understanding of the need too.

(Edit: not asking for some formal "use case" pattern to be followed, as sometimes people interpret this ask as, just a clear description of the "why" that's driving this).

@damonbayer

Copy link
Copy Markdown
Contributor Author

@ps2 Update the original description with the following:

Motivation

This obviates the need for the Modify Carb Warning & Limit: Low Carb to 49 & 99 and Modify Carb Warning & Limit: High Carb to 201 & 300. Per internal stats, ~3% of Loop users enable one of these changes.

If we accept that there should be some guards against carb entries that are too big, it makes sense that this would differ between users. I eat a low-carb diet, so I would probably lower these to 30g/60g. I imagine it might also be beneficial for children, who eat fewer carbs than adults. I also imagine that meals with more carbs than the default guards might be common for some users.

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.

2 participants