Skip to content

Give a selected Step's work the Flow's room - #214

Merged
madskronborg merged 5 commits into
masterfrom
madskronborg/dramatically-redesign-and-implement-coll-nizelv
Oct 27, 2026
Merged

madskronborg merged 5 commits into
masterfrom
madskronborg/dramatically-redesign-and-implement-coll-nizelv

Conversation

@madskronborg

Copy link
Copy Markdown
Collaborator

Summary

Selecting a Step in the Flow used to leave the Flow map, the inspector and a long ticket list above the agent's terminal. At 2000×1064 with Flock chat open, the terminal ended up 57×13 cells and below the fold. Now the selected Step's terminal, log or evidence takes most of the record:

  • The map folds into a short rail, and the Step's details move to a column beside its work.
  • Focus gives the work the whole record.
  • herdr is told the terminal's size once it settles, not on every frame.
 <FlowTab>
-  <FlowMap>                    full map, ticket list included
-  <FlowInspector>              metadata, tickets, notes …
-    <StepWork>                 terminal / log / evidence as a footer
+  <FlowWorkspace>              regions stay mounted through resize and Focus
+    #map      <FlowMap rail>   one line per Run; at most ¼ of the Flow's height (≤ 192 px), then scrolls
+    ─ separator ─              drag, ↑ ↓, double-click resets
+    #context  <FlowInspector>  beside the work; above it under a 672 px workspace, details folded
+    │ separator │              drag, ← →, double-click resets
+    #work     Why it failed / question form
+              <StepWork>      <StepParts> Terminal · Log · Evidence   <StepTools> Full · Focus
  • Focus/Restore: the Focus button or Ctrl/Cmd+Shift+F works even with keyboard focus in the terminal. It hides the record's tabs, the notice, the rail and the context column. The same keys, Escape (from outside the terminal) or the button bring them back. If the control that had focus is hidden, focus moves to Restore and returns to that control on Restore.
  • Terminal resizes (desktop/src/shared/terminal-size.ts): the size the terminal opens at goes to herdr at once. A drag or a Focus change sends only the size it settles at, after 120 ms, and nothing when herdr already has that size. The terminal is keyed by Run and agent, so it never reconnects for Focus or a drag.
  • Fixes:
    • Selecting a Step run by a different agent used to keep showing the first agent's terminal; it now shows the right one.
    • A failed Step now shows its Log under "Why it failed".
  • No-selection view: with nothing selected, the map is drawn in full as before.

Evidence

Real Electrobun/CEF dev Desktops were built from origin/master (56d3c96) and from this branch, with Flock chat open. Each ran under a home of its own against a fake collie serving the screenshot's Task, which has 13 Build tickets, and a fake herdr that logs every terminal call. Window sizes were emulated over CDP.

Viewport Before: terminal (cols×rows) After After, Focus
2000×1064 57×13, below the fold ≈110×32, in view ≈152×44
1440×900 91×13, off-screen 65×20, in view
1280×800 74×13, off-screen 48×15, in view
1100×760 62×13, off-screen 64×8, in view, no page scroll

In the after Desktop:

  • Focus and Restore: each sends exactly one terminal.resize, with no new opened. Typed text is kept and keyboard focus stays in the terminal.
  • Separators: a 160 px drag of the column sends one resize. The arrow keys step it and double-click resets it.
  • Focus from outside the work: started from a map button or either separator, Focus moves keyboard focus to Restore, and Restore puts it back.
  • Agent switching: switching between the planner's and the implementer's Steps opens the right pane, and Steps of the same agent don't reconnect.
  • Step states: a failed Step shows "Why it failed" above its Log, and a question shows its answer form.

Screenshots, measurements and the harness are in the Run's handoffs, at runs/run-5fdaf200/handoffs/flow-desktop-evidence/ on the machine the run worked on.

Each new test was recorded failing before the code that makes it pass, or, for the settle test, failing with the code's cancel removed:

  • test/desktop-terminal-size.test.ts:
    • a drag through 80×24 → 92×24 → 131×38 sends nothing at 119 ms and [131, 38] once at 120 ms;
    • settling back at herdr's size sends nothing;
    • opening sends at once.
  • test/desktop-flow-layout.test.ts:
    • column and rail sizes, stacking at 672 px and Focus keys;
    • Focus handing keyboard focus to Restore and back.
  • test/desktop-step-inspector.test.ts: which part of a Step the work shows.

Verified on the branch as it stands: bun run check, run by Collie. The targeted verifications the agent ran through collie verify (typecheck, Desktop typecheck, lint, format, and the terminal-size, flow-layout, step-inspector, desktop-flow and view tests) passed on earlier trees.

