Repository navigation
Fix inconsistent Kitty image expansion - #24
Merged
Merged
Conversation
There was a problem hiding this comment.
🔵 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
go test -race -timeout 10m ./...andgo vet ./...pass.A visual check in a live Ghostty session remains outstanding; automated tests validate the protocol output and rendered cell metadata.