Skip to content

fix(dashboard): offer workflows in the + menu once the chat has a run - #31427

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/21099-gate-workflows-menu-row
Nov 7, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/21099-gate-workflows-menu-row

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The chat side panel's "+" menu offers Workflows only once the chat has at least one workflow run.

In a chat that has never run a dynamic workflow, the "+" menu still lists Workflows. Picking it opens a panel that only says "No workflow runs" and suggests asking for one.

Why it matters

Most chats never run a workflow, so for most readers the menu offers a panel that can only be empty. That is a dead end in a menu people scan to find what a chat has, the same problem the Summary row had while session summaries are off.

Not a goal

  • Changing the Workflows panel itself or its empty state.
  • Gating a Workflows tab that is already open, or the "Open in the Workflows panel" link on run and completion cards.
  • Changing how the command center reads or refreshes the workflow run list.

What changed (motivation → approach → change)

The "+" menu and the empty-panel launcher take their rows from newMenuSections, which already leaves out Terminal, Summary and Workers when they have nothing behind them, but always listed Workflows.

newMenuSections now takes a hasWorkflowRuns flag and drops the Workflows row while it is false. SidePanel.tsx sets it to true once this chat has a run: one that GET /api/workflows/runs lists for the slot, or a live run row for the slot, so the row appears the moment the first run starts. Both are matched to the chat by slotHasWorkflowRun in workflowRunsPoll.ts, the same ownership rule the Workflows view filters its own list with. The list is read through the command center's ['command-center', 'workflows'] entry, which the socket already refreshes when a run ends and on reconnect. It sets no query-level option such as retry, because those apply to every reader of a shared entry and would change the command center's reads. Like the Summary gate it fails open: with no slot, or before the list answers, or when it cannot be read, the row stays.

workflow-chat-cards.md records the gate. The session-summary Playwright spec used the Workflows row as its proof that the menu opened; it now uses Subagents, which every chat offers.

Builds on #21102 by @adlio.

Backwards compatibility

Compatible: only a menu row is hidden; no API, config or stored tab state changes. newMenuSections gains a required option, and its one non-test caller, SidePanel.tsx, passes it.

Reader: website/src/pages/chat/WorkflowRunCard.tsx:openActivityToTab -- chat -- opens the Workflows tab through the store, not the "+" menu, so it works in any chat; WorkflowRunCard.test.tsx
Reader: website/src/pages/chat/WorkflowCompletionCard.tsx:openActivityToTab -- chat -- same store path as the run card; WorkflowCompletionCard.test.tsx
Reader: website/src/pages/chat/SidePanel.tsx:menuItems -- chat -- the empty-panel launcher reads the same gated groups, so it never disagrees with the menu
Reader: website/src/pages/members/membersPageModel.ts:MEMBERS_WITHHELD_VIEWS -- crew page -- the crew page already withholds Workflows, so its menu is unchanged
Reader: website/playwright/session-summary.spec.ts:openAddMenu -- chat -- its open-menu witness is Subagents, offered in every chat

Tests

  • sidePanelAddMenu.test.tsx "offers Workflows once this chat has a run, listed or live": with the run list naming only another chat's run the row is absent while Subagents is offered; a listed finished run of this chat brings it back; a live run start for this chat brings it back with the list naming none. It fails on main (the row is always listed) and passes with this change.
  • The existing newMenuSections unit tests and ContextBreakdownPanel.test.tsx pass the new flag as true, so they keep asserting what they did.

Determinism: the new test passed 20 times alone on one worker, in its whole file under three shuffled orders (--sequence.shuffle, seeds 11, 4242, 90210), and beside 55 other side-panel and chat-page test files at 4 workers (796 tests).

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

Ran the built SPA with the API answered from fixtures and opened the "+" menu: with GET /api/workflows/runs answering no runs the menu lists no Workflows row; with a finished run of this chat it lists Workflows between Subagents and Git (screenshots below).

Screenshots / video

The "+" menu of a chat with no workflow run (built SPA, API answered from fixtures; dark and light), then the same chat once the run list names a finished run of it:

The + menu in a chat with no workflow run, dark: no Workflows row
The + menu in a chat with no workflow run, light: no Workflows row
The + menu in a chat with a finished workflow run, dark: Workflows listed between Subagents and Git

