MessageContent: replace overflow-hidden with overflow-x-clip to preserve sticky positioning
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 283
- Avg merge
- 32m
- Merged PRs (30d)
- 1
Description
Description
`MessageContent` currently uses `overflow-hidden` on its root div. Per CSS spec, `overflow: hidden` creates a scroll container, which breaks `position: sticky` for any descendants (e.g., code block action buttons rendered by streamdown or similar markdown renderers).
Proposal
Replace `overflow-hidden` with `overflow-x-clip` on the `MessageContent` root div.
Why `overflow-x-clip`?
- `overflow: clip` does not create a scroll container (unlike `overflow: hidden`), so `sticky` positioning continues to work for descendants
- It still clips wide content (long URLs, inline code) from overflowing the message bubble horizontally
- `overflow-x-clip` specifically targets the horizontal axis, leaving vertical overflow unaffected
Suggested change
```diff
- "... overflow-hidden text-sm",
- "... overflow-x-clip text-sm",
```
Context
We discovered this while debugging unclickable code block buttons in a chat UI. While the root cause turned out to be a separate issue with `sticky` + `pointer-events-none` in nested scroll containers, the `overflow-hidden` → `overflow-x-clip` change is independently valuable as a layout improvement that preserves sticky positioning for any future descendants that need it.
Browser support
`overflow: clip` is supported in all modern browsers (Chrome 90+, Firefox 81+, Safari 16+).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the MessageContent component and inspect the class list on its root div. Replace the horizontal overflow utility as proposed, then verify that wide content remains clipped while sticky descendants are no longer made sticky-ineligible by overflow-hidden.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, tailwindcss, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 76/100