fix(frontend/copilot): constrain markdown heading sizes in user chat messages - #12463
Conversation
…messages Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WalkthroughThis PR adds Tailwind group selectors to style nested heading elements (h1–h6) in user messages within the ChatMessagesContainer component. The change is purely styling-focused with no impact on control flow or runtime behavior. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 PR Overlap DetectionThis check compares your PR against all other open PRs targeting the same branch to detect potential merge conflicts early. 🟢 Low Risk — File Overlap OnlyThese PRs touch the same files but different sections (click to expand)
Summary: 0 conflict(s), 0 medium risk, 2 low risk (out of 2 PRs with file overlap) Auto-generated on push. Ignores: |
…-fixfrontendcopilot-markdown-headings-in-user-messages-render
…kdown-headings-in-user-messages-render
…messages (#12463) ### Before <img width="600" height="489" alt="Screenshot 2026-03-18 at 19 24 41" src="https://github.com/user-attachments/assets/bb8dc0fa-04cd-4f32-8125-2d7930b4acde" /> Formatted headings in user messages would look massive ### After <img width="600" height="549" alt="Screenshot 2026-03-18 at 19 24 33" src="https://github.com/user-attachments/assets/51230232-c914-42dd-821f-3b067b80bab4" /> Markdown headings (`# H1` through `###### H6`) and setext-style headings (`====`) in user chat messages rendered at their full HTML heading size, which looked disproportionately large in the chat bubble context. ### Changes 🏗️ - Added Tailwind CSS overrides on the user message `MessageContent` wrapper to cap all heading elements (h1-h6) at `text-lg font-semibold` - Only affects user messages in copilot chat (via `group-[.is-user]` selector); assistant messages are unchanged ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [ ] Send a user message containing `# Heading 1` through `###### Heading 6` and verify they all render at constrained size - [ ] Send a message with `====` separator pattern and verify it doesn't render as a mega H1 - [ ] Verify assistant messages with headings still render normally Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…messages (Significant-Gravitas#12463) ### Before <img width="600" height="489" alt="Screenshot 2026-03-18 at 19 24 41" src="https://github.com/user-attachments/assets/bb8dc0fa-04cd-4f32-8125-2d7930b4acde" /> Formatted headings in user messages would look massive ### After <img width="600" height="549" alt="Screenshot 2026-03-18 at 19 24 33" src="https://github.com/user-attachments/assets/51230232-c914-42dd-821f-3b067b80bab4" /> Markdown headings (`# H1` through `###### H6`) and setext-style headings (`====`) in user chat messages rendered at their full HTML heading size, which looked disproportionately large in the chat bubble context. ### Changes 🏗️ - Added Tailwind CSS overrides on the user message `MessageContent` wrapper to cap all heading elements (h1-h6) at `text-lg font-semibold` - Only affects user messages in copilot chat (via `group-[.is-user]` selector); assistant messages are unchanged ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [ ] Send a user message containing `# Heading 1` through `###### Heading 6` and verify they all render at constrained size - [ ] Send a message with `====` separator pattern and verify it doesn't render as a mega H1 - [ ] Verify assistant messages with headings still render normally Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Before
Formatted headings in user messages would look massive
After
Markdown headings (
# H1through###### H6) and setext-style headings (====) in user chat messages rendered at their full HTML heading size, which looked disproportionately large in the chat bubble context.Changes 🏗️
MessageContentwrapper to cap all heading elements (h1-h6) attext-lg font-semiboldgroup-[.is-user]selector); assistant messages are unchangedChecklist 📋
For code changes:
# Heading 1through###### Heading 6and verify they all render at constrained size====separator pattern and verify it doesn't render as a mega H1