Skip to content

fix(serve): the run list notices a run appearing or disappearing - #175

Merged
skakri merged 1 commit into
mainfrom
fix/dashboard-run-list-refresh
Aug 7, 2026
Merged

fix(serve): the run list notices a run appearing or disappearing#175
skakri merged 1 commit into
mainfrom
fix/dashboard-run-list-refresh

Conversation

@skakri

@skakri skakri commented Aug 7, 2026

Copy link
Copy Markdown
Member

refresh() is the only thing that reads the run list, and it ran once per project selection plus once when the dashboard itself started a run:

useEffect(() => { void refresh(); }, [refresh]);   // refresh changes only when project does

Every other way the set changes went unnoticed. A run started with ratatoskr run in a terminal never appeared; a run deleted by ratatoskr runs rm stayed on screen indefinitely. A reload or a project switch was the only cure, which is easy to miss because the dashboard otherwise looks live — the event stream keeps updating the run you are already on.

Polled, not streamed

There is no event for "the set of runs changed". The per-run stream only exists once you know a run to subscribe to, which is exactly the thing being missed, so a stream cannot carry the first news of a run.

Ten seconds, and only while the tab is visible, with an immediate read on becoming visible again. A backgrounded dashboard costs nothing, and coming back to one shows the current set at once rather than after the next tick — which is the common case, since the reason the set changed is usually something you just did in a terminal.

The selection, too

refresh kept the current runId unconditionally. Deleting the selected run therefore removed its row from the list while the detail pane went on showing it — a run that no longer exists, rendered as though it did. It now keeps a selection that is still in the list and falls back to the newest when it is not.

Verified

Driven with a browser held open across the change, rather than asserted about the code: 74 rows on load, one run deleted from a terminal, 73 rows fourteen seconds later, no reload. Before this, it stayed at 74.

bun run typecheck passes. cargo fmt, cargo clippy --workspace --all-targets -D warnings and cargo test --workspace are green — no Rust changed, but the dashboard ships from this workspace.

Note there is no unit test: web/ has no test runner, so a test file there only gates typecheck and never executes. The browser check above is the verification.

`refresh()` is the only thing that reads the run list, and it ran once per
project selection plus once when the dashboard itself started a run. Every other
way the set changes went unnoticed: a run started with `ratatoskr run` in a
terminal never appeared, and one deleted by `ratatoskr runs rm` stayed on screen
indefinitely. A reload or a project switch was the only cure.

Polled rather than streamed because there is no event for "the set of runs
changed". The per-run stream exists only once you know a run to subscribe to,
which is precisely the thing being missed. Ten seconds, and only while the tab
is visible, with an immediate read when it becomes visible again — a
backgrounded dashboard costs nothing and a returning one is current at once.

The selection is fixed with it. `refresh` kept the current `runId` unconditionally,
so deleting the selected run left its row gone from the list while the detail
pane went on showing it. It now keeps a selection that still exists and falls
back to the newest when it does not.

Verified against a browser held open across the change: 74 rows, delete one, 73
rows fourteen seconds later, no reload.
@skakri
skakri merged commit dc846c0 into main Aug 7, 2026
2 checks passed
@skakri
skakri deleted the fix/dashboard-run-list-refresh branch August 7, 2026 22:23
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.

1 participant