Skip to content

Fix reaction count fg lost after kitty image placement - #134

Merged
gammons merged 2 commits into
gammons:mainfrom
achin90:fix/reaction-pill-fg-reset
Aug 11, 2026
Merged

gammons merged 2 commits into
gammons:mainfrom
achin90:fix/reaction-pill-fg-reset

Conversation

@achin90

@achin90 achin90 commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #133

The kitty unicode-placeholder encodes the image ID in the fg color and resets with \e[39m afterward, which wipes the pill style's foreground before the count digit prints. This re-asserts the style's fg between the placement and the count so the own-reaction green (and other pill colors) survive the image path.

Applied in both internal/ui/messages/model.go and internal/ui/thread/model.go (thread pane has its own copy of the pill loop).

Tested on ghostty (macOS, slk 0.13.1) — reaction counts render green again with emoji_images = "on".

image

The kitty unicode-placeholder placement encodes the image ID in the
fg color and resets with \e[39m afterward, which wipes the pill
style's foreground before the count digit prints. Re-assert the
style's fg between the placement and the count so the own-reaction
green (and other pill colors) survive the image path.

Fixes gammons#133

@gammons gammons left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks @achin90 — the fix looks correct and the diagnosis (kitty placement's \e[39m wiping the pill fg) matches the code. The CI failure is an unrelated flake in internal/slack/membership, so a re-run should go green.

One request before merging: could you add a test covering this? The pill render loops in internal/ui/messages already have test infrastructure, and this is exactly the kind of regression that will silently come back. A test with a stubbed fetcher/placement asserting the count keeps the pill fg would do it.

Nit: the two copies diverge slightly (strconv.Itoa in messages vs fmt.Sprintf in thread) — keeping them identical helps since the loops are duplicated.

@achin90

achin90 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review @gammons!

Had a lot of fun hacking on the project over the weekend... ended up with a stack of 14 changes to daily drive it at work today 😄

@gammons

gammons commented Aug 11, 2026

Copy link
Copy Markdown
Owner

thanks @achin90 !

@gammons
gammons merged commit cdc6eb1 into gammons:main Aug 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Own-reaction green styling lost on reaction counts when emoji_images is on (kitty/ghostty)

2 participants