Repository navigation
Description
Priority: P1 | Area: render | Labels: feat,P1,area:render | Milestone: v0.2.0 | RFC: none | Task: none
Owner report: a Neovim Markdown preview that renders diagrams as inline images shows a blank floating window in Bitty, while Ghostty paints the diagram. The plugin is the kitty-graphics path (image.nvim-style: the plugin opens a floating window and transmits an image with APC G).
State of the code today:
bitty-vtparsesAPC Gandbitty-term-statestores images, placements and animation frames (state.rs::kitty_graphics,placement.rs), including virtual prototypes anda=qhandling.- The comment at
crates/bitty-term-state/src/state.rs:2103states the gap explicitly: "Unknown actions stay stored-not-painted downstream". crates/bitty-renderhas no image paint path: no texture upload, no placement compositing; the cells stay empty (or a placeholder is drawn).- The runtime still answers
a=qqueries, so a plugin is told images are supported and commits to the blank rendering instead of falling back to a text backend.
Consequence: every kitty-graphics consumer (Neovim image plugins, chafa/viu in kitty mode, yazi previews, kitten icat-style tools) shows an empty rectangle, and the floating overlay that hosts the image leaves the surrounding UI looking broken.
Scope:
- Decode the transmitted payloads the protocol already accepts (
f=24/f=32raw RGBA/RGB,f=100PNG, chunkedm=1continuations), with the existing bounds (max image bytes, dimensions) and fail-closed behaviour. - Upload each decoded image once into a texture cache keyed by image id + frame, evict on
a=d/delete-all/scrollback drop and under memory pressure. - Composite placements (
a=p,a=T, virtualU=1spans,z=layering,X=/Y=pixel offsets, source rectsx/y/w/h) in the present pass, above/below text according toz, clipped to the viewport and to the pane bounds. - Honour
q=reply suppression and answera=qwith the truth: either full support, or report the unsupported action so plugins fall back. - Animation:
a=a/a=cframes at the smallest useful cadence, no unbounded queue. - A11y/scene contract: an image cell must keep a text fallback (placeholder character) for screen readers and for
bitty ctl terminal text.
Acceptance: replaying a recorded image.nvim session produces the same visible diagram in Bitty as in Ghostty at the same pane size; deleting the window frees the texture; a terminal without GPU still shows the documented placeholder rather than a blank hole.
Activity
Xuepoo commentedon Nov 4, 2026
Status (guard tick 2026-11-04): PR #2881 merged (squash
52b83a6f, CTX-1689) after an independent guard review and a fully green gate (17 pass / 0 fail / 0 pending, incl. Windows, MSRV 1.85, M1 + compat aggregates). Delivered:a=ppaints a stored image through the rich pixel layer (withp=replace semantics anda=d,d=iclearing), below-text layering viaImagePaintLayer(z<0→ under glyphs, above cell backgrounds) in software, headless GPU and real-GPU paths, andU+FFFCfallback text forU+10EEEEimage cells so a11y/AI snapshots stay readable.Deliberately deferred and still open on this issue:
a=a/a=canimation playback re-verification, relativea=p(P=/Q=) painting (no parent-anchor model in the rich layer yet), and the recordedimage.nvim/Ghostty parity replay, which needs a real compositor this headless environment cannot run.[CTX-1705] feat(render): truthful kitty a=q PNG probes and image-cell…
Xuepoo commentedon Nov 5, 2026
Status (guard tick 2026-11-05): PR #2894 merged (squash
2f1be92a, CTX-1705) after an independent review (VERDICT: APPROVE, 9 checks, failure-sensitivity proven by three local reverts) and a fully green gate (17 pass / 0 fail / 3 skipped, incl. Windows, MSRV 1.85, M1 + compat aggregates).Delivered in #2894:
a=qtruthfulness for PNG: a probe now runs the decoder's own payload gate (precheck_png_payload,crates/bitty-rich/src/kitty_decode.rs:395, called fromcrates/bitty-runtime/src/runtime/kitty_images.rs:2226), so an oversized/invalidIHDRprobe answers a refusal instead of;OKfollowed by a refused transmit. Rawf=24/f=32probes were already truthful.a=p/a=Town no grid cell, sobitty ctl terminal textand the devtools grid snapshot returned an empty grid.ImageCellSpan+grid_text_from_snapshot_with_images(crates/bitty-runtime/src/inspect.rs:391,418) withRuntime::kitty_image_cell_spans_for_view/_for_primary(kitty_images.rs:1953,1984) now emitU+FFFCfor covered blank cells only; text under an image is preserved (ctl/apply.rs,runtime.rs:2770).KITTY_ANIM_MAX_FRAMES=256, 33 ms quantum floor,MAX_STEPS_PER_TICK=4, leftover dropped —crates/bitty-term-state/src/placement.rs:96,112,122,463); the gap was coverage, now pinned by a test that a tick changes presented pixels and wraps back to frame 1.Still open against this issue (unchanged by #2894):
crates/bitty-runtime/src/runtime/present.rs:6331+);image.nvimsession matching Ghostty at the same pane size — needs a real compositor/GPU session, not headless RGBA;scroll_offset/cursor_follow_window_start, PNG arm of the probe⇒paint contract split across two tests, minorcolumn_coveredrescan).Merged so far on this issue: #2881 (
a=ppaint + z layering +a=dclearing), #2893 (relativeP=/Q=placements), #2894 (this).[CTX-1706] fix(render): close the #2875 kitty-graphics review follow-…
Xuepoo commentedon Nov 7, 2026
New field evidence from the owner (Bitty 0.0.35), which splits this into two different failures:
1. Inline images do not paint at all.
neovimon~/Documents/skills/git-paper.mdwith an inline LaTeX renderer (image.nvim / snacks style): Ghostty paints the formula in place of the source; Bitty leaves the raw$$\Sigma = \{0,1\}^8$$text visible, i.e. the placement is received but nothing is drawn, so the concealed source is not covered.2. A floating-window image paints, but with the wrong geometry. Moving the cursor next to the formula opens the plugin's preview float: the formula does render there, but the image is positioned oddly and its content overflows the box instead of being scaled/clipped to the float's cell rect.
So the placement path is not uniformly dead: a placement inside an overlay/floating panel reaches the screen while a placement in the main grid does not. That is a useful bisect — the difference is likely which surface/view the blit is attached to (main-grid placements may be dropped before the image pass, or attached to a leaf whose retained list does not carry images), while the overlay path happens to work but ignores the destination rect for scaling.
Acceptance for this issue should therefore cover both: an inline placement paints over the cells it names, and a placement inside a floating panel is scaled/clipped to that panel's content rect.