chrono icon indicating copy to clipboard operation
chrono copied to clipboard

One Shot Timers

Open JonathanKChang opened this issue 6 months ago • 0 comments

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

JonathanKChang avatar May 24 '26 18:05 JonathanKChang