Skip to content

fix: hyphenate wrapped text in agent thinking output#1597

Merged
adboio merged 2 commits intoPostHog:mainfrom
reverb256:fix/1593-hyphenate-thinking-text
Apr 9, 2026
Merged

fix: hyphenate wrapped text in agent thinking output#1597
adboio merged 2 commits intoPostHog:mainfrom
reverb256:fix/1593-hyphenate-thinking-text

Conversation

@reverb256
Copy link
Copy Markdown
Contributor

Problem

Agent thinking output wraps long words mid-word without hyphenation marks, making it hard to read where words break.

Fixes #1593

Solution

Changed the <pre> className from break-all to break-words hyphens-auto in ThoughtView.tsx. This enables CSS hyphenation with proper hyphen marks at word breaks.

  • break-words prevents mid-word breaks without indication
  • hyphens-auto adds proper hyphenation marks (the <html lang="en"> attribute already enables English hyphenation rules)

Screenshot

Before: words break mid-character with no indication
After: words wrap with proper hyphen marks (e.g., hyphe- at line end)

Files Changed

  • apps/code/src/renderer/features/sessions/components/session-update/ThoughtView.tsx — 1 line changed

Changes break-all to break-words and adds hyphens-auto class
on the thinking output pre element so long words wrap with
proper hyphenation marks instead of breaking mid-word.

Fixes PostHog#1593
@adboio
Copy link
Copy Markdown
Contributor

adboio commented Apr 9, 2026

@reverb256 pushed a commit after running pnpm lint, the code quality check was failing because some classnames were out of order -- please be sure to run these before submitting PRs :)

we have these checks set up as precommit hooks, if you run pnpm install in your local repo that should set everything up automatically, so git commit will trigger the checks

Copy link
Copy Markdown
Contributor

adboio commented Apr 9, 2026

Merge activity

  • Apr 9, 9:02 PM UTC: Graphite couldn't merge this PR because it failed for an unknown reason (Fast-forward merges are not supported for forked repositories. Please create a branch in the target repository in order to merge).

@adboio adboio merged commit b6e4325 into PostHog:main Apr 9, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hyphenate wrapped text in agent thinking output

2 participants