Skip to content

fix(graphics): batch kitty image row lifecycle - #3166

Merged
ogulcancelik merged 3 commits into
masterfrom
fix/kitty-image-row-lifecycle
Aug 24, 2026
Merged

fix(graphics): batch kitty image row lifecycle#3166
ogulcancelik merged 3 commits into
masterfrom
fix/kitty-image-row-lifecycle

Conversation

@ogulcancelik

Copy link
Copy Markdown
Collaborator

Summary

Why

The recent graphics budget fix treated each placeholder row as a separate update. Yazi clears the old rows before its next preview arrives, so Herdr removed those rows across multiple frames and exposed black bands. The same split made cached redraws visibly slow in Snacks.

This restores image-level updates without removing the frame-size guard that motivated the original change.

Validation

  • reproduced and traced the row-by-row cleanup in Yazi, then verified the transition is immediate with this branch
  • added coverage for image upload, cached redraw, disappearance, replacement, transaction budgets, and unrelated-image isolation
  • just check
  • just bench-render-scale: 1 to 15 panes was 1.12x median for background workspaces and 1.19x for active panes

No changelog entry: this fixes an unreleased regression.

kataokatsuki and others added 3 commits August 23, 2026 21:20
A Unicode-placeholder image arrives as one placement per viewport row it
covers, and after 624dfd4 the budgeted encoder emitted one placement per
frame, so every redraw painted images one row per frame.
Keep pixel uploads and superseded-image deletes in a transaction of
their own: a placement joins the coalesced transaction only when its
image is uploaded and its source already maps to that image, and
nothing joins after an upload or a delete.
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a70e2d47-b7c7-4d6f-935a-792af5f5ca10

📥 Commits

Reviewing files that changed from the base of the PR and between d6dae88 and 386a3ed.

📒 Files selected for processing (1)
  • src/kitty_graphics.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Incremental graphics encoding now accepts placement coalescing. Same-image deletions and redisplays can share budgeted transactions. Uploads, unrelated images, and superseded-image cleanup remain isolated. Tests cover transaction limits, replacements, ordering, and continuation.

Changes

Incremental graphics coalescing

Layer / File(s) Summary
Encoding control and call-site wiring
src/kitty_graphics.rs
The incremental encoder accepts a coalescing control. Terminal updates enable it for budgeted encoding, while pane rendering and existing tests select non-coalescing behavior.
Budgeted placement coalescing
src/kitty_graphics.rs
The encoder groups compatible same-image placement deletions and redisplays when they fit the budget. Uploads, unrelated images, and superseded-image operations terminate the current transaction.
Coalescing behavior coverage
src/kitty_graphics.rs
Tests cover multi-row uploads, deletion, replacement, redisplay, budget limits, upload ordering, continuation, and superseded-image cleanup.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 386a3

