Skip to content

fix(ui): paint annotation input with the annotation color - #345

Open
umputun wants to merge 1 commit into
masterfrom
annot-input-color
Open

fix(ui): paint annotation input with the annotation color#345
umputun wants to merge 1 commit into
masterfrom
annot-input-color

Conversation

@umputun

@umputun umputun commented Sep 1, 2026

Copy link
Copy Markdown
Owner

annotation input text now uses the annotation colour instead of blending into context lines.

StyleKeyAnnotInputText and contextStyle both resolved to color-normal on color-diff-bg for every valid theme. The two styles emitted the same ANSI bytes for the same text.

StyleKeyAnnotInputText now uses color-annotation, already documented as "annotation text and markers". The cursor aliases that style. The placeholder remains muted, and saved annotations remain distinct because only AnnotationInline adds 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-DiffBg path. Reverting the resolver line fails four of them.

tested with make test and make lint.

Fixes #343

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
Copilot AI lite review requested due to automatic review settings September 1, 2026 09:14

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.

🟢 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) to color-annotation instead of color-normal.
  • Add focused resolver tests to pin the annotation-input style behavior (fg, bg, cursor aliasing, placeholder muting, non-italic, and no-DiffBg path).
  • Remove outdated annotation-input commentary in annotate.go that 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants