Skip to content

feat(dispatch): attach-all in grid mode + project terminal setting - #69

Merged
Juliusolsson05 merged 2 commits into
mainfrom
feat-dispatch-attach-regular-and-terminal-setting
May 11, 2026
Merged

Juliusolsson05 merged 2 commits into
mainfrom
feat-dispatch-attach-regular-and-terminal-setting

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Two related dispatch polish fixes in one PR.

Part A — Attach All Dispatch Agents For Tab works in grid mode

The command was gated by dispatchCommandTabId, which returns null whenever the workspace is not in Dispatch. That forced users with parked agents to first flip into Dispatch just to bring them back into the grid — friction with no upside.

Replaced with attachAllCommandTabId:

  • In Dispatch: delegate to dispatchCommandTabId so global Dispatch can still target the focused row's tab (which may differ from activeTabId).
  • Outside Dispatch: fall back to state.activeTabId. The command appears whenever the active tab has detached agents waiting.

attach-detached-to-grid (the single-agent picker) stays dispatch-only — it needs a dispatch-focused session as its target, so there is no clean grid-mode meaning.

Part B — Dispatch project terminal is a setting, off by default

The dispatch terminal was gated by an ephemeral dispatchMode.terminalVisible flag in workspace state. That flag re-defaulted to ON every time Dispatch was re-entered (fresh workspace, new tab, scope switch) — the "I turned it off but it came back" failure mode the user has been hitting.

  • New settings.dispatchProjectTerminal: boolean in app-state/settings/types.ts, default false, coerced strictly (=== true) so missing/malformed values stay off.
  • New entry in Settings → Workspace: "Attach Project Terminal to Dispatch".
  • DispatchLayout reads the setting and conditionally mounts the terminal pane + claims layout space. When OFF the agent panel takes basis-full.
  • Removed toggleDispatchTerminal action + the toggle-dispatch-terminal command (per the user request: "settting defined in settings, not a command").
  • Dropped terminalVisible from DispatchModeState; older workspace.json entries with the field are harmlessly ignored.
  • enterDispatchMode / setDispatchScope no longer call ensureDispatchTerminal themselves. The DispatchLayout useEffect is the only spawn site now, gated by the setting — so flipping the setting OFF and re-entering Dispatch cannot silently spawn a fresh terminal.

Test plan

  • In grid mode, with detached agents parked, open command palette → "Attach All Dispatch Agents For Tab" runs and pulls them into the active tab's grid.
  • Fresh workspace + enter Dispatch → no terminal pane visible; agent panel is full-width.
  • Flip Settings → Workspace → "Attach Project Terminal to Dispatch" ON → terminal pane appears within a frame.
  • Flip it OFF → pane disappears; the terminal session itself is not killed (it remains as a normal tile-tree leaf in the tab and can be closed like any other pane).
  • Restart the app → setting persists; terminal does not auto-spawn behind the user's back.

🤖 Generated with Claude Code

Juliusolsson05 and others added 2 commits May 11, 2026 14:40
The command was gated by dispatchCommandTabId, which returned null
whenever the workspace was not in Dispatch — so users with parked
agents had to first flip into Dispatch just to bring them back.
Replace the resolver with attachAllCommandTabId: delegates to the
dispatch-aware resolver when in Dispatch (preserves global Dispatch
behavior, where the focused row may live on a different tab), and
falls back to activeTabId in grid mode.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the per-session dispatchMode.terminalVisible flag (and its
command-palette toggle) with a global setting,
settings.dispatchProjectTerminal, defaulting to false. The previous
design re-defaulted to ON whenever a fresh workspace or new tab
entered Dispatch — that's the "I turned it off but it came back"
failure mode users have been hitting.

- Add the setting + DEFAULT_SETTINGS entry + coerceSettings rule
- New Settings → Workspace entry: "Attach Project Terminal to Dispatch"
- DispatchLayout reads settings.dispatchProjectTerminal; if OFF, the
  terminal pane neither mounts nor takes layout space
- Remove toggleDispatchTerminal action + its command-palette command
- Drop terminalVisible from DispatchModeState (old workspace.json
  entries silently ignore the unknown field)
- enterDispatchMode / setDispatchScope no longer call ensureDispatchTerminal
  unconditionally — DispatchLayout's effect is the only call site,
  gated by the setting

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Juliusolsson05
Juliusolsson05 merged commit 2b34e0b into main May 11, 2026
@Juliusolsson05
Juliusolsson05 deleted the feat-dispatch-attach-regular-and-terminal-setting branch July 7, 2026 21:56
Juliusolsson05 added a commit that referenced this pull request Sep 27, 2026
…119)

Outcome, decision 5, Change and Tests now state the per-conversation ledger
carried by the initial history chunk and the durable row; the #69 hold and
the filed residuals (#1443, #1444) are recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Juliusolsson05 added a commit that referenced this pull request Sep 27, 2026
… hold lifted)

#69 merged after its own round 1 (since is a poll-start lower bound; a
request-only flow that provably starts after the gap streams; the phase owner
is sealed last). The app API is unchanged; no lockfile entry to resync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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