Skip to content

v0.3.1 - Pinned self-sizing sheet & reliable action timing

Latest

Choose a tag to compare

@peterfriese peterfriese released this 16 Aug 06:53
· 1 commit to main since this release
3515374

This release fixes two long-standing quirks of the action menu: a sheet that could be dragged to full height (and briefly flashed at zero height before first layout), and menu actions that could fire at the wrong moment - or not at all.

What's Changed

The sheet is now pinned to its content height.

  • The menu uses a single .height detent, so the drag handle can no longer expand it to full screen, and there's no more zero-height flash before the first layout.
  • The height is measured from the menu's own rows at runtime, so it hugs the content regardless of how many actions you provide.
  • Scrolling or bouncing the list no longer resizes the sheet, and the size is throttled so it stays stable while you interact.

Menu actions now fire exactly once, and only after the sheet fully dismisses.

  • Action firing moved from the button style into the sheet itself, which owns a single pending action that fires in onDisappear. This eliminates the failure modes of the old approach: actions that were silently dropped, actions misfiring on unrelated onDisappear events, and two actions firing from one tap.
  • Swipe-dismissing the sheet fires nothing; a rapid double-tap fires at most one action.

Smaller polish

  • Destructive menu rows now render their icon in system red.
  • The iOS 26+ toolbar Close button has an accessibility label ("Close").
  • The .actionMenu(...) modifier's title now defaults to "Options", and its content closure is a non-escaping @ContentBuilder.
  • Removed the internal contentSize: parameter that had leaked out of ActionMenu.init.

Sample App & Test Coverage

The sample app gained a reusable fruit demo with a Small/Medium/Large menu-size picker to showcase pinned self-sizing, and its share action now uses a deferred share sheet (presented only after the menu dismisses). A comprehensive XCUITest suite now verifies the timing contract: exactly-once firing, swipe-dismiss fires nothing, the sheet resists expansion and stays pinned while scrolling, and the share sheet only presents after the menu is gone.

Compatibility: iOS 18+, Swift 6.0+