fix: prevent sparse spacing in hyphenated words#1102
Merged
adamdotdevin merged 4 commits intoanomalyco:devfrom Jul 19, 2025
Merged
fix: prevent sparse spacing in hyphenated words#1102adamdotdevin merged 4 commits intoanomalyco:devfrom
adamdotdevin merged 4 commits intoanomalyco:devfrom
Conversation
- Use non-breaking hyphens (U+2011) to prevent word breaks at hyphens - Apply fix to both Assistant (markdown) and User (chat) messages - Maintain 86 character width constraint - Fix word boundary detection in textarea component Fixes sparse single-word lines when displaying hyphenated words like 'claude-code-action'
adamdotdevin
requested changes
Jul 18, 2025
Member
adamdotdevin
left a comment
There was a problem hiding this comment.
just a few questions, i'd love to have this fixed, just need to understand the implementation a little better
8df9568 to
ac501a1
Compare
Contributor
Author
|
Now that you've pointed it out, I think there might be a more ergonomic way to do this 🤔 |
- Extract hyphen preservation logic into reusable utility functions - Replace magic numbers with dynamic style-based calculations - Add GetMessageContainerFrame() and GetMarkdownContainerFrame() for DRY width calculations - Simplify width calculations by removing outdated constraints - Improve code maintainability with semantic function names and clear documentation The hyphen handling now automatically adapts to style changes without manual updates.
Contributor
Author
achembarpu
pushed a commit
to achembarpu/opencode
that referenced
this pull request
Aug 4, 2025
achembarpu
pushed a commit
to achembarpu/opencode
that referenced
this pull request
Aug 4, 2025
…)" This reverts commit 8068650.
xywsxp
pushed a commit
to xywsxp/opencode
that referenced
this pull request
Apr 24, 2026
xywsxp
pushed a commit
to xywsxp/opencode
that referenced
this pull request
Apr 24, 2026
…)" This reverts commit 19b94e4.
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
This PR fixes the sparse spacing issue that occurs when displaying hyphenated words like 'claude-code-action' in both Assistant and User messages in the TUI. Fixes #621.
Problem
Previously, hyphenated words would break at hyphens, creating sparse single-word lines that made the chat interface look broken and difficult to read.
Before:

Solution
After:

Changes Made
Testing
This change significantly improves the readability of hyphenated content in the TUI without affecting any other functionality.