Skip to content

Resolve terminal image numbers and delete placements at their current cells - #1019

Merged
Kuddev merged 12 commits into
mainfrom
review/graphics-controls-819-20261117
Nov 17, 2026
Merged

Kuddev merged 12 commits into
mainfrom
review/graphics-controls-819-20261117

Conversation

@Kuddev

@Kuddev Kuddev commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Readers address pages by image number and delete placements by the cells they currently occupy. This second part of #819, stacked on #1018, assigns a separate ID per numbered upload, selects the newest retained image with that number, and looks up one-based cell coordinates in the active grid after scrolling or reflow. Referring to a missing placement does not release the image. Capability replies report non-default supported values for the requested action. Signed placement layers are accepted in the existing paint order; independent z ordering is not advertised.

Current source 53b8f42b is stacked on #1018 (ba265c10). The stack includes the foreground fixture repair with unchanged production code; its native ARM regression passed seven cases three times and detected loss of foreground ownership.

The previous product source 5a9abe1f passed all five native platforms and a real PTY/window check: each color occupied 7,832 pixels while visible and zero after deletion, and a resized 94×24-cell grid reported 846×456 pixels at 9×19 pixels per cell. Original #819 ancestry and author attribution are preserved.

Current-source native PTY and window acceptance passed: 395 core (two ignored), 12 grid and 25 decoder tests. The two visible test colors each occupied 7,832 pixels and disappeared after deletion. Resizing to 94×24 cells at 9×19 pixels per cell returned 846×456 pixels. Five-platform CI is pending.

glitch-cmyk658 and others added 9 commits October 30, 2026 20:56
…hed, and repaint once more

Three app-side fixes on top of the merged graphics support:

- The text-area answer used the geometry captured at spawn, so a reader that
  divides it by the cell size laid pages out for a pane that no longer existed.
  Answer from the grid the session is rendering.
- A full-page reader keeps several pages decoded around the cursor; 16 images /
  128 MiB let the visible page be evicted without a way to come back.
- A decode that finishes between frames could leave the texture unpresented
  until the next input event, which is why the page needed a click. Request one
  more frame shortly after the decode completes.
A page reader sends `...,C=1,z=-1,q=1` on every page transfer. `z` only
carries meaning together with `o=z`, and `-1` is a signed value the other
numeric keys never are, so the whole control was rejected with ENOTSUP and
the page was never stored — the reader showed an empty page area.

The payload is still checked against the declared pixel size when it is
decoded, so ignoring the key removes a false rejection without accepting
malformed transfers.
A reader that only knows the graphics protocol sends a container, asks for
the features a terminal supports first, and deletes what it placed by cell
rather than by id. Each of those used to be refused or silently dropped.

- Accept `f=100` containers. The terminal keeps the file and reads the size
  from its `IHDR` header, so a page no longer has to travel as raw pixels;
  the frontend inflates it on the decode thread.
- Answer `a=q,e=<action>` probes with the keys this terminal honours instead
  of rejecting the marker, so a client can downgrade before it sends.
- Decode payloads without canonical padding and ignore whitespace inside
  them, which scripts and newline-wrapped writers produce.
- Support `d=p`, `d=c`, `d=x`, `d=y`, `d=r` and `d=n` deletes, keeping every
  other placement alive.
- Raise the encoded staging budget to 64 MiB: a 4K page is 33 MiB of base64
  while it streams, and the previous 24 MiB refused it mid-transfer.

Tests: the graphics unit tests gain twelve cases covering the container
header, the feature answers, unpadded payloads and each delete selector.
The reader path has been walked end to end several times now, but only
through one document: a bug in crop handling, chunk joining or a delete
selector shows up as a blank page and gets diagnosed by eye. This turns the
protocol surface into seventeen cases that assert on placements and cells
read back from the grid, so a regression fails a test instead of a page.

Each case drives the real byte stream through the stream processor and then
looks at the terminal: source rectangle, cell budget, channel count, crop
window, delete selectors, capability replies, payload tolerance and the
pixel budget. The container case builds its own PNG with a stored deflate
block, so it needs no fixture file and no extra dependency.
the intel runner timed out signing in a powershell pointer fixture,
which turned the two reporting jobs red. nothing in this commit changes
the tree; it only asks the matrix for one more attempt.
@github-actions github-actions Bot added the size/L 501–1500 行 label Nov 17, 2026
Keep the existing completion notification for idle repaint: the native window check on the transfer implementation displayed and erased the page without a delayed second notification.
@Kuddev
Kuddev changed the base branch from review/png-transport-819-20261117 to main November 17, 2026 12:38
@Kuddev
Kuddev marked this pull request as ready for review November 17, 2026 12:38
@Kuddev
Kuddev merged commit 53b8f42 into main Nov 17, 2026
29 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L 501–1500 行

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants