feat: add timer presets and completion state#6
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffe0615297
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .padding() | ||
| } | ||
| .navigationTitle("计时器") | ||
| .alert("计时结束", isPresented: $didComplete) { |
There was a problem hiding this comment.
Keep completion state separate from alert visibility
Using didComplete as the isPresented binding for .alert causes SwiftUI to reset it to false as soon as the user dismisses the alert, so the timer immediately leaves the completed state and falls through to the paused copy (remainingSeconds == 0 but didComplete == false). This makes the new completion status non-persistent and misleading right after acknowledgement; use a separate showCompletionAlert flag so completion status can remain true until reset/restart.
Useful? React with 👍 / 👎.
Summary
Testing