Skip to content

fix: align icons and fix text overflow in chat messages#1682

Open
reverb256 wants to merge 4 commits intoPostHog:mainfrom
reverb256:fix/1193-icon-alignment-wrapping
Open

fix: align icons and fix text overflow in chat messages#1682
reverb256 wants to merge 4 commits intoPostHog:mainfrom
reverb256:fix/1193-icon-alignment-wrapping

Conversation

@reverb256
Copy link
Copy Markdown
Contributor

Problem

Chat message components have inconsistent icon alignment and text overflow:

  • ThoughtView missing left padding (pl-3) — misaligned with AgentMessage/ToolCallBlock
  • Tool call icons used fragile pt-px hack instead of proper align=center
  • Tool titles had no overflow handling — long names could break layout
  • ExpandableIcon caused layout shift on hover (two icons in flow, swapping)

Closes #1193

Fix

File Change
ThoughtView.tsx Added pl-3 + min-w-0 to root Box
ToolCallView.tsx Added align=center to outer Flex, truncate on title
ExecuteToolView.tsx Added align=center to outer Flex, truncate on description
toolCallUtils.tsx Fixed ExpandableIcon with absolute positioning to prevent layout shift

Tests

9 new tests across 3 test files verifying alignment and overflow behavior.

- Add pl-3 and min-w-0 to ThoughtView for consistent left padding
  with AgentMessage and ToolCallBlock
- Add align="center" to outer Flex in ToolCallView and ExecuteToolView
  replacing the fragile pt-px hack for icon vertical alignment
- Add truncate and min-w-0 to tool titles preventing overflow on
  long tool names, descriptions, and commands
- Fix ExpandableIcon layout shift on hover by wrapping in a fixed-size
  container with absolute positioning for the hover icon
- Add unit tests verifying alignment and overflow patterns
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.

Proper icon alignment and text wrapping in chat

1 participant