Skip to content

Log Past: add date picker + equalise button widths - #28

Open
JWAY21 wants to merge 1 commit into
jackjackbits:mainfrom
JWAY21:feature/manual-log-improvements
Open

Log Past: add date picker + equalise button widths#28
JWAY21 wants to merge 1 commit into
jackjackbits:mainfrom
JWAY21:feature/manual-log-improvements

Conversation

@JWAY21

@JWAY21 JWAY21 commented Jul 4, 2026

Copy link
Copy Markdown

Summary

  • Date selection in Log Past sheet — a DATE wheel picker (up to 7 days back) now sits above the START/END TIME pickers. Users can select yesterday (or any day within the past week) to log a session they missed — e.g. when GPS didn't load in time. Selecting a past date re-clamps the hour/minute pickers into the valid range for that day and immediately re-runs the UV estimate. saveToHealth() stamps the HealthKit entry at the correct historical start time via the existing saveVitaminD(amount:date:) parameter.
  • Equal-width Begin / Log Past buttons — the Log Past button was a narrow fixed-width icon-only tile. Both buttons are now maxWidth: .infinity (50/50 split), matching the Clothing/Sunscreen/Skin Type card rows. Log Past gets an icon + "Log Past" text label to match Begin's style.

Files changed

File Change
Sources/Views/ManualExposureSheet.swift sessionDate state + combineDateAndTime helper; DATE wheel picker; updated time ranges; effectiveStartTime/effectiveEndTime used throughout; saveToHealth passes correct date
Sources/Views/ContentView.swift Log Past button: frame(width:60)frame(maxWidth:.infinity) + text label

Test plan

  • Open Log Past → DATE picker defaults to today, START = 1 hr ago, END = now
  • Scroll DATE to yesterday → time pickers re-clamp, UV recalculates
  • Save a past-day session → HealthKit entry appears on the correct date
  • Begin and Log Past buttons are visually equal width
  • While actively tracking, Log Past is greyed out (existing behaviour preserved)

🤖 Generated with Claude Code

Log Past exposure sheet now has a DATE wheel picker (up to 7 days back)
above the START/END TIME pickers. Selecting a past date re-clamps the
time pickers into the valid range for that day and re-triggers the UV
calculation. saveToHealth() now stamps the HealthKit entry at the correct
historical date via the existing saveVitaminD(amount:date:) parameter.

Begin and Log Past buttons are now equal-width (maxWidth: .infinity each)
matching the Clothing/Sunscreen/Skin Type card row widths. Log Past gets
an icon + text label to match Begin's style.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Leannnelkens00

Leannnelkens00 commented Jul 5, 2026 via email

Copy link
Copy Markdown

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