fix(desktop): restore stable cron jobs position, compact strip, and balanced sidebar spacing - #43310
Conversation
967a8a0 to
d505d9f
Compare
a06d81c to
3a75f73
Compare
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
UI polish fix for the desktop cron jobs sidebar section. Tightens the max-height of the cron jobs list and repositions it below the sessions section with better visual separation.
Looks Good
max-h-72reduced tomax-h-28prevents the cron strip from consuming excessive vertical space- Cron jobs section now lives below sessions with its own
shrink-0container — more stable layout - Running-state pulse animation improved with a proper ping effect
pb-1instead ofpb-2for better spacing balance- No security concerns
Reviewed by Hermes Agent
3a75f73 to
6761712
Compare
|
Thanks for the review, @tonydwb. Pushed a spacing correction on top of this — nav Otherwise unchanged. Ready for CI and maintainer review. |
|
Verified compatible with #44630 (composer status stack). Sidebar spacing + cron dot work correctly alongside the new composer UI. |
6761712 to
ebe864c
Compare
27c2b0f to
b4922a7
Compare
0f0f595 to
14a678d
Compare
95030f2 to
9047847
Compare
9047847 to
02c8943
Compare
02c8943 to
cf7b6e3
Compare
cf7b6e3 to
b2f69cb
Compare
b2f69cb to
6957232
Compare
6957232 to
be19f7d
Compare
6f57991 to
07423e9
Compare
|
The running indicator is now driven by the execution ledger's |
07423e9 to
b10f6a5
Compare
…a execution ledger The sidebar's running dot and job-position stability were broken by origin's PR NousResearch#3396: advance_next_run() moved before run_job(), so next_run_at is pre-advanced to the next future slot before the run. The old client-side heuristic (next_run_at within 10s of now = running) never fires, and trigger_job's transient next_run_at=now write bounces the job to the top of the sorted list for a few seconds on every manual trigger. - cron/executions.py: active_execution_start_times() — cross-process durable ledger of in-flight job starts, with a 30-min claim TTL staleness bound - cron/jobs.py: list_jobs()/get_job() stamp authoritative is_running + active_run_started_at from the ledger; display guard never serves a past next_run_at for a scheduled-but-idle job, so the sort key stays stable - tui_gateway/server.py: _cron_sig folds the running set into the change signature so the desktop learns a job went live without waiting on jobs.json mtime - apps/desktop: dot + "X ago" driven by active_run_started_at (jobStartRef grace counter removed); balanced search-bar spacing retained - tests: contract tests for the stamping display guard
b10f6a5 to
8445160
Compare
Problem
Two regressions in the Desktop sidebar after the sidebar rework (#42537 / #43147):
The running dot never pulses – the original heuristic keyed off
next_run_atbeing within ~10s of now (nowMs - next < 300_000 && nowMs - next > 0). Origin's PR fix(cron): prevent recurring job re-fire on gateway crash/restart loop #3396 (at-most-once crash-safety) movedadvance_next_run()to beforerun_job(), sonext_run_atis always pre-advanced to the next future slot while a job runs. The heuristic never fires.Triggered jobs jump to the top of the list, then drop back –
trigger_job()persistsnext_run_at = nowas the scheduler's "fire now" contract. During the seconds before the scheduler claims the job, the sidebar sorts it to the top, then drops it back to its real slot. Normally (scheduled runs) this never happens because the scheduler pre-advances before the frontend polls – the jump is unique to manual triggers.Fix
Replace the client-side timing heuristic with an authoritative execution ledger, and stop serving the transient
next_run_at = nowto the UI.cron/executions.py–active_execution_start_times(): cross-process durable ledger of in-flight job starts, with a 30-min claim TTL staleness bound (health-check wedge: a wedged claim can't pin the dot forever).cron/jobs.py–list_jobs()/get_job()stamp authoritativeis_running+active_run_started_atfrom the ledger. A display guard never serves a pastnext_run_atfor a scheduled-but-idle job – the computed next slot is shown instead, so the sort key stays stable through a manual trigger.tui_gateway/server.py–_cron_sigfolds the running set into the change signature, so the desktop learns a job went live immediately instead of waiting on jobs.json mtime.apps/desktop– the dot and "X ago" counter are driven byactive_run_started_at(jobStartRefgrace counter removed). Balanced search-bar spacing retained.7 files, +287/-27. No new dependencies, no scheduler-contract changes – the scheduler still reads the persisted
next_run_at = nowand fires on the next tick.Testing
tests/cron/test_jobs.py+tests/cron/test_execution_ledger.py: 154 tests pass (4 new contract tests for the stamping display guard).ruffclean,tscclean on both desktop configs.Fixes #43309