Verifications this run is held to:

  • check: /home/mk/.local/share/mise/installs/bun/latest/bin/bun run check (in /home/mk/.herdr/worktrees/.collie/madskronborg/dramatically-redesign-and-implement-coll-nizelv)

The last fix, made after the last review, was checked by its own tests and not by a reviewer. It changed three things:

  • Keyboard focus: it now moves to Restore when Focus would hide the control that had it, and returns on Restore (focusHandOff in flow-layout.ts, FlowTab.vue).
  • Settle test: its fake timer now keeps every timer on a clock, so a resize the code fails to cancel fails the test.
  • Comments: two that restated shownPart and quietWork are gone.

Not verified:

  • A live herdr session with real agents: PTY fit was measured from the fake herdr's reported size, not a real agent's redraw.
  • macOS and real OS window resizes.

Not settled by the run

  • Focus is Ctrl+Shift+F (Cmd+Shift+F on a Mac) and is kept from the agent's pane even in the record's own Terminal tab, so it works with keyboard focus inside the terminal; Escape restores only from outside the terminal, since inside it Escape belongs to the agent.
  • A resize reaches herdr 120 ms after the size stops changing, and never when herdr already has that size; the size a terminal opens at is still sent at once, so opening never waits.
  • The context column sits beside the work down to a 672 px workspace and above it below that; it starts at 28% of the workspace, between 240 and 384 px, and a chosen width holds between 240 px and 45% of the workspace.
  • The rail, left to its Runs, takes at most a quarter of the Flow's height and no more than 192 px before it scrolls, so a 1100x760 window with chat open fits the work without the record scrolling.
  • Chosen rail and column sizes are shared by every record until Desktop quits rather than saved to disk, since the request named no setting and the Settings screen stays small.
  • Focus hides the record's tabs, the Flow's notice, the rail and the context column but keeps the record's header, so the Task and Run being worked on stay named.
  • Why it failed and a question's answer form moved from the inspector to the top of the work, above the Step's terminal, log or evidence, because they are the work a human acts on.
  • The Step's terminal is keyed by Run and agent, which fixes an existing bug where selecting another agent's Step kept showing the first agent's pane; a Step of the same agent keeps its connection.
  • At 1280 and 1100 wide the terminal has fewer columns than master's (48 vs 74, 64 vs 62 cols) but it is on screen; master's was below the map and ticket list. Focus or a smaller column gives it more.
  • The context-width test's minimum was changed from 272 to 240 px together with the code while building ticket 02, after seeing 1280x800 with chat open.
  • Ticket 03's evidence lives in the run's handoffs rather than in the repository, as the ticket says; the harness there needs its scratchpad paths edited to run again.

Merge Danger

Door: two-way. This is view code plus a resize debounce, with nothing persisted and no protocol or state-format change.

Blast Radius: Desktop's Flow tab.

  • Layout: the Flow's layout changes at every window width.
  • Narrow windows: at 1280/1100 the terminal has fewer columns than master's, which was off-screen.
  • Ctrl/Cmd+Shift+F: Desktop now takes this key from the agent's pane.

🤖 Generated with Claude Code

Mads Kronborg and others added 5 commits October 26, 2026 14:01
Every terminal.resize redraws the agent's whole pane under herdr, and the
terminal sent one for each size xterm.js passed through, so dragging a
layout or toggling it sent a resize per frame. The size now reaches herdr
once it has held for 120 ms and only when herdr does not already have it;
the size a controller opens at is still sent at once. Ctrl/Cmd+Shift+F is
kept from the pane, for the Flow's Focus to take.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Step's terminal sat below the whole map and the inspector's details, so a
Task with many tickets left it a few hundred pixels, often below the fold.
Selecting a Step now folds the map into a rail of one line per Run, puts the
Step's context in a resizable column beside its work, and lets the work fill
the rest; Focus gives it the whole record and restores without reconnecting.
A narrow record stacks the column over the work and folds its details. The
terminal is keyed by Run and agent, so selecting another agent's Step shows
that agent's pane instead of the one opened first. A failed Step shows its
Log under why it failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Focus from a map button, a separator or the notice hid the focused control,
dropping focus to the page where the Flow's Escape and Ctrl+Shift+F no longer
reach. Focus now hands it to Restore, and Restore hands it back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fake timer kept only its latest callback, so it hid any resize production
code forgot to cancel. It now keeps every timer on a clock, which also checks
the 120 ms delay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@madskronborg madskronborg self-assigned this Oct 26, 2026
@madskronborg
madskronborg merged commit 694d6f6 into master Oct 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant