Skip to content

fix(dashboard): real-time recipe-run feedback + clear run→inbox output trail#757

Merged
Oolab-labs merged 1 commit into
mainfrom
fix/recipe-hub-realtime-feedback
May 20, 2026
Merged

fix(dashboard): real-time recipe-run feedback + clear run→inbox output trail#757
Oolab-labs merged 1 commit into
mainfrom
fix/recipe-hub-realtime-feedback

Conversation

@kungfuk3nnyyy
Copy link
Copy Markdown
Collaborator

Summary

  • Problem 1 — Stale runs after triggering: handleRunConfirm now calls refetchRuns() and refetchRecipes() immediately after a successful run POST, matching the pattern handleToggle already used for refetchRecipes.
  • Problem 2 — In-progress runs don't progress: Runs poll interval is now adaptive. A useEffect watches the runs list for in-flight statuses (running/queued/pending) and sets runsIntervalMs to 3 000 ms while any are in-flight, back to 10 000 ms when idle. A prevInFlightRef gates setRunsIntervalMs so it only fires on actual transitions — no render loop.
  • Problem 3 — Status pill lag: layout.tsx recipes intervalMs reduced from 30 000 → 10 000 ms so the pill reconciles within ~10 s after a run or toggle.
  • Inbox legibility: The "Latest inbox output" card is relabelled "Latest output → Inbox" with "delivered N ago" copy and a "View in inbox →" link. Each row in the "Recent runs" list that carried inboxOutputs now shows a subtle → inbox link to the delivered item. A useEffect with lastSeenCompletedSeqRef fires a "Output delivered to inbox" toast (with "View in inbox" action) exactly once per newly-completed run that produced output — it skips existing runs on initial load.

Render-loop guarantee

runsIntervalMs is updated only when in-flight presence changes, not on every render. prevInFlightRef stores the previous boolean and the setRunsIntervalMs call is guarded by if (prevInFlightRef.current === hasInFlight) return.

Test plan

  • Trigger a run → verify "Recent runs" and summary update within 3 s (not 10 s)
  • While a run is running, verify the poll interval drops to ~3 s (observable via Network tab)
  • After a run that delivers inbox output, verify a single "Output delivered to inbox" toast appears with a working "View in inbox" link
  • Reload the page — confirm no toast fires for existing completed runs on initial load
  • Verify run rows with inboxOutputs show a subtle → inbox link
  • Verify the status pill (layout) reconciles within ~10 s after enable/disable

🤖 Generated with Claude Code

…t trail

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Oolab-labs Oolab-labs merged commit 22a99e6 into main May 20, 2026
14 checks passed
@Oolab-labs Oolab-labs deleted the fix/recipe-hub-realtime-feedback branch May 20, 2026 15:03
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