Skip to content

fix(frontend/copilot): constrain markdown heading sizes in user chat messages - #12463

Merged
0ubbe merged 3 commits into
devfrom
lluisagusti/secrt-2138-fixfrontendcopilot-markdown-headings-in-user-messages-render
Mar 18, 2026
Merged

fix(frontend/copilot): constrain markdown heading sizes in user chat messages#12463
0ubbe merged 3 commits into
devfrom
lluisagusti/secrt-2138-fixfrontendcopilot-markdown-headings-in-user-messages-render

Conversation

@0ubbe

@0ubbe 0ubbe commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Before

Screenshot 2026-03-18 at 19 24 41

Formatted headings in user messages would look massive

After

Screenshot 2026-03-18 at 19 24 33

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:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • 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

…messages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@0ubbe
0ubbe requested a review from a team as a code owner March 18, 2026 08:48
@0ubbe
0ubbe requested review from Bentlybro and Swiftyos and removed request for a team March 18, 2026 08:48
@github-project-automation github-project-automation Bot moved this to 🆕 Needs initial review in AutoGPT development kanban Mar 18, 2026
@github-actions github-actions Bot added the platform/frontend AutoGPT Platform - Front end label Mar 18, 2026
@coderabbitai

coderabbitai Bot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This 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

Cohort / File(s) Summary
User Message Heading Styles
autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/ChatMessagesContainer.tsx
Adds Tailwind group selectors to apply specific font sizes and weights to nested heading elements (h1–h6) within user messages.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

size/s, platform/frontend

Suggested reviewers

  • ntindle
  • Abhi1992002
  • kcze

Poem

🐰 A whisker twitch, a hop so small,
Headings now styled, standing tall,
Group selectors dance with grace,
Making user messages a prettier place!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(frontend/copilot): constrain markdown heading sizes in user chat messages' accurately and specifically describes the main change: constraining markdown heading sizes in user messages.
Description check ✅ Passed The pull request description clearly explains the problem (oversized markdown headings in user messages), provides before/after visual examples, and details the CSS changes made.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lluisagusti/secrt-2138-fixfrontendcopilot-markdown-headings-in-user-messages-render
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

🔍 PR Overlap Detection

This check compares your PR against all other open PRs targeting the same branch to detect potential merge conflicts early.

🟢 Low Risk — File Overlap Only

These 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: openapi.json, lock files.

…-fixfrontendcopilot-markdown-headings-in-user-messages-render
@Abhi1992002
Abhi1992002 self-requested a review March 18, 2026 16:28
@github-project-automation github-project-automation Bot moved this from 🆕 Needs initial review to 👍🏼 Mergeable in AutoGPT development kanban Mar 18, 2026
@0ubbe
0ubbe merged commit e1db823 into dev Mar 18, 2026
21 checks passed
@0ubbe
0ubbe deleted the lluisagusti/secrt-2138-fixfrontendcopilot-markdown-headings-in-user-messages-render branch March 18, 2026 16:33
@github-project-automation github-project-automation Bot moved this to Done in Frontend Mar 18, 2026
@github-project-automation github-project-automation Bot moved this from 👍🏼 Mergeable to ✅ Done in AutoGPT development kanban Mar 18, 2026
Bentlybro pushed a commit that referenced this pull request Apr 4, 2026
…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>
Bentlybro pushed a commit to Bentlybro/AutoGPT that referenced this pull request Apr 4, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform/frontend AutoGPT Platform - Front end size/xs

Projects

Status: ✅ Done
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants