Skip to content

Conversation

@jeffhandley
Copy link
Member

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-all class 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 the break-words class applied, but that is implemented by a different CSS property than break-all, and it does not override the break-all behavior.

The end result for the CSS is the following, which still has the effect of breaking between any two characters.

word-break: break-all;
overflow-wrap: break-word;

This PR removes break-all from 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

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR. (No, it is not)

Before:
Image

After:
image

Copilot AI review requested due to automatic review settings November 8, 2025 08:15
@github-actions github-actions bot changed the title DevUI: Prevent line breaks within words in the agent view Python: DevUI: Prevent line breaks within words in the agent view Nov 8, 2025
@markwallace-microsoft
Copy link
Member

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL13035193185% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
1740 107 💤 0 ❌ 0 🔥 33.794s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the break-all CSS class from conversation message bubbles to improve text readability by preventing awkward word breaks mid-word.

Key Changes

  • Removed break-all class from the main conversation bubble container, allowing text to break naturally at word boundaries instead of breaking anywhere within words

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
python/packages/devui/frontend/src/components/features/agent/agent-view.tsx Removed break-all from message bubble container class (line 122)
python/packages/devui/agent_framework_devui/ui/assets/index.js Compiled/bundled version reflecting the same change

<div className="relative group">
<div
className={`rounded px-3 py-2 text-sm break-all ${
className={`rounded px-3 py-2 text-sm ${
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

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

The removal of break-all creates inconsistent text breaking behavior. Normal messages (line 122) now break naturally, but error messages (line 138) still use break-all. Consider using break-words for both cases to maintain consistency while improving readability, or add overflow-wrap: break-word to handle long unbreakable strings (URLs, tokens) that could overflow the container.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@javiercn javiercn left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: DevUI: Agent responses have line breaks at arbitrary characters instead of at word boundaries

3 participants