Skip to content

One Shot Timers#513

Open
JonathanKChang wants to merge 3 commits into
vicolo-dev:masterfrom
JonathanKChang:feature/one-shot-timers
Open

One Shot Timers#513
JonathanKChang wants to merge 3 commits into
vicolo-dev:masterfrom
JonathanKChang:feature/one-shot-timers

Conversation

@JonathanKChang
Copy link
Copy Markdown

@JonathanKChang JonathanKChang commented May 24, 2026

Summary

Add a “Delete After Finishing” option for timers that removes one‑shot timers from storage automatically when they are dismissed. Addresses #433

Changes

  • Alarm isolate
    • After stopping a timer, if timer.shouldDeleteAfterFinishing is true:
      • Load the persisted timer list, remove the finished timer, and save the updated list.
      • Notify the UI isolate via updatePort (updateTimers message) to refresh the timer list.
  • Localization
    • Added timerDeleteAfterFinishingSetting string to app_en.arb.
  • Settings schema
    • Introduced a new SwitchSetting named “Delete After Finishing” (default false) in timerSettingsSchema.
  • Timer model
    • Exposed shouldDeleteAfterFinishing getter that reads the new setting.
  • Timer card UI
    • Shows a small trash-can icon next to timers that have the one‑shot flag enabled.

Notes

  • Implementation details:
    • Deletion happens in the background isolate that controls timer lifecycles, ensuring the UI does not need to manage the removal directly.
    • The UI receives a simple "updateTimers" message; existing UI code already handles generic timer‑list refreshes.
Screenshot_20260524-143244 Screenshot_20260524-143422

Add switch setting for one-shot timer deletion in timer settings schema
and the corresponding ClockTimer.shouldDeleteAfterDismiss getter that
reads the setting value.
Display a delete outline icon next to timer cards that have
Delete After Finishing enabled, giving users visual feedback that the
timer will be automatically removed after completion.
When a one-shot timer (Delete After Finishing enabled) is dismissed,
immediately remove it from persistent storage and notify the UI
isolate so the active list updates.
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.

1 participant