matiasandina / matiasandina/uid_python_api

Preflight terminal size gating does not trigger resize warning

Open
#10 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Problem

The preflight UI no longer shows the "terminal too small" warning panel when the terminal window is too narrow for the rendered content. The UI renders with broken layout / wrapping instead of blocking and asking the operator to resize.

Where the check lives

  • _terminal_size_ok() at preflight_ui.py:622 checks against MIN_UI_WIDTH = 132 and MIN_UI_HEIGHT = 34
  • _wait_for_terminal_size() at preflight_ui.py:632 shows the resize panel in a loop until the terminal is large enough
  • Called from _arrow_select() at preflight_ui.py:1400 on every menu render cycle

Likely causes to investigate

  1. The fixed thresholds (MIN_UI_WIDTH = 132) may no longer match the actual rendered width of the preflight dashboard content, especially after recent UI changes added wider rows (session summary sections, launch contract, stim config view).
  2. The check only runs inside _arrow_select — if the arrow select path is skipped (e.g., _supports_arrow_select() returns false), the numbered-menu fallback has no size check at all.
  3. Rich may be auto-wrapping content to fit the terminal width, so the check passes but the layout breaks silently.

Expected behavior

When the terminal is too narrow for the preflight UI content, the resize warning panel should appear and block until the operator enlarges the window.

Observed on

Windows, native cmd.exe. Noticed 2026-04-15 after recent preflight UI changes.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in preflight_ui.py at _terminal_size_ok() and _wait_for_terminal_size(), then trace both the _arrow_select() path and the numbered-menu fallback. Compare the thresholds with the rendered preflight content and check whether Rich wrapping or skipped gating explains the behavior. Done means an undersized Windows cmd.exe terminal shows the resize warning and blocks until it is enlarged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.