Related Issues

Closes #21099

Sibling sweep

Swept: git grep -n "item.kind !==" -- website/src/pages/chat/SidePanelAddMenu.tsx
Siblings: none -- the rows whose view needs a feature most chats never use are gated already (Terminal, Summary, Workers); Pins, Issues, Links, Subagents and Git fill from ordinary chat turns and the chat's workspace

Pattern harvest

Not generalizable: whether a view has content is specific to each view's data source, so there is no shared shape to lint for.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 13:15
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 13:15
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of ba993801d9f1329f648698d4c1da3b61a61acca0 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The change fixes issue #21099 at the menu-filter level and adds one small helper that could be inlined.

Notes

  • Item 3 — oversized: the new export slotHasWorkflowRun in workflowRunsPoll.ts is only sessionKeys.some(k => runBelongsToSlot(k, slot)), and its only callers are 2 call sites in SidePanel.tsx. The same ownership check is already written inline at workflowRunsPoll.ts:38 and activeSlotState.ts:161 (grepped runBelongsToSlot: 2 inline .some sites, 0 wrappers). Mapping each run to its key just to pass a key array adds a step the inline form does not need. Subtraction: delete slotHasWorkflowRun and write .some(r => runBelongsToSlot(r.sessionKey, slot)) / .some(r => runBelongsToSlot(r.session_key, slot)) in SidePanel.tsx.

What this change ships

Inventory (5 items) — 4 justified

Intent: a chat's "+" menu stops offering a Workflows panel that can only be empty. FIX (closes #21099).

  1. The "+" menu and the empty-panel launcher hide Workflows until the chat has a run. — justified
  2. The Workflows row appears as soon as a run starts for this chat, or once the run list names one. — justified
  3. New exported helper slotHasWorkflowRun. — oversized: a one-line wrapper over runBelongsToSlot
  4. The side panel now reads the shared ['command-center','workflows'] entry in every chat that has a slot. — justified
  5. The Playwright spec checks that the menu opened by looking for Subagents instead of Workflows. — justified

[FIRST-PRINCIPLES-REVIEWED] ba99380

Description read

[DESCRIPTION-READ] 29bd532ec889eea7b31b99e8f905d57c9d1228cc1c9a7820033e4e4c1b889278

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of ba993801d9f1329f648698d4c1da3b61a61acca0 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: this is a small, reversible menu gate that reuses the command center's shared query entry and the existing slot ownership rule, and it fails open.

Notes

  • If GET /api/workflows/runs returns a capped list, an older run of this chat can fall off it, and the row then hides even though the chat has a run. Check whether the endpoint has a limit.

[DESIGN-REVIEWED] ba99380

Description read

[DESCRIPTION-READ] 54256535f23a87b97e991bf35ec9da97aa30c7be798135508557a75d24aad079

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of ba993801d9f1329f648698d4c1da3b61a61acca0 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. Both menu states are shown in the screenshots, and the blind reader read the "Workflows" row correctly ("opens a panel showing those steps or their progress") and would click it.

Notes

  • The blind reader couldn't tell why "Workflows" shows up in shot-03 but not in shot-01 ("I'd be confused when it sometimes isn't there"). The Summary and Terminal rows already appear and disappear the same way, so this is the menu's existing pattern, not a new one.
  • hasWorkflowRuns = !slot || !workflowRunsRead || … shows the row until the run list loads, so in a chat with no runs it can disappear while the menu is open. Hiding the row only after a successful read, or ruling that out for an open menu, would stop the menu shifting under the pointer.

[UX-REVIEWED] ba99380

Description read

[DESCRIPTION-READ] 7dbb767fe08096e34183ebf3b0221973b0bf35e1087e1637bc10cf3875bea83e

That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed ba993801d9f1329f648698d4c1da3b61a61acca0 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] ba99380

Verdict parsed from the review's SHA-scoped output markers for commit ba993801d9f1329f648698d4c1da3b61a61acca0.

False positive or not applicable? A repository writer can comment:
/ai-review override fable ba993801d9f1329f648698d4c1da3b61a61acca0 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of ba993801d9f1329f648698d4c1da3b61a61acca0 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ba99380

