fix(shared): extract shared text truncation utilities - #796
Closed
github-actions[bot] wants to merge 1 commit into
Closed
fix(shared): extract shared text truncation utilities#796github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Create shared/text_utils.py with truncate_text() and clean_for_display() functions to consolidate duplicated text truncation logic across the codebase. - Add truncate_text() with configurable max_length, from_start/end, and ellipsis - Add clean_for_display() combining strip, newline collapse, and truncation - Update conversations/display.py to use clean_for_display() - Update tui/widgets/richlog_visualizer.py to use truncate_text() - Add comprehensive test coverage Addresses item from code quality report. Closes #795
Contributor
Author
|
This PR is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days. |
Contributor
Author
|
This PR was closed because it had no activity for 50 days. If you feel this was closed in error, and you would like to continue the PR, please resubmit or let us know. |
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.
Summary
Extract duplicated text truncation logic into a shared module
openhands_cli/shared/text_utils.py.Changes
truncate_text()function with configurable max_length, from_start/end direction, and custom ellipsisclean_for_display()function that combines stripping, newline collapse, and truncationconversations/display.pyto useclean_for_display()tui/widgets/richlog_visualizer.pyto usetruncate_text()tests/shared/test_text_utils.pyshared/__init__.pyRelated Issue
Addresses findings from #795 (Item 6: Create
shared/text_utils.pywith truncation function)Testing
make lint)make test)This PR was automatically generated by the Code Quality Report workflow.