Skip to content

test(ui): color-matrix for the home-screen render surface#256

Merged
saadqbal merged 1 commit into
developfrom
test/ui-color-matrix
Jul 14, 2026
Merged

test(ui): color-matrix for the home-screen render surface#256
saadqbal merged 1 commit into
developfrom
test/ui-color-matrix

Conversation

@LukasWodka

@LukasWodka LukasWodka commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

The ui color-matrix harness from the coverage audit. ui was the lowest own-coverage package (62%) — the merged profile hid it because internal/cli tests hit the render helpers transitively while asserting only plain substrings, never the glyph or the color. Now pinned in both color modes:

  • CheckLine / CrossLine / WarnLine / Errorf / MenuRow / Infof / PromptHeader / PromptHint (all 0% own): glyph + text render, and ANSI escapes appear iff color is on.
  • Para multi-line indent branch (0% own).

ui own-coverage 62% → 74.7%. No production changes.

🤖 Generated with Claude Code


Note

Low Risk
Test-only additions with no runtime or behavioral changes to the UI package.

Overview
Adds internal/ui/color_matrix_test.go to raise own coverage for Printer helpers that were only exercised indirectly from internal/cli tests (glyphs and ANSI were never asserted).

TestPrinter_ColorMatrix table-tests CheckLine, CrossLine, WarnLine, Errorf, MenuRow, Infof, PromptHeader, and PromptHint in plain and colored modes: required glyphs/text must appear, and ANSI escapes (via shared esc from ui_test.go) must appear only when WithColor(true).

TestPrinter_ParaMultiline locks the multi-line Para branch so each line gets a two-space indent.

No production code changes; tests only.

Reviewed by Cursor Bugbot for commit 11ab111. Bugbot is set up for automated code reviews on this repo. Configure here.

The ui color-matrix harness from the coverage audit. ui was the lowest
own-coverage package (62%) — the merged profile hid it because internal/cli
tests hit the render helpers transitively while asserting only plain
substrings, never the glyph or the color. Now pinned in BOTH color modes:

- CheckLine / CrossLine / WarnLine / Errorf / MenuRow / Infof / PromptHeader
  / PromptHint (all 0% own): glyph + text render, and ANSI escapes appear
  iff color is on.
- Para multi-line indent branch (0% own).

ui own-coverage 62% -> 74.7%. No production changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodka

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 11ab111. Configure here.

@LukasWodka LukasWodka self-assigned this Jul 14, 2026

@saadqbal saadqbal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 👍 Good call testing the glyph + the color escapes directly rather than the plain substrings the cli-layer tests settle for — verified every case paints with ≥1 attr so the colored-mode ANSI assertion holds, incl. PromptHeader/PromptHint.

@saadqbal
saadqbal merged commit 1e0c770 into develop Jul 14, 2026
22 checks passed
@saadqbal
saadqbal deleted the test/ui-color-matrix branch July 14, 2026 08:53
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