Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(agentic-ide): teach the layout watchdog about the minimum-size clamp

rubenluetke10-beepab142e5e2226
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
index a7d3356471..f2375ebd8d 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
@@ -1949,7 +1949,16 @@ export function AgenticGrid({
const node = paneNodes.current.get(term.name);
if (!node) continue;
const rect = node.getBoundingClientRect();
- const content = node.querySelector(".xterm-screen")?.getBoundingClientRect();
+ // A clamped terminal is DELIBERATELY bigger than its tile — a pane
+ // narrower than 60 columns still renders 60 so the CLI inside can lay
+ // its interface out, and the overflow clip shows what fits (see
+ // MIN_REAL_COLS in ./AgenticTerminal, which writes this stamp). That
+ // designed clipping must not read as a missed refit.
+ const clamped =
+ node.querySelector('[data-pane-clamped="true"]') !== null;
+ const content = clamped
+ ? undefined
+ : node.querySelector(".xterm-screen")?.getBoundingClientRect();
panes.push({
name: term.name,
left: rect.left,
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx
index 8ab51dfc3f..5b4a810cf6 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx
@@ -819,6 +819,13 @@ export function AgenticTerminal({
const rows = Math.max(proposed.rows, MIN_REAL_ROWS);
if (cols === proposed.cols && rows === proposed.rows) fit.fit();
else term.resize(cols, rows);
+ // Clamped means the terminal is DELIBERATELY bigger than its tile and
+ // the overflow clip is doing its job — the grid's layout watchdog
+ // reads this so it never mistakes that designed clipping for a missed
+ // refit (see `paneLayoutGuard`).
+ container.dataset.paneClamped = String(
+ cols !== proposed.cols || rows !== proposed.rows,
+ );
}
} catch {
/* not measured yet — the ResizeObserver below will fit */
@@ -1252,6 +1259,11 @@ export function AgenticTerminal({
cols: Math.max(proposed.cols, MIN_REAL_COLS),
rows: Math.max(proposed.rows, MIN_REAL_ROWS),
};
+ // Same stamp as the mount-time fit above, for the same reader: the
+ // layout watchdog must not "repair" a clamp that is working as designed.
+ container.dataset.paneClamped = String(
+ size.cols > proposed.cols || size.rows > proposed.rows,
+ );
try {
if (size.cols === proposed.cols && size.rows === proposed.rows) {
fit.fit();
diff --git a/jarvis/ui/web/frontend/src/components/agentic/paneLayoutGuard.ts b/jarvis/ui/web/frontend/src/components/agentic/paneLayoutGuard.ts
index a0f912738c..b5861e49b9 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/paneLayoutGuard.ts
+++ b/jarvis/ui/web/frontend/src/components/agentic/paneLayoutGuard.ts
@@ -37,7 +37,11 @@ export interface MeasuredPane {
* The terminal's rendered screen (xterm's `.xterm-screen`), when the pane
* holds one. Sized `cols x cellWidth` by the fit — so it may be a little
* SMALLER than the pane (the remainder under one character cell) but must
- * never be bigger. Absent for a pane still connecting.
+ * never be bigger. Absent for a pane still connecting, and absent by the
+ * caller's choice for a pane whose terminal is CLAMPED to the minimum
+ * usable size — that one is deliberately bigger than its tile, and the
+ * clipping is the design, not a fault (see MIN_REAL_COLS in
+ * `./AgenticTerminal`).
*/
content?: { left: number; top: number; width: number; height: number };
}