Python: DevUI: Prevent line breaks within words in the agent view #2024
+2
−2
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.
Motivation and Context
Fixes #1768 - Python: DevUI: Agent responses have line breaks at arbitrary characters instead of at word boundaries
Description
The container DIV that agent messages are rendered into has the
break-allclass applied to it, which means "word breaks should be inserted between any two characters." This is then inherited by all child elements. The child element containing the actual agent message text has thebreak-wordsclass applied, but that is implemented by a different CSS property thanbreak-all, and it does not override thebreak-allbehavior.The end result for the CSS is the following, which still has the effect of breaking between any two characters.
This PR removes
break-allfrom the container element for successful agent messages, but it leaves that class on in unsuccessful containers. Error messages are more prone to have very long strings that need to have arbitrary breaks in them--and having arbitrary breaks in failure messages is acceptable while arbitrary breaks in text responses is not a good experience.Contribution Checklist
Before:

After:
