Skip to content

terminal: whole-area selection (client-rendered), no graying - #181

Merged
ccclosed merged 1 commit into
devfrom
feat/lxrun-selection-area
Nov 22, 2026
Merged

ccclosed merged 1 commit into
devfrom
feat/lxrun-selection-area

Conversation

@ccclosed

Copy link
Copy Markdown
Owner

terminal (client-rendered): whole-area selection, no graying / logo erasure

Companion to the kernel-session selection wash (separate PR). This fixes the client-rendered terminal path (demo / pipe-shell / headless snapshot); the default kernel-session blit path is fixed kernel-side.

Verified first

render.rs::resolve_style() already washes background only (bg.lerp(theme.selection, SELECTION_BG_MIX)), no selection_fg write path remains — the graying half was already fixed in dev. The remaining defect was selection geometry.

Change

  • SelectionMode::Area — row-granular: every picked row selected across its full width (Char mode clips first/last rows at press/release columns, wrong for a fastfetch-shaped block).
  • Screen::select_all_view() — one-shot whole visible output area.
  • Screen::drag_covers_whole_view() + promote_selection_to_area() — a drag spanning every visible row promotes to Area (columns ignored, works upward too); a drag inside a few rows keeps Char granularity.
  • Live Motion handler promotes after each extend; CLI --select all for headless/evidence frames.

Tests / gates

cargo test --package pagh-terminal (inside crate): 196 passed / 0 failed. New: area keeps full rows, select_all covers whole area, whole-view drag promotes both directions, whole-area keeps every glyph colour, render_png wash oracle over whole grid, selection_live real compositor+client drag. cargo fmt --check clean.

Evidence

  • lxrun-select-evidence.png / -before.png — fastfetch logo + coloured keys/values, whole-area wash, glyph colours intact.
  • lxrun-select-evidence-live.png / -live-before.png — live compositor 1280×800 whole-window drag.
  • Pixel audit: 358 530 bg pixels washed, 3 888 non-bg pixels byte-identical (6 colours) — no graying.
    (Untracked artifacts.)

Selecting lxrun's fastfetch output was ragged: `SelectionMode::Char` clips
the first row at the press column and the last row at the release column, so
a whole-window drag dropped the logo's left columns and the palette strip's
right columns.  The renderer already washes only the background (there is no
`selection_fg` path left — `resolve_style` lerps `bg` and leaves `fg`
byte-identical), so the remaining defect is the selection geometry, not the
paint.

Add `SelectionMode::Area`: row-granular selection where every picked row is
taken across its full width.  `Screen::select_all_view()` selects the whole
visible output area in one call (`pagh-terminal --select all`), and a live
drag that touches both the first and the last visible row is promoted to it
(`promote_selection_to_area`), snapping the anchor to column 0 and the focus
to the last column.  A drag that stays inside the view keeps character
granularity, so ordinary word/paragraph selection is unchanged.

Regression tests: area geometry and promotion (both drag directions), a
renderer test over a fastfetch-shaped block asserting every background is
washed while every glyph colour stays byte-identical, a wash-oracle test on
the real fastfetch fixture across the whole 100x30 grid, and a live
compositor drag from the first to the last cell asserting the whole area is
washed (including the blank rows under the output) and that at least three
glyph colours survive — the "graying" regression.
@ccclosed
ccclosed merged commit b279c3b into dev Nov 22, 2026
8 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