Skip to content

Commit a9dfae6

Browse files
Merge pull request #793 from corbitsdev/cl-6791-chrome-zone-type
Move chrome zone content type into chrome-state
2 parents 8d6b2ed + 2d0f93f commit a9dfae6

2 files changed

Lines changed: 18 additions & 9 deletions

File tree

src/tui/chrome-state.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import {
4141
type LaneState,
4242
} from "./agent-progress.js";
4343
import { AGENTS_PANEL_MAX_VISIBLE, TASKS_PANEL_MAX_VISIBLE } from "./geometry/zones.js";
44-
import type { ChromeZoneContent } from "./shell.js";
4544

4645
/**
4746
* How long a finished agent row (done / failed / cancelled / interrupted) stays
@@ -157,6 +156,18 @@ export interface FormattedChromeZones {
157156
readonly agents: readonly AgentPanelRow[] | null;
158157
}
159158

159+
/**
160+
* Partial chrome snapshot for `setChromeZones`. Omitted fields mean don't-touch
161+
* (leave the current zone); `null`/empty means hide. Distinct from
162+
* `FormattedChromeZones`, which always names both zones.
163+
*/
164+
export interface ChromeZoneContent {
165+
/** One row per task-panel line. Null/empty = hide the zone. */
166+
readonly task?: readonly TaskPanelRow[] | null;
167+
/** One row per agents-panel line. Null/empty = hide the zone. */
168+
readonly agents?: readonly AgentPanelRow[] | null;
169+
}
170+
160171
/**
161172
* Format structured live state into chrome zone rows for setChromeZones.
162173
*

src/tui/shell.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
*/
77

88
import { homedir } from "node:os";
9-
import { clampBoardRows, type AgentPanelRow, type TaskPanelRow } from "./chrome-state.js";
9+
import {
10+
clampBoardRows,
11+
type AgentPanelRow,
12+
type ChromeZoneContent,
13+
type TaskPanelRow,
14+
} from "./chrome-state.js";
1015

1116
import {
1217
BoxRenderable,
@@ -4792,13 +4797,6 @@ export function dispatchPaletteSelection(shell: AppShell, cmd: PaletteCommand):
47924797
});
47934798
}
47944799

4795-
export interface ChromeZoneContent {
4796-
/** One row per task-panel line. Null/empty = hide the zone. */
4797-
readonly task?: readonly TaskPanelRow[] | null;
4798-
/** One row per agents-panel line. Null/empty = hide the zone. */
4799-
readonly agents?: readonly AgentPanelRow[] | null;
4800-
}
4801-
48024800
/** Bracket marker per task status; a trailer row (status null) gets none. */
48034801
function taskStatusMarker(status: TaskPanelRow["status"]): string {
48044802
switch (status) {

0 commit comments

Comments
 (0)