pi-cockpit 0.22.0 → 0.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-cockpit",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "description": "Responsive Maestro operations sidebar, fallback status widgets, and footer for Pi.",
5
5
  "type": "module",
6
6
  "keywords": [
package/src/agent-bar.ts CHANGED
@@ -241,7 +241,9 @@ export function renderSessionBarLine(
241
241
  theme: Theme,
242
242
  shortcutHint?: SessionBarHintValue,
243
243
  ): string {
244
- const w = Math.max(1, width);
244
+ // A live main-screen row must not write the terminal's final column: doing so
245
+ // arms auto-wrap, while pi-tui still tracks the cursor on the original row.
246
+ const w = Math.max(1, width - 1);
245
247
  if (!shortcutHint) return renderContent(w);
246
248
  const hintSpec = typeof shortcutHint === "string" ? { text: shortcutHint, color: "dim" as const } : shortcutHint;
247
249
  const hint = theme.fg(hintSpec.color ?? "dim", hintSpec.text);
@@ -262,7 +264,7 @@ export function renderAgentBar(
262
264
  theme: Theme,
263
265
  options: AgentBarRenderOptions = {},
264
266
  ): string[] {
265
- if (endpoints.length === 0) return [truncateToWidth(chip(MAIN_SESSION_LABEL, true, "accent", theme), Math.max(1, width), "…")];
267
+ if (endpoints.length === 0) return [truncateToWidth(chip(MAIN_SESSION_LABEL, true, "accent", theme), Math.max(1, width - 1), "…")];
266
268
  const now = options.now ?? 0;
267
269
  // A stale selection (id no longer in the endpoint list) must not leave the
268
270
  // bar without a highlighted chip: fall back to root / first endpoint.
@@ -96,6 +96,9 @@ export function makeAgentWidget(deps: AgentWidgetDeps) {
96
96
  return {
97
97
  render(width: number): string[] {
98
98
  const cfg = deps.getConfig();
99
+ // Agent rows update while teammate runs. Leave the final terminal column
100
+ // untouched so auto-wrap cannot move the real cursor below pi-tui's model.
101
+ const liveWidth = Math.max(1, width - 1);
99
102
  // graph(...) is the dispatch container, not an additional worker. Keep it
100
103
  // in AgentsStore for linkage and cleanup, and bridge its visible descendants
101
104
  // to the nearest non-graph ancestor for rendering.
@@ -137,7 +140,7 @@ export function makeAgentWidget(deps: AgentWidgetDeps) {
137
140
  if (runCount) headerSegs.push({ text: theme.fg("dim", tuiT("common.running", { count: runCount })), priority: 80, clippable: false });
138
141
  if (pendingCount) headerSegs.push({ text: theme.fg("dim", tuiT("common.pending", { count: pendingCount })), priority: 60, clippable: false });
139
142
  if (sleepingCount) headerSegs.push({ text: theme.fg("dim", tuiT("common.sleeping", { count: sleepingCount })), priority: 50, clippable: false });
140
- const headerLine = fitLineByPriority(headerSegs, width, UTILS, theme.fg("dim", g.separator), g.ellipsis);
143
+ const headerLine = fitLineByPriority(headerSegs, liveWidth, UTILS, theme.fg("dim", g.separator), g.ellipsis);
141
144
  // Focused-session priority: while a selected session's detail block is
142
145
  // open, it owns the Agent height allowance and the roster collapses to
143
146
  // this one-line summary. The per-agent rows stay reachable through the
@@ -183,12 +186,12 @@ export function makeAgentWidget(deps: AgentWidgetDeps) {
183
186
  above > 0 ? `↑ ${tuiT("common.more", { count: above })}` : "",
184
187
  below > 0 ? `↓ ${tuiT("common.more", { count: below })}` : "",
185
188
  ].filter(Boolean).join(` ${g.separator} `)),
186
- width,
189
+ liveWidth,
187
190
  g.ellipsis,
188
191
  )
189
192
  : undefined;
190
193
  if (marker && above > 0) lines.push(marker);
191
- lines.push(...renderAgents(visible, cfg.agentsMode, width, paint, UTILS, { ...opts, withHead: false, maxRows: windowRows + 1 }));
194
+ lines.push(...renderAgents(visible, cfg.agentsMode, liveWidth, paint, UTILS, { ...opts, withHead: false, maxRows: windowRows + 1 }));
192
195
  if (marker && above === 0) lines.push(marker);
193
196
  return lines;
194
197
  },
package/src/window-bar.ts CHANGED
@@ -59,7 +59,7 @@ export function renderWindowBar(
59
59
  endpoint,
60
60
  }));
61
61
  if (tabs.length === 0) {
62
- return [truncateToWidth(theme.fg("muted", tuiT("window.empty")), Math.max(1, width), "…")];
62
+ return [truncateToWidth(theme.fg("muted", tuiT("window.empty")), Math.max(1, width - 1), "…")];
63
63
  }
64
64
  return [renderSessionBarLine(
65
65
  (availableWidth) => renderSessionTabLine(tabs, availableWidth, {