Make full history row tappable#5
Merged
Merged
Conversation
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>
5eb2076 to
22dde0c
Compare
There was a problem hiding this comment.
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
Buttonhit-test area for the day header by applying.contentShape(Rectangle())to the headerHStack.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Spacerin between had no hit area, so taps in the wide empty middle of each row were swallowed.Adding
.contentShape(Rectangle())on the headerHStackextends the button's hit region to the full row.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.
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
Test plan
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 keepmasterlean.Made with Cursor