Skip to content

Make full history row tappable#5

Merged
gsbernstein merged 1 commit into
masterfrom
greg/tappable-history-rows
May 26, 2026
Merged

Make full history row tappable#5
gsbernstein merged 1 commit into
masterfrom
greg/tappable-history-rows

Conversation

@gsbernstein

@gsbernstein gsbernstein commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

The day-header rows in the Recent Sleep card only registered taps over their rendered content (the left-hand date text and the right-hand duration/chevron). The Spacer in between had no hit area, so taps in the wide empty middle of each row were swallowed.

Adding .contentShape(Rectangle()) on the header HStack extends the button's hit region to the full row.

.padding(.vertical, 8)
.contentShape(Rectangle())

Before / After (tappable region tinted)

For these screenshots I temporarily tinted the actual hit-test region so the change is visible. The screenshots themselves were taken on the iPhone 14 Plus simulator with fake HealthKit data.

Before — only red areas tap After — full row taps
image image

In Before the red tint covers only the rendered text (Sat, May 23, 7:15 / -0.8h, etc.); the wide empty space in the middle is dead. In After the green tint covers the entire row including the gap — taps anywhere on the row toggle expansion.

Verification

  • Empirically reproduced the bug pre-fix by tapping at the screen midpoint of a row — nothing happened.
  • After the fix, the same midpoint tap expands the row.
  • Build clean on iOS 26.5 / iPhone 14 Plus simulator.

Test plan

  • Open the app on a device/simulator with sleep data
  • Scroll to Recent Sleep
  • Tap anywhere along a day-header row (especially the middle gap) — row should expand/collapse

Cleanup note

The two PNGs under .github/pr-screenshots/ are PR artifacts only. Feel free to drop that commit (5eb2076) before merging, or squash-merge to keep master lean.

Made with Cursor

The day-header button only registered taps over its rendered content
(date text, duration, chevron). The Spacer in the middle of the HStack
had no hit area, so the visually large empty region between the left
and right text columns swallowed taps. Adding contentShape(Rectangle())
extends the hit region to the full row.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves tap handling in the “Recent Sleep” card by making the entire day-header row (including the empty spacer gap) respond to taps, matching the intended expand/collapse interaction.

Changes:

  • Extends the Button hit-test area for the day header by applying .contentShape(Rectangle()) to the header HStack.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gsbernstein gsbernstein merged commit 104cad2 into master May 26, 2026
1 check passed
@gsbernstein gsbernstein deleted the greg/tappable-history-rows branch May 26, 2026 19: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.

2 participants