Skip to content

Truecolor badge fix, dist-upgrade, mouse bounds, and confirm dialog wrapping - #3

Merged
padovanl merged 2 commits into
mainfrom
develop
Aug 14, 2026
Merged

Truecolor badge fix, dist-upgrade, mouse bounds, and confirm dialog wrapping#3
padovanl merged 2 commits into
mainfrom
develop

Conversation

@padovanl

Copy link
Copy Markdown
Owner

Summary

  • Badge text (active tab, header, key hints, warning banner, selected row) now uses explicit truecolor hex (#000000/#FFFFFF) instead of ANSI codes 0/15, which some terminal color schemes (e.g. Windows Terminal/WSL2) redefine — the badge text was rendering as a muddy gray instead of true black/white.
  • apt's "upgrade all" now runs apt-get dist-upgrade instead of plain apt-get upgrade, which silently leaves behind any package needing a new/removed dependency instead of upgrading it — previously needed two runs to fully finish.
  • Mouse clicks now check the click landed inside the list's actual rendered height, not just below the header — a click on the footer bar (or anywhere below a short list) no longer jumps the selection to an unrelated row.
  • ctrl+l forces a full screen redraw (same convention as vim/bash/htop/tmux) — a manual recovery option for any terminal-side rendering glitch.
  • Fixed the "upgrade all" confirmation dialog overflowing past the terminal border when the package list is long (wraps now, but only when actually needed — short confirms stay compact).

Test plan

  • gofmt -l . clean
  • go vet ./... clean
  • go test ./... passing
  • go test -tags e2e ./e2e/... passing
  • go build ./... clean

openUpgradeAllConfirm joins every upgradable package name into one
unbroken comma-separated line, and modalStyle has no width of its own
-- without wrapping that line first, it ran straight past the box
border and off the edge of the terminal instead of wrapping inside it
(harmless for install/remove confirms, which are always one short
package name, so this never showed up there).

Now wraps to min(76, terminal width - 8) columns, but only when the
content actually needs it: the common single-package confirm stays at
its natural compact size instead of every dialog getting padded out to
the wrap width regardless of how short it is.

Added a regression test constructing a 60-package label directly (real
apt state only had 2 upgradable packages in this environment, nowhere
near enough to reproduce the overflow) and asserting no rendered line
exceeds the terminal width, plus a check that a short confirm's box
stays compact rather than also being stretched to the wrap cap.
- Badge text (active tab, header, key hints, warning banner, selected
  row) now uses explicit truecolor hex (#000000/#FFFFFF) instead of
  ANSI codes 0/15. Reported live: badge text rendering as a muddy gray
  on Windows Terminal/WSL2 -- that terminal's own color scheme had
  redefined what "black"/"white" (ANSI 0/15) mean, which a bare ANSI
  index can never protect against no matter which of the two is picked;
  a truecolor hex value bypasses that palette entirely and still
  degrades gracefully via termenv on a genuinely limited terminal.

- apt's "upgrade all" now runs `apt-get dist-upgrade` instead of plain
  `apt-get upgrade`. Reported live: upgrading needed two separate runs
  to finish -- plain upgrade silently leaves behind any package whose
  new version needs a dependency installed or removed, rather than
  erroring, so the first run's upgrades were freeing up whatever had
  been blocking the rest, which only went through on an identical
  second run. dist-upgrade resolves those dependency changes in the
  same transaction.

- Mouse clicks now check the click landed inside the list's actual
  rendered height, not just below the header: previously, a click
  anywhere on screen (including the footer key-hints bar) still mapped
  to *some* row index arithmetically, and on a long enough list that
  index was a genuinely valid item -- so clicking the footer looked
  like it randomly jumped the selection to an unrelated row, reported
  live as mouse clicks "changing pages" with no apparent logic.

- ctrl+l now forces a full screen redraw (tea.ClearScreen), the same
  convention vim/bash/htop/tmux use. Mitigates -- doesn't fix, since
  e2e/settings_test.go already proved pkgtui's own byte output is
  correct -- reports of a stale settings-screen value that a specific
  terminal's own repaint logic apparently left behind. Deliberately did
  *not* add this to the in-app help screen: that screen isn't
  height-aware, and e2e/navigation_test.go caught the extra row pushing
  its title off the top of a 100x34 terminal -- documented in code as a
  real, separate, pre-existing issue instead of band-aiding it in.

All four reported live, on the same WSL2 + Windows Terminal setup.
@padovanl
padovanl merged commit e55ced7 into main Aug 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant