Skip to content

Workouts: float the manual sport picker's suggestion list so it isn't squeezed on iOS (#297) - #315

Merged
ryanbr merged 1 commit into
ryanbr:mainfrom
digitalerdude:fix/297-ios-picker-squeeze
Jul 12, 2026
Merged

ryanbr merged 1 commit into
ryanbr:mainfrom
digitalerdude:fix/297-ios-picker-squeeze

Conversation

@digitalerdude

Copy link
Copy Markdown

Follow-up to #301 (merged), which added the #297 "Recent activities" section to the sport pickers. That PR's second commit — the iOS layout fix below — didn't make it into the squash-merge, so it's re-submitted here on its own.

The bug

The manual Add/Edit sheet's sport suggestion list (Recent + full catalogue) rendered inline in the form, where it was the only height-flexible element. On iPhone, with the keyboard up, the fixed-height fields below it (Start / Duration / Avg HR / Calories) won the available vertical space and squeezed the list to nothing — the #297 Recent block, and even ordinary catalogue matches, never actually appeared on iOS.

The fix

The suggestion list now floats as an overlay below the Sport field instead of sitting inline:

  • It no longer competes for space in the form's VStack layout.
  • Since an overlay proposes the field's own (small) height to its content, the panel measures its natural content height via a PreferenceKey and sets an explicit frame from that, capped at 168pt (same cap as before) — letting it scroll only past that.
  • The Sport field's zIndex is raised so the floating panel draws over the rows below it instead of behind them.

Purely a SwiftUI layout fix — no behavior or data changes, so no Android twin (Android's AlertDialog scrolls its content rather than squeezing, so it was never affected).

Verification

  • macOS (Strand) and iOS (NOOPiOS) builds succeed locally (app-target Swift isn't covered by default CI).
  • Verified end-to-end in the iOS Simulator with a throwaway XCUITest: logged two manual workouts (Yoga, then Running), reopened the Add-Workout sheet with the keyboard up, and confirmed the panel now renders full-height showing Recent → Yoga, Running above All activities and the full catalogue — previously it was squeezed to nothing. The live-start sheet was already unaffected (it doesn't share this inline-list layout).

… squeezed on iOS (ryanbr#297)

The manual Add/Edit sheet rendered the sport suggestions inline in the form,
where the list was the only height-flexible element. On iPhone with the
keyboard up, the fixed-height fields below won the vertical space and
collapsed the list to nothing — the ryanbr#297 Recent block (and even catalogue
matches) never showed. It now floats as an overlay below the field: it no
longer competes for the form's layout, self-sizes to its content capped at
168pt (measured via a PreferenceKey, since an overlay proposes the field's
small height), and the field's raised zIndex draws it over the rows below.

SwiftUI-specific layout fix; behaviour/data unchanged, so no Android twin
(its AlertDialog scrolls rather than squeezing). Verified in the iOS
Simulator: with the keyboard up the Recent block renders Yoga over Running
above the full catalogue; the live-start sheet was already unaffected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ryanbr
ryanbr merged commit 811415f into ryanbr:main Jul 12, 2026
DX23876 pushed a commit to DX23876/noop that referenced this pull request Jul 22, 2026
… squeezed on iOS (ryanbr#297) (ryanbr#315)

The manual Add/Edit sheet rendered the sport suggestions inline in the form,
where the list was the only height-flexible element. On iPhone with the
keyboard up, the fixed-height fields below won the vertical space and
collapsed the list to nothing — the ryanbr#297 Recent block (and even catalogue
matches) never showed. It now floats as an overlay below the field: it no
longer competes for the form's layout, self-sizes to its content capped at
168pt (measured via a PreferenceKey, since an overlay proposes the field's
small height), and the field's raised zIndex draws it over the rows below.

SwiftUI-specific layout fix; behaviour/data unchanged, so no Android twin
(its AlertDialog scrolls rather than squeezing). Verified in the iOS
Simulator: with the keyboard up the Recent block renders Yoga over Running
above the full catalogue; the live-start sheet was already unaffected.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
simoncad7 pushed a commit to simoncad7/noop that referenced this pull request Aug 17, 2026
… squeezed on iOS (ryanbr#297) (ryanbr#315)

The manual Add/Edit sheet rendered the sport suggestions inline in the form,
where the list was the only height-flexible element. On iPhone with the
keyboard up, the fixed-height fields below won the vertical space and
collapsed the list to nothing — the ryanbr#297 Recent block (and even catalogue
matches) never showed. It now floats as an overlay below the field: it no
longer competes for the form's layout, self-sizes to its content capped at
168pt (measured via a PreferenceKey, since an overlay proposes the field's
small height), and the field's raised zIndex draws it over the rows below.

SwiftUI-specific layout fix; behaviour/data unchanged, so no Android twin
(its AlertDialog scrolls rather than squeezing). Verified in the iOS
Simulator: with the keyboard up the Recent block renders Yoga over Running
above the full catalogue; the live-start sheet was already unaffected.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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