Skip to content

emrg: GUI task status + next-run countdown (rant 2026-08-15T10:36:39) - #804

Merged
argszero merged 1 commit into
masterfrom
feature/task-countdown
Aug 15, 2026
Merged

emrg: GUI task status + next-run countdown (rant 2026-08-15T10:36:39)#804
argszero merged 1 commit into
masterfrom
feature/task-countdown

Conversation

@argszero

Copy link
Copy Markdown
Owner

GUI task management now shows task state and a live next-run countdown (daemon's list_tasks already provides running + next_run_in_seconds + interval; this is a pure display-layer enhancement).

Changes:

  • Task rows show: 运行中 (running) badge / 待运行 pending badge + 下次运行 Ns countdown / 待调度 idle badge; disabled tasks keep the existing 已停用 hint.
  • Live countdown: a 1s setInterval updates only the countdown text node (no full re-render → no flicker/scroll loss); interval is cleared when leaving the tasks view (switchView) to prevent leaks and restarted idempotently on re-render.
  • Countdown format: ≤60s 43s, ≤1h 1m23s, >1h 1h05m, negative clamped to 0.
  • i18n keys zh/en: app.taskNextRun / app.taskPendingBadge / app.taskIdleBadge.
  • CSS: pending/idle badge styles + tabular-nums for jitter-free ticking.
  • Tests: +3 renderer.smoke (format boundaries 0s/59s/60s/1h05m/negative; row state rendering + per-second decrement via updateTaskCountdowns with a fake clock; interval lifecycle start/stop/restart). GUI 250→253; pytest 824 passed/1 skipped; import + CLI checks green.
  • Agent.md GUI count synced (253 breakdown).

Compatible with #802 (running badge + Trigger disable semantics unchanged).

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle

Reviewed the full diff: countdown formatting covers all ranges (≤60s / ≤1h / >1h, negative clamp, decimal floor) with 10-case test; per-second tick uses a deadline snapshot (no row re-render → no flicker/scroll loss); lifecycle is leak-free (stopTaskCountdown on view leave in both switchView paths, idempotent restart, no interval when all tasks running — all covered by tests); i18n zh/en keys added and referenced consistently; Agent.md test counts synced (250→253, renderer smoke 123→126). CI test + test-windows both SUCCESS (run 31860040829).

@pm25coder

Copy link
Copy Markdown
Contributor

I tested this PR end-to-end on Windows and the implementation checks out.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle

3rd consecutive approval from a different cycle. Full diff reviewed previously (countdown formatting ranges, deadline-snapshot tick, leak-free lifecycle, i18n keys, doc-count 250→253); CI test + test-windows green (31860040829); daemon field next_run_in_seconds verified present (scheduler.py:727).

@argszero
argszero merged commit bb0fe0a into master Aug 15, 2026
2 checks passed
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