Skip to content

Fix inconsistent Kitty image expansion - #24

Merged
merefield merged 1 commit into
masterfrom
fix/kitty-image-placement
Oct 11, 2026
Merged

merefield merged 1 commit into
masterfrom
fix/kitty-image-placement

Conversation

@merefield

Copy link
Copy Markdown
Owner

Repeatedly expanding the same image in a topic could render it at thumbnail dimensions because implicit Kitty virtual placements leave placeholder selection ambiguous. This change reuses an explicit placement ID for each image and encodes that ID in placeholder underline colors, so expanding, collapsing, and resizing select the current geometry consistently. Placement acknowledgements are matched to both the image and placement IDs.

Regression coverage exercises repeated thumbnail/expanded/resize transitions for multiple images and inspects the rendered screen cells to verify placement selection, preserved aspect ratio, and style reset boundaries. This applies to the Kitty graphics path across compatible terminals.

Validation:

  • Regression test fails against the previous implementation and passes with the fix.
  • go test -race -timeout 10m ./... and go vet ./... pass.
  • All six supported platform/architecture builds pass.
  • Go vulnerability scan reports no reachable vulnerabilities.

A visual check in a live Ghostty session remains outstanding; automated tests validate the protocol output and rendered cell metadata.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

A live Ghostty visual check remains outstanding despite passing automated validation.

0 open findings

What changed in this PR

Fixes inconsistent Kitty image geometry by using stable virtual placement IDs across repeated expansion, collapse, and resize operations.

Changes:

  • Adds explicit Kitty placement identifiers.
  • Matches placeholders and acknowledgements to image placements.
  • Adds regression coverage for geometry and rendering transitions.
File Description
internal/​ui/​ui_test.go Updates protocol encoding expectations.
internal/​ui/​images.go Implements explicit Kitty placement selection.
internal/​ui/​images_test.go Adds placement and rendering regression tests.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@merefield
merefield merged commit ced57ff into master Oct 11, 2026
5 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.

2 participants