Skip to content

feat(tui): colored status icon#590

Merged
malhotra5 merged 2 commits intomainfrom
vasco/check-and-cross
Mar 12, 2026
Merged

feat(tui): colored status icon#590
malhotra5 merged 2 commits intomainfrom
vasco/check-and-cross

Conversation

@VascoSch92
Copy link
Contributor

@VascoSch92 VascoSch92 commented Mar 11, 2026

Summary

This PR adds colored status icons (✓ and ✗) to the TUI action view in the Rich Log Visualizer. The checkmark (success) icon is now displayed in green (#6bff6b), while the error icon is displayed in red (#ff6b6b), making it easier for users to quickly identify the outcome of actions.

Changes

• Added SUCCESS_COLOR and ERROR_COLOR constants for consistent color values
• Updated _handle_observation_event() method to use Text.assemble() instead of string concatenation, enabling proper Rich text styling
• Applied color styling to the status icons based on success/error state

Before/After
Before: The status icons (✓/✗) appeared in the default terminal color (white/light gray)

After:
• ✓ checkmark appears in green (#6bff6b)
• ✗ error appears in red (#ff6b6b)

This provides immediate visual feedback on action outcomes without requiring users to parse the icon meaning.

Evidence

The snapshot tests confirm the visual change.
The updated SVG snapshots show the colored icons in action.


🚀 Try this PR

uvx --python 3.12 git+https://github.com/OpenHands/OpenHands-CLI.git@vasco/check-and-cross

all-hands-bot

This comment was marked as outdated.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands_cli/tui/widgets
   richlog_visualizer.py3518675%72, 75, 79, 82–85, 87, 175, 182–183, 195, 240, 281, 363, 413–416, 429, 432–434, 437–439, 442, 444, 447, 481–485, 489, 496–499, 503, 515, 556, 561–562, 565–567, 570, 576–579, 581, 588, 602–603, 605, 611, 630–631, 634, 687, 690–691, 695, 705, 708, 725, 727–729, 733, 771–772, 787, 793, 814–815, 819–821, 831–832, 836–838
TOTAL663992486% 

Copy link
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

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

Taste Rating: 🟢 Good taste - Clean, pragmatic implementation that does exactly what it needs to do.

CODE ANALYSIS:
The implementation is solid. Using Text.assemble() is the correct approach for styled text in Rich/Textual. The color constants are pragmatic, and the logic is straightforward. No special cases, no complexity, no bugs. This is how simple changes should be done.

EVIDENCE NOTE:
The PR description now includes an Evidence section, which is good. For a TUI, the snapshot tests do show the visual output (they're SVG renderings of the exact terminal output). However, for complete evidence, consider adding a screenshot or short GIF of the actual running TUI showing the colored icons in action, not just the test artifacts.

VERDICT: ✅ Ship it - The code is correct and ready to merge. The evidence gap is minor documentation, not a functional issue.

@VascoSch92 VascoSch92 marked this pull request as ready for review March 11, 2026 21:43
@VascoSch92 VascoSch92 requested review from enyst and malhotra5 March 11, 2026 21:44
Copy link
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

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

Taste Rating: 🟢 Good taste - Clean, pragmatic implementation that does exactly what it needs to do.

CODE ANALYSIS:
The implementation is solid. Using Text.assemble() is the correct approach for styled text in Rich/Textual. The color constants are pragmatic, and the logic is straightforward. No special cases, no complexity, no bugs. This is how simple changes should be done.

EVIDENCE NOTE:
The PR description now includes an Evidence section, which is good. For a TUI, the snapshot tests showing the colored icons in SVG format are appropriate proof of the visual changes.

VERDICT: ✅ Worth merging - Solves a real UX problem (quick visual feedback on action status) with clean, maintainable code.

KEY INSIGHT: The change from string concatenation to Rich text assembly is the right technical choice for enabling proper styling without adding complexity.

@VascoSch92 VascoSch92 requested a review from malhotra5 March 12, 2026 06:22
@VascoSch92
Copy link
Contributor Author

Hey @malhotra5,

Good catch :-)

I forgot to use .from_markup(...).

Fixed ✅

Copy link
Collaborator

@malhotra5 malhotra5 left a comment

Choose a reason for hiding this comment

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

Thanks a bunch!

@malhotra5 malhotra5 merged commit f9a2d50 into main Mar 12, 2026
12 checks passed
@malhotra5 malhotra5 deleted the vasco/check-and-cross branch March 12, 2026 13: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.

3 participants