Refuse tiny terminals; scroll the confirm view; explain and recover from failures #12

Merged
cyplo merged 1 commit from tui-hardening into main 2026-11-24 20:23:31 +00:00
Owner

Finishing the work two agent sessions left pending, in one batch because
the fixes share the files they touch.

A terminal smaller than 72 columns or 8 rows is now refused, at start or
after a resize: nothing is drawn, the terminal is restored, the size it
got and the size it needs are printed, and the app exits with status 1.
Nothing pending is applied. 72 columns is where every fixed line is
whole - the longest, the list status hint, is 71 - so no key is ever
shown cut in half; at 40 columns the choices line already loses 3: Do nothing. Eight rows is what the confirm view needs for one change. The
thumbnail width math now runs through copy count instead of a narrow
terminal: 24 versions at 72 columns get three columns each - gutter,
pixel, gutter - 25 drop the block and show metadata only.

The confirm view crashed in an ordinary 80x24 terminal once 19 or more
changes were pending. When the changes do not all fit, j/k, the arrows
and Page Up/Down now scroll them; the warning says which are on screen
(4-6 of 7) and the help bar gains j/k: scroll. Reopening the view
starts at the first change again.

A change whose files cannot be written - a read-only original - used to
come back with nothing selected and no message. It now stays listed with
the reason on its rows: Could not apply: Permission denied (os error 13), so a failure never passes silently.

An I/O error mid-run used to exit without leaving raw mode or the
alternate screen, breaking the user's terminal. Terminal restore now
runs however the run ends. A new pty test yanks the terminal the app
draws to away mid-run and checks the keyboard terminal comes back in
cooked mode.

Fixtures can set file permissions ([setup] permissions), the dev shell
gains cargo-llvm-cov (with rustc's own LLVM) for the line-coverage
workflow in CLAUDE.md, and every line a user can reach now runs in some
test.

Verified: 108 tests, clippy and statix clean, nix flake check and nix build green, no missed mutants on the changed lines (45 caught, 7
unviable), line coverage 99.84% - only scanner.rs:108, a branch that
cannot happen, is unrun.

Co-Authored-By: MiMo 2.6 Pro noreply@anthropic.com

Finishing the work two agent sessions left pending, in one batch because the fixes share the files they touch. A terminal smaller than 72 columns or 8 rows is now refused, at start or after a resize: nothing is drawn, the terminal is restored, the size it got and the size it needs are printed, and the app exits with status 1. Nothing pending is applied. 72 columns is where every fixed line is whole - the longest, the list status hint, is 71 - so no key is ever shown cut in half; at 40 columns the choices line already loses `3: Do nothing`. Eight rows is what the confirm view needs for one change. The thumbnail width math now runs through copy count instead of a narrow terminal: 24 versions at 72 columns get three columns each - gutter, pixel, gutter - 25 drop the block and show metadata only. The confirm view crashed in an ordinary 80x24 terminal once 19 or more changes were pending. When the changes do not all fit, j/k, the arrows and Page Up/Down now scroll them; the warning says which are on screen (`4-6 of 7`) and the help bar gains `j/k: scroll`. Reopening the view starts at the first change again. A change whose files cannot be written - a read-only original - used to come back with nothing selected and no message. It now stays listed with the reason on its rows: `Could not apply: Permission denied (os error 13)`, so a failure never passes silently. An I/O error mid-run used to exit without leaving raw mode or the alternate screen, breaking the user's terminal. Terminal restore now runs however the run ends. A new pty test yanks the terminal the app draws to away mid-run and checks the keyboard terminal comes back in cooked mode. Fixtures can set file permissions (`[setup] permissions`), the dev shell gains cargo-llvm-cov (with rustc's own LLVM) for the line-coverage workflow in CLAUDE.md, and every line a user can reach now runs in some test. Verified: 108 tests, clippy and statix clean, `nix flake check` and `nix build` green, no missed mutants on the changed lines (45 caught, 7 unviable), line coverage 99.84% - only scanner.rs:108, a branch that cannot happen, is unrun. Co-Authored-By: MiMo 2.6 Pro <noreply@anthropic.com>
Refuse tiny terminals; scroll the confirm view; explain and recover from failures
Some checks failed
CI / Lint (pull_request) Successful in 1m50s
CI / Run tests (pull_request) Successful in 1m55s
CI / Mutation testing (pull_request) Successful in 3m44s
CI / Nix checks and package build (pull_request) Successful in 4m30s
CI / Nix checks and package build (push) Successful in 14s
CI / Lint (push) Successful in 30s
CI / Run tests (push) Successful in 37s
CI / Mutation testing (push) Failing after 13m6s
e9a0dd251a
Finishing the work two agent sessions left pending, in one batch because
the fixes share the files they touch.

A terminal smaller than 72 columns or 8 rows is now refused, at start or
after a resize: nothing is drawn, the terminal is restored, the size it
got and the size it needs are printed, and the app exits with status 1.
Nothing pending is applied. 72 columns is where every fixed line is
whole - the longest, the list status hint, is 71 - so no key is ever
shown cut in half; at 40 columns the choices line already loses `3: Do
nothing`. Eight rows is what the confirm view needs for one change. The
thumbnail width math now runs through copy count instead of a narrow
terminal: 24 versions at 72 columns get three columns each - gutter,
pixel, gutter - 25 drop the block and show metadata only.

The confirm view crashed in an ordinary 80x24 terminal once 19 or more
changes were pending. When the changes do not all fit, j/k, the arrows
and Page Up/Down now scroll them; the warning says which are on screen
(`4-6 of 7`) and the help bar gains `j/k: scroll`. Reopening the view
starts at the first change again.

A change whose files cannot be written - a read-only original - used to
come back with nothing selected and no message. It now stays listed with
the reason on its rows: `Could not apply: Permission denied (os error
13)`, so a failure never passes silently.

An I/O error mid-run used to exit without leaving raw mode or the
alternate screen, breaking the user's terminal. Terminal restore now
runs however the run ends. A new pty test yanks the terminal the app
draws to away mid-run and checks the keyboard terminal comes back in
cooked mode.

Fixtures can set file permissions (`[setup] permissions`), the dev shell
gains cargo-llvm-cov (with rustc's own LLVM) for the line-coverage
workflow in CLAUDE.md, and every line a user can reach now runs in some
test.

Verified: 108 tests, clippy and statix clean, `nix flake check` and `nix
build` green, no missed mutants on the changed lines (45 caught, 7
unviable), line coverage 99.84% - only scanner.rs:108, a branch that
cannot happen, is unrun.

Co-Authored-By: MiMo 2.6 Pro <noreply@anthropic.com>
cyplo merged commit e9a0dd251a into main 2026-11-24 20:23:31 +00:00
cyplo deleted branch tui-hardening 2026-11-24 20:23:31 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cyplo/deescalate!12
No description provided.