False positive or not applicable? A repository writer can comment:
/ai-review override gpt ba993801d9f1329f648698d4c1da3b61a61acca0 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 6, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 13:43
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Render failures from the new workflow-list query span=492e113e5b07

Rebutted: the failure is already shown, with the hand-off, on the surface this gate keeps open. On a failed read workflowRunsRead stays false, so hasWorkflowRuns is true and the Workflows row stays offered.
That row opens the Workflows view. Its own ['workflow-runs'] read of the same api.workflowRuns renders <ErrorNotice message={workflow_runs_load_failed} askAgent /> on error (ActivityViewer.tsx, the wfRunsError branch), so a 503 from workflow readiness reaches the user there.
errors-use-error-notice governs how a surfaced error renders. This diff renders no error anywhere: the gate only decides whether one menu row is listed, and it fails open.
A second notice for this background read, in the side panel or inside the + menu, would repeat the Workflows view's notice for a request the user never made, and add a UI placement #21099 does not ask for. The Summary gate just above (summaryMeta) fails open the same way, with no notice of its own.
[operator: bolichen97]

@bolichen97
bolichen97 force-pushed the fix/21099-gate-workflows-menu-row branch from 15c7caf to bf68432 Compare November 6, 2026 15:21
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/ and website/src/pages/chat/ (files beside this diff's spec and side-panel sources) since this head went green (0eecd84 -> b3c17ad); CI re-running.
[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/21099-gate-workflows-menu-row branch from bf68432 to a1ddce1 Compare November 6, 2026 18:29
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/pages/chat/SidePanel.tsx and website/src/test/sidePanelAddMenu.test.tsx, plus the line-budget test that failed Backend Tests (3.12, 2), Backend Tests (Windows) (2) and Coverage Gate on the old base (fixed on main by #31469), since this head went green (b3c17ad -> c0e9c2e); CI re-running.
[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 6, 2026
A chat that never ran a dynamic workflow still listed Workflows in the
side panel's + menu, and picking it opened a panel that could only say
there were no runs. The row now waits for the chat's first run, listed
by the workflow-runs API or live in the chat's run rows, the way Summary
waits for session summaries. It fails open while the list is unread, and
an open Workflows tab and the run cards' panel link are unchanged.

Builds on #21102 by @adlio.
@bolichen97
bolichen97 force-pushed the fix/21099-gate-workflows-menu-row branch from a1ddce1 to ba99380 Compare November 7, 2026 02:31
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/pages/chat/ and docs/system-specs/modules/ (files beside this diff), plus test/test_security_gate_liveness.py, whose line-budget test failed Backend Tests (3.12, 2), Backend Tests (Windows) (2) and Coverage Gate on the old base (fixed on main by #31625), since this head went green (c0e9c2e -> 10e0a06); CI re-running.
[operator: bolichen97]

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 7, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 7, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for the on-call. Review lanes pass on ba99380, no conflict, no open change request.

@KiroCrewCaptain
KiroCrewCaptain merged commit 9929750 into main Nov 7, 2026
97 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/21099-gate-workflows-menu-row branch November 7, 2026 03:31
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 7, 2026
buluoray pushed a commit that referenced this pull request Nov 8, 2026
…#31427)

A chat that never ran a dynamic workflow still listed Workflows in the
side panel's + menu, and picking it opened a panel that could only say
there were no runs. The row now waits for the chat's first run, listed
by the workflow-runs API or live in the chat's run rows, the way Summary
waits for session summaries. It fails open while the list is unread, and
an open Workflows tab and the run cards' panel link are unchanged.

Builds on #21102 by @adlio.

(cherry picked from commit 9929750)
buluoray added a commit that referenced this pull request Nov 9, 2026
buluoray pushed a commit that referenced this pull request Nov 9, 2026
…#31427)

A chat that never ran a dynamic workflow still listed Workflows in the
side panel's + menu, and picking it opened a panel that could only say
there were no runs. The row now waits for the chat's first run, listed
by the workflow-runs API or live in the chat's run rows, the way Summary
waits for session summaries. It fails open while the list is unread, and
an open Workflows tab and the run cards' panel link are unchanged.

Builds on #21102 by @adlio.

(cherry picked from commit 9929750)
buluoray added a commit that referenced this pull request Nov 9, 2026
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.

Side panel + menu offers Workflows in chats with no workflow runs

2 participants