Skip to content

Redesign carbs remote screen with picker-based absorption time#567

Open
bjorkert wants to merge 1 commit intodevfrom
feature/carbs-screen-redesign
Open

Redesign carbs remote screen with picker-based absorption time#567
bjorkert wants to merge 1 commit intodevfrom
feature/carbs-screen-redesign

Conversation

@bjorkert
Copy link
Copy Markdown
Contributor

Summary

  • Replace free-text absorption time input with hour/minute wheel pickers
  • Add +/- buttons for quick time adjustment on consumption time
  • Add visual selection state on food type emoji buttons
  • Clamp consumed date to 12h past / 1h future range

Extracted from #558 to keep that PR focused on units/metrics.

…e hour and minute states, enhancing clarity and usability
@marionbarker
Copy link
Copy Markdown
Collaborator

Test

So close.

The SE 2nd gen screen running iOS 18 does not show the "Done" button. The only way I know it's a "Done" button is from the code and looking at the same screen on an iPhone 15. And no, you can't scroll the screen to see the button.

  • left side iPhone 15: choose picker for absorption time
  • right side iPhone SE 2nd gen: choose picker for absorption time
lf-pr567-issue

Requested change

As long as this needs work - set up variables as noted in the review. Don't hard code them as numbers.

Copy link
Copy Markdown
Collaborator

@marionbarker marionbarker left a comment

Choose a reason for hiding this comment

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

Fix the screen issue for small screens. Request modifications as noted. I did not highlight every line - I think you can extrapolate.

}

private var oldestAcceptedDate: Date {
Date().addingTimeInterval(-60 * 60 * 12)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use a variable for the 12 hours in the past

}

private var latestAcceptedDate: Date {
Date().addingTimeInterval(60 * 60)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use a variable for the 1 hour in the future. Modifying this is a common customization for Loopers.

Button(action: {
foodType = "🍭"
absorptionTimeString = "0.5"
setAbsorptionTime(hours: 0, minutes: 30)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

set variable for the lollipop, taco, pizza "standard" aborption times. These are items to customize for Loopers. Make it easier for them.

// Parse absorption time string to double
guard let absorptionTimeValue = Double(absorptionTimeString), absorptionTimeValue >= 0.5, absorptionTimeValue <= 8.0 else {
let selectedAbsorptionTime = absorptionTimeValue
guard selectedAbsorptionTime >= 0.5, selectedAbsorptionTime <= 8.0 else {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use a variable for the min/max allowed absorption time then use it in each location instead of hard-coding it.

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.

3 participants