Repository navigation
feat(flows): Workflows B3b — Run Inspector drawer - #4450
Conversation
Second Workflows UI slice. From a paused run's approval notification, a new 'View run' button opens a right-side drawer showing that run's status + step timeline, live-polling until the run finishes. - hooks/useFlowRunPoller.ts (+test): poll-until-terminal — fetches getFlowRun, polls every 2s while running/pending_approval, stops on completed/failed. setTimeout-chained with cancelled/inFlight/mountedRef guards (mirrors IntelligenceOrchestrationTab); no reschedule on error. - components/flows/FlowRunInspectorDrawer.tsx (+test): SubagentDrawer chrome (fixed overlay, backdrop + Escape close). Status pill/dot (WorkflowRunDetail palette), timing line, run.error + pending_approvals banners, and a steps <ol> (node_id + optional port pill + collapsible JSON output). Lean steps — no per-step timing (backend doesn't provide it). - FlowApprovalCard: 'View run' button (renders when payload valid) opens the drawer for the run (thread_id === run id); + tightened node_ids guard to require every element be a string (B3a review nit). - i18n: notifications.flow.viewRun + 17 flowRuns.* keys, real translations x14 locales; pendingApprovalsCount formatted in code (t() doesn't interpolate). typecheck/lint/prettier clean; 31 new Vitest tests pass; i18n parity clean.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdds a polling hook and inspector drawer for flow runs, wires a “View run” action into flow approval notifications with stricter payload validation, and adds matching translation keys across supported locales. ChangesFlow Run Inspector Feature
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant FlowApprovalCard
participant FlowRunInspectorDrawer
participant useFlowRunPoller
participant getFlowRun API
User->>FlowApprovalCard: click View run
FlowApprovalCard->>FlowRunInspectorDrawer: render with thread_id as runId
FlowRunInspectorDrawer->>useFlowRunPoller: useFlowRunPoller(runId)
useFlowRunPoller->>getFlowRun API: fetch run
getFlowRun API-->>useFlowRunPoller: run status
loop while non-terminal
useFlowRunPoller->>getFlowRun API: poll every 2s
getFlowRun API-->>useFlowRunPoller: run status
end
useFlowRunPoller-->>FlowRunInspectorDrawer: run, loading, error
FlowRunInspectorDrawer-->>User: render status, steps, output
User->>FlowRunInspectorDrawer: close (button/backdrop/Escape)
FlowRunInspectorDrawer-->>FlowApprovalCard: onClose
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
Unrelated to B3b — cef_stale_reap.rs:569 fails `cargo fmt --check` on main, which the frontend `format:check` step runs against the Tauri crate, blocking Frontend Checks on every frontend PR. Fixing here to unblock.
…button
- FlowListRow relativeTime() now routes through useT() with flows.list.{justNow,
minutesAgo,hoursAgo,daysAgo} (real translations x14, {count} interpolation via
.replace) instead of hardcoded English. [Codex + CodeRabbit]
- Removed the 'View runs' button + onViewRuns wiring — it was a dead action with
no consumer until B3b's inspector; the B3b integration note is preserved for
the post-tinyhumansai#4450 rebase. [Codex]
- prettier: FlowApprovalCard.test.tsx (pre-existing dirty on main).
typecheck/lint/prettier(repo-wide) clean; 46+8 tests pass; i18n parity clean.
The discoverable hub: a top-level /flows page listing saved workflows (name, enabled toggle, last run + status, Run button) reachable from a new nav tab. Uses existing RPCs only — no backend change. - pages/FlowsPage.tsx (+test): PanelPage shell; listFlows on mount; loading/ error/empty states (empty has no CTA until the B5b canvas); toggle → setFlowEnabled (optimistic), Run → fire-and-forget runFlow + toast + refetch (refetch only on success so a run error keeps its banner). - components/flows/FlowListRow.tsx (+test): CoreJobList-style row — name, Enabled/Paused badge, last-run line, SettingsSwitch toggle, Run + View-runs. - flowsApi.ts: appended listFlows / setFlowEnabled / runFlow (+ Flow type); B3b (tinyhumansai#4450) doesn't touch this file, so no conflict. - Nav wired in lockstep: navConfig (flows tab, 4th), navIcons, SidebarNav + CollapsedNavRail matchActive, AppRoutes (/flows/*), and the E2E navigation.spec ROUTES + nav-config/shell tests (the CI-gated bits). The /workflows/* Skill routes are untouched. - The run inspector (B3b) is a clearly-marked stub, wired after tinyhumansai#4450 merges. - i18n: flows.* + nav.flows across all 14 locales (distinct namespace). typecheck/lint/prettier clean; 69 Vitest tests pass; i18n parity clean.
…button
- FlowListRow relativeTime() now routes through useT() with flows.list.{justNow,
minutesAgo,hoursAgo,daysAgo} (real translations x14, {count} interpolation via
.replace) instead of hardcoded English. [Codex + CodeRabbit]
- Removed the 'View runs' button + onViewRuns wiring — it was a dead action with
no consumer until B3b's inspector; the B3b integration note is preserved for
the post-tinyhumansai#4450 rebase. [Codex]
- prettier: FlowApprovalCard.test.tsx (pre-existing dirty on main).
typecheck/lint/prettier(repo-wide) clean; 46+8 tests pass; i18n parity clean.
Summary
Second Workflows UI slice — inspect a workflow run without leaving the notification center. From a paused run's approval card, a new "View run" button opens a right-side drawer showing the run's status + a step timeline, live-polling until the run finishes. Builds on merged B3a (
flowsApi.ts) + B2's run history.Changes
hooks/useFlowRunPoller.ts(+test) — poll-until-terminal: fetchesgetFlowRun, polls every 2s whilerunning/pending_approval, stops oncompleted/failed.setTimeout-chained withcancelled/inFlight/mountedRefguards (mirrorsIntelligenceOrchestrationTab); no reschedule on error.components/flows/FlowRunInspectorDrawer.tsx(+test) —SubagentDrawerchrome (fixed overlay, backdrop + Escape). Status pill/dot (WorkflowRunDetailpalette), timing line,run.error+pending_approvalsbanners, and a steps<ol>(node_id + optional port pill + collapsible JSON output). Lean steps — no per-step timing (backend doesn't emit it).FlowApprovalCard— "View run" button (opens the drawer forthread_id) + tightened thenode_idspayload guard to require every element be a string (B3a review nit).notifications.flow.viewRun+ 17flowRuns.*keys, real translations across all 14 locales.Scope / next
Drawer is reached from the paused-run notification (bottom-up, per the agreed sequencing). The always-reachable run history list is deferred to B5a (needs a
flows_list_all_runsRPC). No new routes, no backend change.Verification
pnpm typecheck+lint+prettierclean · 31 new Vitest tests pass ·pnpm i18n:checkparity clean.Summary by CodeRabbit