Skip to content

Keep picker values and units within their available width - #713

Open
damonbayer wants to merge 2 commits into
LoopKit:next-devfrom
damonbayer:dmb/fix-quantity-picker-layout
Open

damonbayer wants to merge 2 commits into
LoopKit:next-devfrom
damonbayer:dmb/fix-quantity-picker-layout

Conversation

@damonbayer

@damonbayer damonbayer commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Quantity pickers position their unit labels outside the wheel's measured layout, which can push units beyond the available width. Place the wheel and unit in a normal horizontal layout and size each wheel from its formatted values. Update the range, fractional, schedule, safety-limit, and preset editors to compose these controls consistently.

Add a shared single-wheel duration picker using localized hours and minutes, expose the existing unit-binding adapter, and adopt both controls in the Pump Simulator temporary basal screen. Pump-supported choices and existing guardrails remain in effect.

Validation: signed Debug build of the four companion branches together for iOS Simulator; manual review of the affected therapy and preset editors, the safety limit at 100 mg/dL, and temporary basal selection at 1 hr, 30 min.

The pump plugin PRs require the new DurationWheelPicker and public binding adapter. Merge this shared change before integrating the companion UI updates.

Related PRs:

Picker localization uses native duration-unit names and locale-specific decimal separators. Fractional numbers and lower–upper ranges retain their mathematical ordering in right-to-left interfaces. Native picker delegates receive localized accessibility labels from the owning framework bundle, and the coordinator refreshes formatter and binding state when a view updates. Existing translations are reused; catalog changes contain only source keys and translator comments.

Validation for the localization update: signed Debug iOS Simulator build of all four branches; 10 existing quantity-formatter tests passed. Native iOS checks cover French decimal selection, Arabic fractional/range ordering, and French Medtrum formatting. No new tests or translations were added.

Screenshots

Native iOS captures using synthetic review data.

Screen Before After
Glucose Safety Limit Glucose Safety Limit — before Glucose Safety Limit — after
Correction range schedule Correction range schedule — before Correction range schedule — after
Carb ratio schedule Carb ratio schedule — before Carb ratio schedule — after
Insulin sensitivity schedule Insulin sensitivity schedule — before Insulin sensitivity schedule — after
Basal rate schedule Basal rate schedule — before Basal rate schedule — after
Maximum basal rate Maximum basal rate — before Maximum basal rate — after
Maximum bolus Maximum bolus — before Maximum bolus — after
Preset correction range Preset correction range — before Preset correction range — after
Preset duration Preset duration — before Preset duration — after
Simulator temporary basal Simulator temporary basal — before Simulator temporary basal — after
French fractional decimal separator French fractional decimal separator — before French fractional decimal separator — after
Arabic fractional numeric order Arabic fractional numeric order — before Arabic fractional numeric order — after
Arabic correction range ordering Arabic correction range ordering — before Arabic correction range ordering — after

Additional selection checks:

  • Temporary basal at 1 hr, 30 min: simulator temporary basal 90 min
  • Glucose Safety Limit at 100 mg/dL: safety limit 100

@ps2

ps2 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Tested in the iOS 27 Simulator (iPhone 17 Pro) with a full LoopWorkspace build of next-dev (LoopWorkspace 8885534) plus #713, LoopKit/Loop#2712, LoopKit/Loop#2709, loopandlearn/OmnipodKit#234 and LoopKit/MedtrumKit#14, using the CGM and pump simulators.

All of these work:

  • Glucose Safety Limit: the wheel and unit sit together. I changed it from 75 to 82 and saved, and Therapy Settings then showed 82.
  • Correction Range schedule: both wheels move and the row updates. I changed 105–110 to 100–115.
  • Pre-Meal correction range in the preset editor lays out correctly.
  • Fractional pickers: Carb Ratios (15.0 changed to 15.6), Basal Rates, Maximum Basal Rate and Maximum Bolus all show the unit beside the wheels.
  • Preset duration: the hours and minutes wheels update the summary, for example to "6 hr, 30 min".
  • Pump Simulator temporary basal: I picked 0.30 U/hr for 3 hr, 30 min and enacted it, and the pump then showed 3h 29m remaining. VoiceOver reads the "Rate" and "Duration" labels on the wheels.
  • LoopKit unit tests: the Shared (LoopKit project) tests passed, 639 test cases with no failures.

One small thing: in the preset duration picker, the hours wheel's unit reads "hour" while the minutes wheel reads "min". MeasurementFormatter.string(from: UnitDuration.hours) seems to return the long name even with .short. "hr" would match the minutes wheel and the "1 hr, 30 min" labels elsewhere.

I didn't check the French or Arabic layouts, or mmol/L.

Glucose Safety Limit

Correction Range

Carb Ratios

Pump Simulator temporary basal

Preset duration

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