fix(web): worker detail loads fast — stats from summary + lightweight flow + SWR tab cache - #2227
Open
federicodeponte wants to merge 2 commits into
Open
fix(web): worker detail loads fast — stats from summary + lightweight flow + SWR tab cache#2227federicodeponte wants to merge 2 commits into
federicodeponte wants to merge 2 commits into
Conversation
…htweight flow + SWR tab cache)
The worker-detail Overview blocked its 3 stat cards (Last run / Runs / Success)
and the Flow section on the full GET /workers/{id} payload, which the backend
documents as ~6-8s warm / tens of seconds cold on Cloud (recent runs +
latest-run output + ~3s stats batch + recipe + secret/connection availability +
on-disk bundle). So operators saw 'Loading / Loading / Loading' and a persistent
flow skeleton on every open. #2186 had also shrunk the detail cache freshness to
250ms, which effectively disabled the tab-switch cache and re-fired the heavy
fetch on nearly every tab click.
- Stats now render instantly from the list summary (recent_stats/last_run) and
upgrade to fresh detail values when it arrives (stale-while-revalidate); no
more 'Loading' text sitting for seconds.
- Overview flow uses the existing lightweight ?shape=run fetch (config only), so
it resolves in <1s instead of blocking on the heavy assembly; the full detail
loads in the background to warm the file-backed tabs.
- Detail cache restored to stale-while-revalidate with a 30s fresh window: a
cached detail is served immediately on tab switches (never re-blanks to a
spinner) and revalidated in the background. Cross-workspace safety is kept by
the workspace-scoped cache key, not a tiny freshness window.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Runs completed / Runs today cards wrapped the sparkline in an overflow-hidden box; the hover tooltip renders above the sparkline (bottom-full) and was clipped by that box, so it read as a stray tooltip overlapping card content. Drop the clip — the area fill already fades to transparent at the bottom edge, so nothing bleeds past the card. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The authed worker-detail page (
floom.dev/app→/workers?sel=<id>, the split-pane operators live in) is sluggish:Root cause
OverviewTabblocked its stat cards and the flow on the fullGET /workers/{id}payload, which the backend documents as ~6-8s warm / tens of seconds cold on Cloud (recent runs + latest-run output + ~3s stats batch + recipe + secret/connection availability + on-disk bundle materialize). The 3 stats need none of that — they come fromrecent_stats/last_runalready on the list summary.Separately, #2186 shrank the detail cache freshness to 250ms, which effectively disabled the "cached so tab switches don't refetch" behavior and re-fired the heavy fetch on nearly every tab click.
Fix
?shape=runfetch (config only) → resolves in <1s instead of blocking on the heavy assembly. The full detail loads in the background to warm the file-backed tabs (Source/Setup/Versions/Tools/Library) so they're instant on first click.overflow-hiddenwrapper that was clipping the hover tooltip into card content.Expected speedup
Opening a worker: stat cards resolve in <100ms (were 6-8s), flow in <1s (was 6-8s). Tab switches: instant from cache after first load (were a fresh 6-8s refetch each).
Verification
vitest: updatedworkers-overview-flow-schedule+ 9 other worker-detail DOM suites (40 tests) green; stale-closure timeout regression test green.tsc --noEmit: 0 errors in changed source (37 pre-existing test-file errors unchanged).eslint,lint:detail-tabs,lint:borders,lint:tokens: clean.Notes
workers-overview-flow-schedule.dom.test.tsxpreviously asserted the stat summary must show "Loading" and hide the summary's run count until the heavy detail loaded — that encoded the exact slow behavior being fixed, so it now asserts stats render from the summary immediately while the flow shows its skeleton.🤖 Generated with Claude Code