Skip to content

Let a workflow run card unfold all its earlier stages - #693

Merged
lavaman131 merged 1 commit into
mainfrom
run-card-expand-earlier
Oct 19, 2026
Merged

lavaman131 merged 1 commit into
mainfrom
run-card-expand-earlier

Conversation

@lavaman131

@lavaman131 lavaman131 commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

In Chat's workflow run card, "+N earlier" was static text, so clicking it did nothing on any run, live or ended. That includes the reported case of a finished run. It is now a real button that unfolds the run's whole stage list in a bounded list that scrolls inside the card.

What changes

  • Run card (apps/web/src/chat/run-card.tsx, run-card.css)
    • "+N earlier" is a <button> with aria-expanded and aria-controls. Its accessible name is "Show N earlier stages" (the visible text stays "+N earlier"), and it becomes "Show fewer" once expanded.
    • Expanded, the stages go into a list named "All stages of ". The list is capped at min(15rem, 40dvh), scrolls internally with overscroll-behavior: contain, and is focusable so the keyboard can scroll it (the shared theme focus ring applies).
    • Stages still pass through displayStages over the whole run before folding, so parentIds links and the stopped-descendant rule hold on both sides of the fold.
    • A row whose earlier stages were all unreported still gets the button. Expanded, it says how many weren't reported.
  • How omitted stages are handled (apps/server/src/harness/atomic/full.ts)
    • The truncation happened at the source: the Atomic harness listed only a run's latest 12 stages and counted the rest in earlierStages. Its in-memory fold has every stage only while the session lives, so there is nothing durable to fetch on expand.
    • The harness now keeps the latest 64 stages. That is the same cap the agent connection already enforces for a reported card (MAX_STAGES in packages/agent-link), so stored and broadcast cards stay within existing report limits.
    • Stages beyond 64 are still counted in earlierStages, and the expanded card says "N earlier stages were not reported".
    • The protocol and agent connection are unchanged. apps/connector is unchanged.
  • Docs: docs/hosted-agent.md and docs/agent-connection.md describe the expand behavior and earlierStages.
  • Test seeding: SeedState and the e2e seedChannel can store workflowRuns.

Tests (written red first)

  • apps/web/src/chat/run-card.test.tsx:
    • the folded view and button markup
    • expanding shows every stage plus the unreported count
    • collapsing and short runs
    • nested stages keep their parents and stopped descendants on both sides of the fold
    • a run whose earlier stages were all unreported still offers the button
  • apps/server/src/harness/atomic/full.test.ts: a 70-stage run lists its latest 64 and counts 6 earlier.
  • e2e/run-card.e2e.ts (harness project, AGENT=on), at 1280×800 and on a 390×844 touch phone:
    • opens a finished run with 18 stages and 3 unreported, then taps or clicks "+15 earlier"
    • checks all 18 stages and the unreported note show in a list that scrolls, with no horizontal overflow
    • checks the list sits inside the card, the card inside Chat and the viewport, and the composer stays in view
    • End scrolls to the last stage without moving the card
    • "Show fewer" folds it back
    • the whole sequence is repeated after a reload
    • On the old card this test failed with "element(s) not found" for the button.

Verification

  • GIT_CONFIG_GLOBAL=/dev/null bun test apps/web apps/server packages: 6016 pass, 8 skip, 0 fail
  • bun run types: passed
  • bun run ci: passed, with no design-contract hash renewals
  • bun run e2e --project=harness: 36 passed. run-card.e2e.ts with --repeat-each=6 --retries=0: 12 passed.

Before, 1280×800: a finished run's "+15 earlier" is static text and clicking it does nothing

After, 1280×800: "+15 earlier" is a button

After, 1280×800: every stage in a list that scrolls inside the card, with the unreported count

Before, 390×844 touch phone

After, 390×844 touch phone: expanded, still inside the card above the composer

The "+N earlier" line under a run's stages was static text, so clicking it
did nothing on any run, live or ended. It is now a button (aria-expanded,
named "Show N earlier stages", then "Show fewer") that unfolds every
reported stage in a list that scrolls inside the card, takes focus for
keyboard scrolling, and folds back. Stages still go through displayStages
over the whole run, so parent links and the stopped-descendant rule hold on
both sides of the fold.

Run reports were the real limit: the Atomic harness listed only a run's
latest 12 stages and counted the rest. It now keeps the latest 64, the
same bound the agent connection already allows a reported card, so stored
and broadcast cards stay within existing report limits. Stages a report
never listed are counted in earlierStages, and the expanded card says how
many were not reported.

The e2e seed can now store workflow run cards, and a new harness-project
test opens a finished 18-stage run at 1280x800 and on a 390x844 touch
phone, unfolds it, checks the lane scrolls inside the card, folds it, and
repeats after a reload.

Assistant-model: Claude Opus 5.5 (fast)
Assistant-workflow: inline (fast subagents)
Assistant-verification: bun test red/green: run-card.test.tsx and full.test.ts failed before the change and pass after
Assistant-verification: e2e red/green: run-card.e2e.ts failed on the old card (no expand button) and passes at both sizes, including after a reload
Assistant-verification: bun test passed: apps/web, apps/server and packages with GIT_CONFIG_GLOBAL=/dev/null
Assistant-verification: bun run types and bun run ci passed
Co-authored-by: Alex Lavaee <alexlavaee@microsoft.com>
@lavaman131 lavaman131 self-assigned this Oct 19, 2026
@lavaman131
lavaman131 merged commit 95f12d8 into main Oct 19, 2026
46 of 48 checks passed
@lavaman131
lavaman131 deleted the run-card-expand-earlier branch October 19, 2026 20:30
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.

1 participant