Skip to content

Bolus initiating state + spinning border instead of the spinner#54

Open
Sjoerd-Bo3 wants to merge 2 commits into
Build-Experimentfrom
feat/bolus-initiating-border
Open

Bolus initiating state + spinning border instead of the spinner#54
Sjoerd-Bo3 wants to merge 2 commits into
Build-Experimentfrom
feat/bolus-initiating-border

Conversation

@Sjoerd-Bo3

@Sjoerd-Bo3 Sjoerd-Bo3 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Restructured to build on top of the bolus-initiating feature rather than reimplement it. Two commits:

Commit 1 — Add the bolus initiating state (with a spinner)

A faithful port of the "show bolus initiating" feature:

  • New BolusStatus { noBolus, initiating, inProgress }, derived from the pump's bolusState.
  • DeviceDataManager.bolusTrigger now carries BolusStatus (was Bool), mapping status.bolusState.initiating / .inProgress / (default) .noBolus.
  • APSManager creates the bolus reporter for initiating+inProgress, clears it on noBolus.
  • HomeStateModel and TreatmentsStateModel track bolusStatus; isBolusInProgress is replaced by bolusStatus != .noBolus.
  • Home bolus card and the Treatments in-progress row show an "Initiating…" label with a ProgressView spinner (in place of the cancel button) during initiating.

Commit 2 — Show the spinning border instead of the spinner

On top of commit 1, replace that ProgressView with our reusable spinning border (the pump reservoir / loop-pill one):

  • Home card: the card border spins while initiating, then switches to the determinate left→right progress fill once delivering.
  • Treatments row: the card shows the spinning border while initiating; the cancel button returns once delivering.
  • Both borders use a 3pt line so there's no thickness jump on the initiating → inProgress transition.

Notes

  • Structured so the feature is included and then modified — if the upstream feature later lands and you sync dev, the overlap is on these same files and resolves to "keep the border, drop the spinner."
  • External/manual boluses unaffected: .initiating/.inProgress come from the pump's own bolusState.
  • Localization catalog entries for "Initiating…" are omitted (the String(localized:) calls fall back to the literal), consistent with how this fork has handled .xcstrings.

Verification

  • Builds via the compile_check simulator workflow on this branch (only place the submodules/build can be validated).

…ivery

Introduces a BolusStatus state machine (noBolus / initiating / inProgress)
derived from the pump's bolusState, distinguishing 'bolus requested but not yet
delivering' from 'actively delivering':

- DeviceDataManager.bolusTrigger now carries BolusStatus instead of Bool, mapping
  status.bolusState (initiating / inProgress / default -> noBolus).
- APSManager creates the bolus reporter for initiating+inProgress, clears it on
  noBolus.
- HomeStateModel and TreatmentsStateModel track bolusStatus from the trigger.
- Home bolus card and Treatments in-progress row show an 'Initiating…' label with
  a ProgressView spinner (in place of the cancel button) during initiating, then
  the normal 'Bolusing' state with the cancel button once delivery starts.
On top of the bolus-initiating state, replace the ProgressView spinner shown
during '.initiating' with our reusable spinning border (the one on the pump
reservoir and loop pills):

- Home bolus card: the card border spins while initiating, then switches to the
  determinate left->right progress fill once delivering.
- Treatments in-progress row: the card shows the spinning border while
  initiating; the cancel button returns once delivering.

Both card borders use a 3pt line so there is no thickness jump on the
initiating -> inProgress transition.
@Sjoerd-Bo3
Sjoerd-Bo3 force-pushed the feat/bolus-initiating-border branch from 32c49c1 to 78388b0 Compare July 4, 2026 18:32
@Sjoerd-Bo3 Sjoerd-Bo3 changed the title Bolus initiating: spinning border instead of a spinner loader Bolus initiating state + spinning border instead of the spinner Jul 4, 2026
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.

1 participant