Skip to content

Commit f9a2d50

Browse files
authored
feat(tui): colored status icon (#590)
* colored status icon * fix after feedback
1 parent f3f122d commit f9a2d50

8 files changed

+80
-69
lines changed

openhands_cli/tui/widgets/richlog_visualizer.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939

4040
# Icons for different event types
4141
SUCCESS_ICON = "✓"
42+
SUCCESS_COLOR = "#6bff6b"
4243
ERROR_ICON = "✗"
44+
ERROR_COLOR = "#ff6b6b"
4345
AGENT_MESSAGE_PADDING = (1, 0, 1, 1) # top, right, bottom, left
4446

4547
# Maximum line length for truncating titles/commands in collapsed view
@@ -429,10 +431,12 @@ def _handle_observation_event(
429431
# Determine success/error status
430432
is_error = isinstance(event, UserRejectObservation | AgentErrorEvent)
431433
status_icon = ERROR_ICON if is_error else SUCCESS_ICON
434+
status_color = ERROR_COLOR if is_error else SUCCESS_COLOR
432435

433-
# Build the new title with status icon
434-
new_title = self._build_action_title(action_event)
435-
new_title = f"{new_title} {status_icon}"
436+
# Build the new title with colored status icon
437+
title_text = Text.from_markup(self._build_action_title(action_event))
438+
icon_text = Text(status_icon, style=status_color)
439+
new_title = Text.assemble(title_text, " ", icon_text)
436440

437441
# Build the new content (observation result only)
438442
new_content = self._build_observation_content(event)

tests/snapshots/e2e/__snapshots__/test_confirmation_mode/TestConfirmationMode.test_phase3_auto_low_med_selected[confirmation_mode].svg

Lines changed: 9 additions & 8 deletions
Loading

tests/snapshots/e2e/__snapshots__/test_confirmation_mode/TestConfirmationMode.test_phase4_high_risk_confirmation_panel[confirmation_mode].svg

Lines changed: 15 additions & 14 deletions
Loading

tests/snapshots/e2e/__snapshots__/test_confirmation_mode/TestConfirmationMode.test_phase5_high_risk_action_confirmed[confirmation_mode].svg

Lines changed: 9 additions & 8 deletions
Loading

tests/snapshots/e2e/__snapshots__/test_confirmation_mode/TestConfirmationMode.test_phase6_low_risk_auto_proceeds[confirmation_mode].svg

Lines changed: 13 additions & 12 deletions
Loading

tests/snapshots/e2e/__snapshots__/test_echo_hello_world/TestEchoHelloWorld.test_echo_hello_world_conversation.svg

Lines changed: 9 additions & 8 deletions
Loading

tests/snapshots/e2e/__snapshots__/test_history_panel/TestHistoryPanelFlow.test_phase2_first_conversation.svg

Lines changed: 9 additions & 8 deletions
Loading

tests/snapshots/e2e/__snapshots__/test_multiline_mode_submit/TestMultilineModeSubmit.test_phase4_conversation_completed.svg

Lines changed: 9 additions & 8 deletions
Loading

0 commit comments

Comments
 (0)