fix(ui): paint annotation input with the annotation color - #345
Open
umputun wants to merge 1 commit into
Open
Conversation
the input style was built from color-normal on color-diff-bg, the same two fields with the same conditionals as the context-line style, so text being typed rendered byte-identical to the diff lines around it. StyleKeyAnnotInputText now resolves to color-annotation. the cursor key aliases that same style so it follows; the placeholder stays on color-muted. no italic is applied, which is what still separates the live input from a saved annotation. contrast against the diff background drops in catppuccin-latte (7.06 to 2.31) and solarized-dark (4.75 to 3.26), matching what saved annotations already render at in those two themes. their palettes are left canonical. Related to #343
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, directly addresses the reported rendering issue, and is covered by targeted unit tests that would fail if the resolver regressed.
Pull request overview
This PR fixes the “annotation text while typing blends into context lines” issue by changing the resolver so the live annotation input text (and cursor) uses the theme’s annotation foreground color rather than the normal/context foreground, while keeping the placeholder muted and leaving italic reserved for saved annotations.
Changes:
- Resolve
StyleKeyAnnotInputText(and cursor) tocolor-annotationinstead ofcolor-normal. - Add focused resolver tests to pin the annotation-input style behavior (fg, bg, cursor aliasing, placeholder muting, non-italic, and no-
DiffBgpath). - Remove outdated annotation-input commentary in
annotate.gothat no longer matches the resolver behavior.
File summaries
| File | Description |
|---|---|
| app/ui/style/resolver.go | Switches annotation input text/cursor foreground from Normal to Annotation while preserving DiffBg background behavior. |
| app/ui/style/resolver_test.go | Adds dedicated subtests ensuring annotation input styles resolve distinctly from context lines and match expected fg/bg/italic behavior. |
| app/ui/annotate.go | Removes comments that described the previous “Normal fg” behavior for the live input style. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: 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.
annotation input text now uses the annotation colour instead of blending into context lines.
StyleKeyAnnotInputTextandcontextStyleboth resolved tocolor-normaloncolor-diff-bgfor every valid theme. The two styles emitted the same ANSI bytes for the same text.StyleKeyAnnotInputTextnow usescolor-annotation, already documented as "annotation text and markers". The cursor aliases that style. The placeholder remains muted, and saved annotations remain distinct because onlyAnnotationInlineadds italic.trade-off
this lowers text/background contrast in two bundled themes: catppuccin-latte from 7.06 to 2.31 and solarized-dark from 4.75 to 3.26. Saved annotations already use those ratios.
both palette colours remain canonical. Of Latte's 14 official accent colours, only Red (4.80) and Mauve (4.79) clear AA on
#eff1f5, and both already serve other roles in this theme.tests
added six resolver subtests covering text, cursor, placeholder, context-line separation, italic and the no-
DiffBgpath. Reverting the resolver line fails four of them.tested with
make testandmake lint.Fixes #343