zames_pro 2.82.134 → 2.82.135

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/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.82.135] - 2026-10-24
11
+
12
+ ### Changed
13
+
14
+ - **tui:** one pure helper owns the full-screen layout arithmetic
15
+
10
16
  ## [2.82.134] - 2026-10-24
11
17
 
12
18
  ### Fixed
@@ -18,7 +18,8 @@ import { InputLine } from './InputLine.js';
18
18
  import { contentWidth } from '../width.js';
19
19
  import { translate } from '../i18n.js';
20
20
  import { suggestRowCount } from '../input/suggest.js';
21
- import { inputBoxRows, truncateToWidth, visLen } from '../input/layout.js';
21
+ import { truncateToWidth, visLen } from '../input/layout.js';
22
+ import { fullScreenLayout } from './layout.js';
22
23
  import { useMouseWheel } from './useMouseWheel.js';
23
24
  /** The header bar: title, version, working directory. */
24
25
  function Header({ store }) {
@@ -49,27 +50,20 @@ export function FullScreenApp({ store, inputProps, }) {
49
50
  const state = useSyncExternalStore(store.subscribe, store.getSnapshot);
50
51
  const { rows } = useWindowSize();
51
52
  const termRows = rows || 24;
52
- // Fixed panel height: header (2) + status (1) + the input box (2 borders +
53
- // its VISUAL rows) + the suggestion popup rows. The log viewport gets the
54
- // rest.
55
- const HEADER_ROWS = 2;
56
- const STATUS_ROWS = 1;
53
+ // ONE pure helper owns the panel arithmetic, so the reserved rows and the
54
+ // caret row can never drift apart (the component used to compute them
55
+ // separately and the caret landed below the input box when the panel filled
56
+ // the terminal).
57
57
  const cols = Math.max(1, useWindowSize().columns || 80);
58
- // The box height comes from the SAME layoutInput() the box renders with, so
59
- // the reserved rows and the drawn rows can never disagree (a logical-line
60
- // count missed the word-wrap of a long line and the second line overprinted
61
- // the first).
62
- const INPUT_BOX_ROWS = inputBoxRows(state.prompt, state.edit.buf, state.edit.cursor, cols);
63
- // The suggestion popup renders ABOVE the input box; reserve its rows so
64
- // opening the list does not push the panel / shift the whole layout.
65
- const suggestRows = suggestRowCount(state.edit.buf, state.commands, cols);
66
- // A one-line hint UNDER the input box (selection / scroll keys). It is part
67
- // of the fixed panel height, so the log viewport shrinks by one row instead
68
- // of the panel overflowing; `cursorTop` (measured from the top) is NOT
69
- // affected, so the caret cannot move.
70
- const HINT_ROWS = 1;
71
- const panelRows = HEADER_ROWS + STATUS_ROWS + INPUT_BOX_ROWS + suggestRows + HINT_ROWS;
72
- const logHeight = Math.max(1, termRows - panelRows);
58
+ const fsLayout = fullScreenLayout({
59
+ termRows,
60
+ cols,
61
+ prompt: state.prompt,
62
+ buf: state.edit.buf,
63
+ cursor: state.edit.cursor,
64
+ suggestRows: suggestRowCount(state.edit.buf, state.commands, cols),
65
+ });
66
+ const logHeight = fsLayout.logHeight;
73
67
  // Window the log BY RENDERED ROW: a long wrapped answer can be taller than
74
68
  // one entry, and an entry-count window either overflowed the panel or left
75
69
  // it half empty. `scroll` is measured in ROWS here (0 = newest at the
@@ -129,11 +123,7 @@ export function FullScreenApp({ store, inputProps, }) {
129
123
  // after everything above: header + as many log rows as fit + the
130
124
  // suggestion popup + status. `cursorTop` counts the rows ABOVE the
131
125
  // input rows; the box border row is added by InputLine.
132
- cursorTop: HEADER_ROWS +
133
- Math.max(1, termRows - panelRows) +
134
- suggestRows +
135
- STATUS_ROWS +
136
- 1, prompt: state.prompt, locale: state.locale, commands: state.commands, locked: state.locked }), _jsx(Text, { color: "#5b616e", wrap: "truncate", children: ' ' +
126
+ cursorTop: fsLayout.cursorTop, prompt: state.prompt, locale: state.locale, commands: state.commands, locked: state.locked }), _jsx(Text, { color: "#5b616e", wrap: "truncate", children: ' ' +
137
127
  translate(state.locale)(state.mouseScroll ? 'editor.keys_hint' : 'editor.keys_hint_select') })] }));
138
128
  }
139
129
  void contentWidth;
@@ -0,0 +1,32 @@
1
+ // PURE layout arithmetic for the FULL-SCREEN TUI. The component used to compute
2
+ // the panel height and the caret row separately; when the panel already fills
3
+ // the terminal the two disagreed by a row and the caret landed BELOW the input
4
+ // box. One function now owns the numbers, so the reserved rows and the caret
5
+ // can never drift apart.
6
+ import { inputBoxRows } from '../input/layout.js';
7
+ /** Rows of the fixed header: the title row + the divider. */
8
+ export const HEADER_ROWS = 2;
9
+ /** Rows of the status bar above the input box. */
10
+ export const STATUS_ROWS = 1;
11
+ /** Rows of the key hint UNDER the input box. */
12
+ export const HINT_ROWS = 1;
13
+ export function fullScreenLayout(input) {
14
+ const termRows = Math.max(1, Math.floor(input.termRows) || 24);
15
+ const cols = Math.max(1, Math.floor(input.cols) || 80);
16
+ const box = inputBoxRows(input.prompt, input.buf, input.cursor, cols);
17
+ const suggestRows = Math.max(0, Math.floor(input.suggestRows) || 0);
18
+ const panelRows = HEADER_ROWS + STATUS_ROWS + box + suggestRows + HINT_ROWS;
19
+ const logHeight = Math.max(1, termRows - panelRows);
20
+ // The caret counts the SAME viewport the reservation uses.
21
+ const cursorTop = HEADER_ROWS + logHeight + suggestRows + STATUS_ROWS + 1;
22
+ return {
23
+ headerRows: HEADER_ROWS,
24
+ statusRows: STATUS_ROWS,
25
+ hintRows: HINT_ROWS,
26
+ inputBoxRows: box,
27
+ suggestRows,
28
+ panelRows,
29
+ logHeight,
30
+ cursorTop,
31
+ };
32
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.82.134",
3
+ "version": "2.82.135",
4
4
  "description": "Terminal coding agent that drives a real browser to chat with DeepSeek, Qwen and other web LLMs — no API key required. Reads and edits files, runs commands, commits to git, like Claude Code / Codex CLI.",
5
5
  "type": "module",
6
6
  "bin": {