Commit Graph

2 Commits

Author SHA1 Message Date
metaphorics a95be2860f fix(tui): honest editor-height floor and dead-branch cleanup
Addresses Copilot + Codex review on #2521:

- computeEditorMaxHeight returned 1 on terminals too small to host both the
  editor and the chrome reserve, but the bordered editor never renders fewer
  than 3 rows (2 border + 1 content). The cap now floors at that real minimum
  (EDITOR_MIN_RENDERED_ROWS) so it no longer misreports the rows the editor
  occupies; rendering is unchanged, and the contract is documented honestly
  (reserve holds once terminalRows >= 7).
- #resolveOverlayLayout now always resolves maxHeight (?? availHeight), so the
  maxHeight !== undefined branch in effectiveHeight, the composite slice guard,
  and the number | undefined return type were dead. Tightened all three.
- Mirrored the maxHeight-default contract in the render stress oracle
  (resolveExpectedOverlayLayout + compositeExpectedOverlays) so the randomized
  sweep validates the real clipped geometry instead of the obsolete unclipped
  one; updated the oracle helper test expectation accordingly.

Editor-height tests rewritten to assert the real contract (reserve when the
terminal can host both; pinned to the bordered minimum below that).
2026-06-14 08:40:12 +09:00
metaphorics b28ad9a1dc fix(tui): clamp editor height and overlays on small terminals
Two bounded TUI overlap fixes:

- Editor max-height (coding-agent): the [6,18] clamp's floor of 6 exceeded
  available space on terminals <=18 rows, letting the editor crowd the
  transcript/status. Extracted a pure computeEditorMaxHeight(rows) with an
  EDITOR_MIN_CHROME_ROWS=4 upper bound; identical for rows >=18.
- Overlay overflow (tui): #resolveOverlayLayout left maxHeight undefined when
  the option was unset, so a tall overlay's bottom rows were dropped
  off-screen. maxHeight now defaults to availHeight so every overlay is
  sliced to fit and re-clamps on resize.
2026-06-14 06:59:58 +09:00