This change restores image-level Kitty row lifecycle updates while retaining the frame-size guard, with validation and performance checks reported in the PR. No actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant TerminalGraphicsUpdate
  participant IncrementalEncoder
  participant ImageCache
  TerminalGraphicsUpdate->>IncrementalEncoder: encode budgeted update with coalesce_placements
  IncrementalEncoder->>ImageCache: check image cache and source binding
  ImageCache-->>IncrementalEncoder: classify upload or redisplay
  IncrementalEncoder-->>TerminalGraphicsUpdate: return budgeted graphics transactions
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the Kitty image row batching fix, its motivation, scope, and validation.
Title check ✅ Passed The title clearly identifies the primary change: batching the Kitty image row lifecycle.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/kitty-image-row-lifecycle

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 24, 2026
@ogulcancelik
ogulcancelik merged commit 7d56b4c into master Aug 24, 2026
7 checks passed
@kangal-bot kangal-bot removed the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 24, 2026
@ogulcancelik
ogulcancelik deleted the fix/kitty-image-row-lifecycle branch August 24, 2026 01:52
jerryfane added a commit to jerryfane/herdr that referenced this pull request Aug 24, 2026
* fix: match Windows Ctrl+digit keybindings (herdrdev#2913)

refs herdrdev#2910

* fix: sync powershell process working directory (herdrdev#2879)

* fix: reap ctrl-click url openers (herdrdev#2906)

* fix: reap ctrl-click url openers

refs herdrdev#2903

* fix: scope linux opener test import

refs herdrdev#2903

* test: isolate url opener regression

refs herdrdev#2903

---------

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix(docs): link agents to config reference data

* feat(website): plugin marketplace discovery shelves — trending and new arrivals

* fix(website): raise timeout on docs release integration test for slow builders

* fix: retry Windows installer activation after transient locks (herdrdev#2921)

refs herdrdev#2916

* fix: isolate hidden pane render cadence (herdrdev#2892)

refs herdrdev#2890

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix: preserve macOS IME commits in report-all mode (herdrdev#2947)

* feat: make Windows generally available

* docs: publish preview documentation

* docs: finalize 0.8.1 release notes

* release: v0.8.1

* fix(ci): publish v0.8.1 documentation

* fix: restore v0.8.0 as stable release

* fix(perf): eliminate redundant terminal wake work (herdrdev#2962)

* fix(perf): eliminate redundant terminal wake work

* fix(perf): harden release benchmark gate

* test(perf): strengthen performance guardrails

* fix(theme): keep active terminal row visible under cursor (herdrdev#2989)

refs herdrdev#2987

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix(cli): exit quietly when output pipes close (herdrdev#2996)

refs herdrdev#2994

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* docs: finalize 0.8.2 release notes

* release: v0.8.2

* docs: update website manifest for v0.8.2

* docs: publish preview documentation

* fix: strip ansi sequences from tab bar status (herdrdev#3003)

* fix: strip ansi sequences from tab bar status

refs herdrdev#3001

* docs: clarify tab bar escape sequence scope

refs herdrdev#3001

---------

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix(input): preserve mouse forwarding through handoff (herdrdev#3002)

refs herdrdev#3000

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix: honor mouse capture config in terminal attach (herdrdev#2995)

refs herdrdev#2992

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix: synchronize plugin pane pwd (herdrdev#2985)

* fix: synchronize plugin pane pwd

refs herdrdev#2984

* refactor: isolate plugin pwd platform policy

refs herdrdev#2984

* docs: fix changelog conflict resolution

---------

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
Co-authored-by: Can Celik <ogulcancelik@gmail.com>

* fix: add claude screen activity fallbacks

refs herdrdev#1630
refs herdrdev#2241

* fix(windows): detect cursor bundled node process (herdrdev#3034)

* fix(windows): detect cursor bundled node process

refs herdrdev#3032

* docs: clarify cursor detection scope

* fix(windows): constrain cursor runtime detection

refs herdrdev#3032

---------

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* ci: support immutable preview releases

* chore: remove akbash maintainer authority

* test: use native path in docs parity assertion (herdrdev#3043)

* chore: pin kennel maintainer identities

* chore: keep kennel authority private

* fix(graphics): isolate oversized kitty images (herdrdev#3035)

* fix(graphics): isolate oversized kitty images

refs herdrdev#3033

* fix(graphics): budget pane image cleanup

refs herdrdev#3033

---------

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix: preserve multiline paste in terminal attach (herdrdev#3056)

refs herdrdev#3054

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix: keep background Claude MCP tasks working (herdrdev#3094)

* fix: match generated characters in prefix bindings (herdrdev#3085)

refs herdrdev#3079

* fix: publish Claude MCP detection manifest

* docs: document macos keychain launch context

refs herdrdev#966

* fix: preserve focus after background worktree removal (herdrdev#3099)

* fix: copy selections before delayed mouse release (herdrdev#3102)

refs herdrdev#3100

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix: clear Windows Terminal identity in panes (herdrdev#3127)

* fix(windows): preserve non-us shifted text (herdrdev#3055)

* fix(windows): preserve non-us shifted text

refs herdrdev#3045

* fix(windows): retain shifted key repeat lifecycle

refs herdrdev#3045

* feat: add per-mode theme overrides (herdrdev#2324)

* feat: add per-mode theme overrides

allow [theme.custom.light] and [theme.custom.dark] blocks so custom
overrides can differ per resolved appearance when auto_switch flips.
precedence: theme defaults, then [theme.custom], then the block for
the active mode. configs without the new blocks resolve unchanged.

refs herdrdev#837

* docs: complete per-mode theme documentation

---------

Co-authored-by: Ogulcan Celik <ogulcancelik@gmail.com>

* fix(windows): add local cmd installer bootstrap (herdrdev#3133)

* fix(windows): add local cmd installer bootstrap

refs herdrdev#2751

* fix(windows): bound installer downloads

refs herdrdev#2751

* fix(api): start lifecycle subscriptions from live events (herdrdev#3134)

refs herdrdev#1270

* fix: keep omp panes working through scheduled continuations (herdrdev#3122)

refs herdrdev#2851

* fix: serve a google-eligible favicon

* fix(graphics): batch kitty image row lifecycle (herdrdev#3166)

* fix(graphics): coalesce terminal kitty placements

A Unicode-placeholder image arrives as one placement per viewport row it
covers, and after 624dfd4 the budgeted encoder emitted one placement per
frame, so every redraw painted images one row per frame.

* fix(graphics): coalesce only pure kitty re-displays

Keep pixel uploads and superseded-image deletes in a transaction of
their own: a placement joins the coalesced transaction only when its
image is uploaded and its source already maps to that image, and
nothing joins after an upload or a delete.

* fix(graphics): batch kitty image row lifecycle

---------

Co-authored-by: kataokatsuki <kataokatsuki@users.noreply.github.com>

---------

Co-authored-by: Can Celik <ogulcancelik@gmail.com>
Co-authored-by: JJ Liebig <jonathan.liebig@gmail.com>
Co-authored-by: akbash <akbash@herdr.dev>
Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
Co-authored-by: kangal-bot <285672167+kangal-bot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alex <a.neyman17@gmail.com>
Co-authored-by: caner-akca <94343893+caner-akca@users.noreply.github.com>
Co-authored-by: kataokatsuki <kataokatsuki@users.noreply.github.com>
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.

3 participants