fix(tui): Preserve Rich Text styling in collapsible content for diff highlighting#661
Open
sjathin wants to merge 2 commits intoOpenHands:mainfrom
Open
fix(tui): Preserve Rich Text styling in collapsible content for diff highlighting#661sjathin wants to merge 2 commits intoOpenHands:mainfrom
sjathin wants to merge 2 commits intoOpenHands:mainfrom
Conversation
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.
Why
The TUI was stripping Rich Text styling from SDK event visualizations by converting
Textobjects to plain strings viastr(). The SDK'sFileEditorObservation.visualizealready generates colored diff output (red for removals, green for additions) through itsvisualize_diff()function, but this styling was lost before reaching the user. All collapsible content rendered as unstyled plain text.Summary
event.visualizeTextobject directly from_build_observation_content()instead ofstr(event.visualize), preserving Rich styling (colors, bold, dim)Textobjects through_create_titled_collapsibleand_create_event_collapsibleinstead of escaping and stringifying_update_widget_in_uisignature to acceptstr | TextTextobjects and style spans are preserved through the rendering pipelineIssue Number
Closes #308
Video/Screenshots
Before
After
Type
Notes
_escape_rich_markupmethod is still used and correct for title strings (which use Rich markup syntax). It was only incorrectly applied to collapsible content (which usesStatic(markup=False)and rendersTextobjects directly).