Skip to content

fix(#274): make full 44pt toolbar button circle tappable#319

Merged
cassio-rossi merged 1 commit into
release/v5from
fix/toolbar-button-tap-target
Jul 23, 2026
Merged

fix(#274): make full 44pt toolbar button circle tappable#319
cassio-rossi merged 1 commit into
release/v5from
fix/toolbar-button-tap-target

Conversation

@cassio-rossi

Copy link
Copy Markdown
Collaborator

Summary

Fixes #274 — intermittent unresponsive liquid glass toolbar buttons (favorite, share, filter) on the home page and on posts: the button animated the touch but the action (share sheet, filter, favorite) sometimes never fired.

Root cause

MinimumTouchTarget.swift applied .frame(width: 44, height: 44) + .contentShape(Circle()) outside the Button/ShareLink. An ancestor's frame/content shape does not extend a descendant button's hit-test region, so the actual tappable area was only the small SF Symbol icon — while .glassEffect(…).interactive() covered the full 44pt circle and animated on every touch inside it.

  • Tap on the icon → works (most taps, hence "rare")
  • Tap inside the glass circle but off the icon → press animation, no action

Only toolbar buttons were affected because .minimumTouchTarget() is used exclusively on toolbar items. Matching Apple report: Button in ToolbarItem is not completely tappable on iOS 26 (FB22155477).

Fix

Moved the 44pt frame + circular content shape into a custom ButtonStyle — a style's body is the button's label, so the full circle now sits inside the button's hit-test region. Works for both Button (favorite/filter) and ShareLink (share). Pressed-state opacity preserves the .plain style feedback; glass effect unchanged. One file; all 6 call sites inherit the fix.

Verification

  • ✅ Build succeeded (iPhone 17 Pro Max simulator, OS 26.5 — no iPhone 17 Pro simulator installed on this machine)
  • ✅ 44 tests in 5 suites passed (-testPlan MacMagazine)
  • ✅ SwiftLint strict: 0 violations in 245 files
  • ⚠️ No unit reproduction test: SwiftUI hit-testing is not unit-testable (testing.md excludes view bodies). Manual check: tap the edge of the glass circles on device.

🤖 Generated with Claude Code

The frame/contentShape in minimumTouchTarget was applied outside the
Button, so only the small icon label was hit-testable while the
interactive glass circle gave press feedback for the whole 44pt area.
Taps landing off the icon animated but never fired the action (FB22155477).
Moving the frame/contentShape into a ButtonStyle places the 44pt circle
inside the button's hit-test region for Button and ShareLink alike.

Co-Authored-By: Claude <noreply@anthropic.com>
@cassio-rossi
cassio-rossi merged commit c4053a4 into release/v5 Jul 23, 2026
2 checks passed
@cassio-rossi
cassio-rossi deleted the fix/toolbar-button-tap-target branch July 23, 2026 21:57
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.

Melhorar responsabilidade dos botões superiores

1 participant