Skip to content

feat(flows): Workflows B3b — Run Inspector drawer - #4450

Merged
graycyrus merged 2 commits into
tinyhumansai:mainfrom
graycyrus:feat/flows-b3b-run-inspector
Jul 3, 2026
Merged

graycyrus merged 2 commits into
tinyhumansai:mainfrom
graycyrus:feat/flows-b3b-run-inspector

Conversation

@graycyrus

@graycyrus graycyrus commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

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

  • New 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.
  • New components/flows/FlowRunInspectorDrawer.tsx (+test) — SubagentDrawer chrome (fixed overlay, backdrop + Escape). 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 emit it).
  • FlowApprovalCard — "View run" button (opens the drawer for thread_id) + tightened the node_ids payload guard to require every element be a string (B3a review nit).
  • i18n — notifications.flow.viewRun + 17 flowRuns.* 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_runs RPC). No new routes, no backend change.

Verification

pnpm typecheck + lint + prettier clean · 31 new Vitest tests pass · pnpm i18n:check parity clean.

Summary by CodeRabbit

  • New Features
    • Added a right-side drawer to inspect individual flow runs, including live status (with polling through pending approval), steps, step output (expandable), ports, and start/end timestamps.
    • Added a “View run” action in flow approval notifications to open the inspector.
  • Bug Fixes
    • Strengthened approval payload validation and improved handling for loading, error, empty, and pending-approvals states in the run inspector UI.
  • Documentation
    • Expanded i18n translations for the run inspector and flow-run status labels across multiple languages.

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.
@graycyrus
graycyrus requested a review from a team July 3, 2026 19:23
@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bc0299d4-ed3f-418a-8146-0e4cf70073ab

📥 Commits

Reviewing files that changed from the base of the PR and between bd05e07 and c2263c9.

📒 Files selected for processing (1)
  • app/src-tauri/src/cef_stale_reap.rs
✅ Files skipped from review due to trivial changes (1)
  • app/src-tauri/src/cef_stale_reap.rs

📝 Walkthrough

Walkthrough

Adds 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.

Changes

Flow Run Inspector Feature

Layer / File(s) Summary
Poll-until-terminal hook and tests
app/src/hooks/useFlowRunPoller.ts, app/src/hooks/__tests__/useFlowRunPoller.test.ts
New hook fetches a run immediately and polls every 2s while non-terminal (running/pending_approval), stopping on completed/failed, runId null, or unmount; fully tested with fake timers.
FlowRunInspectorDrawer component and tests
app/src/components/flows/FlowRunInspectorDrawer.tsx, app/src/components/flows/__tests__/FlowRunInspectorDrawer.test.tsx
New overlay drawer showing run status pill, timestamps, pending-approvals banner, error states, and collapsible per-step output, backed by a full test suite.
FlowApprovalCard view-run integration and validation
app/src/components/notifications/FlowApprovalCard.tsx, app/src/components/notifications/FlowApprovalCard.test.tsx
Adds a "View run" button opening FlowRunInspectorDrawer, tightens node_ids validation to require string arrays, and updates/extends tests.
Localized strings for flow run inspector
app/src/lib/i18n/{ar,bn,de,en,es,fr,hi,id,it,ko,pl,pt,ru,zh-CN}.ts
Adds notifications.flow.viewRun and flowRuns.inspector.*/flowRuns.status.* translation keys to all locale files.

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
Loading

Suggested labels: feature

Suggested reviewers: M3gA-Mind, sanil-23

Poem

A drawer hops in from the side,
With steps and statuses to guide 🐇
Poll, poll, till the run says “done,”
Or “failed,” or “needs approval” won.
Across many tongues, “view run” will gleam —
A tidy little flow-run dream 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a flow run inspector drawer for workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added the feature Net-new user-facing capability or product behavior. label Jul 3, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 3, 2026
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.
graycyrus added a commit to graycyrus/openhuman that referenced this pull request Jul 3, 2026
…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.
@graycyrus
graycyrus merged commit 83d298d into tinyhumansai:main Jul 3, 2026
18 checks passed
graycyrus added a commit to graycyrus/openhuman that referenced this pull request Jul 3, 2026
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.
graycyrus added a commit to graycyrus/openhuman that referenced this pull request Jul 3, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Net-new user-facing capability or product behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant