From efff24b5913efa51b5dfd9d9153ed1f70a8b4f8d Mon Sep 17 00:00:00 2001 From: Mickael Farina Date: Wed, 7 Oct 2026 13:54:37 +0700 Subject: [PATCH] Activity: say "running for" only while a project runs A project waiting for approval, paused or blocked showed "running for N min" (the time since it started). Now only a running project shows that; a finished one shows "took", and the others keep "started ...". Co-Authored-By: Claude Opus 5.5 --- codec_tasks.html | 4 +++- docs/known-issues.md | 2 +- tests/test_activity.py | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/codec_tasks.html b/codec_tasks.html index 8f46865..32447f0 100644 --- a/codec_tasks.html +++ b/codec_tasks.html @@ -1013,7 +1013,9 @@

Files

} var meta = []; if (total) meta.push(Math.min(idx, total) + ' of ' + total + ' checkpoints'); - if (p.elapsed_s != null) meta.push((live ? 'running for ' : 'took ') + _actDur(p.elapsed_s)); + // "running for" only while it runs; a waiting, paused or blocked project shows when it started. + var running = p.status === 'running' || p.status === 'crashed_resumed'; + if (p.elapsed_s != null && (running || !live)) meta.push((running ? 'running for ' : 'took ') + _actDur(p.elapsed_s)); if (p.created_at) meta.push('started ' + _actWhen(p.created_at)); if (p.silenced) meta.push('notifications off'); h += '
' + meta.map(function (m) { return '' + escHtml(m) + ''; }).join('') + '
'; diff --git a/docs/known-issues.md b/docs/known-issues.md index fba080f..46c4f82 100644 --- a/docs/known-issues.md +++ b/docs/known-issues.md @@ -436,7 +436,7 @@ you copy a web link") from the skill's `SKILL_OBSERVATION_TRIGGER`, falling back to the skill's name. Found in the Mac merge pass. Revisit: the next item that touches triggers. -## The Activity board says "running for" a project that is waiting (2026-10-07) +## The Activity board says "running for" a project that is waiting (2026-10-07) — FIXED (only while it runs) Tasks > Activity (P3.8) shows "running for N min" under every project, including one waiting for approval or paused, where it is the time since it started. Fix: diff --git a/tests/test_activity.py b/tests/test_activity.py index 63c76f7..755e20c 100644 --- a/tests/test_activity.py +++ b/tests/test_activity.py @@ -253,6 +253,8 @@ def _jsdom_available() -> bool: const bar = d.querySelector('.act-card[data-agent="run1"] .act-bar'); out.bar = [bar.getAttribute('aria-valuenow'), bar.getAttribute('aria-valuemax'), bar.firstChild.style.width]; out.meta = d.querySelector('.act-card[data-agent="run1"] .act-meta').textContent; + out.metaPaused = d.querySelector('.act-card[data-agent="bud1"] .act-meta').textContent; + out.metaDone = d.querySelector('.act-card[data-agent="old1"] .act-meta').textContent; out.last = d.querySelector('.act-card[data-agent="run1"] .act-last').textContent; out.crews = [...d.querySelectorAll('#actCrews .act-card')].map(c => [c.querySelector('.act-title').textContent, c.querySelector('.act-state').textContent, [...c.querySelectorAll('button')].map(b => b.textContent)]); @@ -287,6 +289,8 @@ def test_the_activity_tab_renders_projects_crews_and_grants_under_jsdom(): assert d["buttons"]["old1"] == ["Files"], "a finished project only lists its files" assert d["bar"] == ["2", "5", "40%"] assert "2 of 5 checkpoints" in d["meta"] and "running for 2 min" in d["meta"] + assert "running for" not in d["metaPaused"] and "started" in d["metaPaused"], "a paused project is not running" + assert "took 10 min" in d["metaDone"] assert d["last"] == "Checkpoint 2 done" assert d["crews"][0] == ["Daily briefing", "Running", ["Stop"]] and d["crews"][1][:2] == ["Deep research", "Interrupted"] assert d["chips"] == ["example.com", "web_search"]