Skip to content

feat: timed warm-up scheduling#79

Open
YaphetSf wants to merge 2 commits into
Lampese:mainfrom
YaphetSf:feat/timed-warmup
Open

feat: timed warm-up scheduling#79
YaphetSf wants to merge 2 commits into
Lampese:mainfrom
YaphetSf:feat/timed-warmup

Conversation

@YaphetSf

Copy link
Copy Markdown
Contributor

Summary

Adds a Timed warm-up mode so you can pick specific times of day to warm up
all accounts, instead of relying only on the existing window-reset auto warm-up.
This gives control over when your 5-hour usage windows start rather than
letting them drift.

What's new

  • Timed warm-up control in the main window header — a popover to toggle the
    feature on/off and manage a list of HH:MM times (e.g. 08:00, 13:00,
    18:00).
  • At each scheduled time the app warms all accounts, skipping any whose
    weekly limit is exhausted.
  • A global enabled flag + the list of times are persisted in localStorage.
  • A 30s scheduler fires each time once per day. A missed time (e.g. while
    the machine is asleep) is skipped rather than warmed late at the wrong moment.

Notes

  • The scheduler runs inside the main app window, so the app must stay running
    (it can live in the tray) and the machine awake. The README documents using
    macOS caffeinate for this.
  • Existing manual and automatic (window-reset) warm-up are unchanged; timed
    warm-up is independent and can be used alongside them.
  • Frontend-only change (no Rust touched). tsc, pnpm build, and
    cargo fmt --check all pass.

Docs

Adds a Warm-Up section to the README explaining the manual / automatic /
timed modes.

ding added 2 commits June 17, 2026 14:44
Lets users pick specific times of day to warm up every account, giving
control over when 5-hour usage windows start instead of relying solely on
the window-reset auto warm-up loop.

- Global enabled flag + list of HH:MM times persisted in localStorage
- 30s scheduler fires once per scheduled minute per day; a missed time
  (e.g. while the machine is asleep) is skipped rather than warmed late,
  and weekly-exhausted accounts are skipped
- Timed control popover in the main window header to toggle and manage times

@emreertunc emreertunc left a comment

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.

I found a functional blocker, so I don’t think this is ready to approve yet.

The timed scheduler runs checkTimedWarmup() immediately when the effect mounts. If the current minute matches a configured time, it marks that time as fired before calling runTimedWarmup(). But runTimedWarmup() reads targets from accountsRef.current, which can still be empty during initial app load. In that case no accounts are warmed, but the scheduled time is still considered fired for the day, so opening or reloading the app during the scheduled minute can silently skip the timed warm-up.

Relevant code: src/App.tsx, around runTimedWarmup and the timed scheduler effect.

There is also a smaller related issue: TIMED_WARMUP_LEDGER_STORAGE_KEY is defined but unused, so the once-per-day fire ledger is only in memory. A reload or reopen during the same scheduled minute can allow duplicate firing.

Also, README has a small typo: sinlge should be single.

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