Skip to content

fix(gitlab): render item descriptions and comments with document markdown variant - #9161

Merged
nwparker merged 1 commit into
stablyai:mainfrom
SilvaViniF:fix/gitlab-item-markdown-rendering
Jul 27, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
SilvaViniF:fix/gitlab-item-markdown-rendering

Conversation

@SilvaViniF

@SilvaViniF SilvaViniF commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

GitLab issue/MR descriptions and comments rendered as a single wall of text: Markdown headings (## Problem to solve, ## Proposed solution, …) lost their size hierarchy and block spacing, so every section ran into the next paragraph.

This switches both surfaces to variant="document" with the same typography classes the GitHub item dialog already uses.

Screenshots

Real Orca GitLab item dialog captures via Electron CDP (agent-browser / Playwright over --remote-debugging-port). Same live dialog surface this PR changes (GitLabItemDialog → CommentMarkdown).

Issues created on gitlab.com/neil148/test so each fixture exercises a different markdown shape.

1. GitLab default issue template

Before (compact) After (document)
before-template after-template

Headings like Problem to solve run into the following paragraph before; after they get real block hierarchy + spacing.

2. Heading hierarchy (h1–h4)

Before (compact) After (document)
before-headings after-headings

3. Lists, tasks, and code

Before (compact) After (document)
before-lists after-lists

4. GFM table + blockquote

Before (compact) After (document)
before-table after-table

5. Dense multi-section body

Before (compact) After (document)
before-dense after-dense

Window context

Before After
before-window after-window

Testing

  • pnpm lint — clean for the changed files
  • pnpm typecheck
  • pnpm test — CommentMarkdown.test.tsx passes (20 tests)
  • pnpm build
  • Added tests: two CommentMarkdown cases asserting the document variant renders headings as block <h2> while the compact variant does not — a direct regression guard for this bug.

AI Review Report

  • Correctness: No issues. The change only swaps the CommentMarkdown variant and adds a className; the rendered content was already fetched and already passed through CommentMarkdown. The only removed behavior is the compact rendering of these two surfaces — which was the bug.
  • Interaction with recent main: Rebased onto current main (which now includes fix(pr-comments): make the review sidebar legible for structured bot markdown #9209, "make the review sidebar legible for structured bot markdown"). Confirmed no overlap: fix(pr-comments): make the review sidebar legible for structured bot markdown #9209 reworks the compact renderer + PR-review sidebar (pr-comment-presentation.ts) and adds comment-md-h/role="heading" semantics, but it does not touch the item dialogs and adds no global block-flow CSS — so the GitLab dialog's compact rendering is unchanged and this fix is still required. Both PRs' CommentMarkdown tests coexist.
  • Cross-platform (macOS / Linux / Windows): No platform-dependent code — no shortcuts, paths, shell, or Electron platform branches. Pure renderer markup + Tailwind; identical on all three, light/dark unaffected.
  • SSH/remote/local: No new data flow or timing; renders content the dialog already loads.
  • Provider neutrality: GitLab-specific and aligns GitLab with the existing GitHub sibling; no generic behavior changed.
  • UI quality: Matches the GitHub item dialog exactly (same variant + className), so the two dialogs read as one design.

Security Audit

  • Input handling: No new input. comment.body / details.body were already fetched from GitLab and already rendered through CommentMarkdown before this change.
  • Sanitization: Both compact and document variants run the identical pipeline (rehypeRaw → rehypeSanitize with the shared schema). The document variant does not relax sanitization, so the XSS posture is unchanged.
  • Command execution / path handling / auth / secrets / IPC / dependencies: None touched.
  • Follow-up: none.

Notes

No platform-specific behavior. Scope is a single topic (GitLab item dialog markdown rendering); no unrelated changes.

ELI5

GitLab issue and MR descriptions rendered as one flat wall of text — headings lost size and spacing. They now use the same document markdown styling as GitHub items so sections are readable.

@AmethystLiang

Copy link
Copy Markdown
Contributor

thanks for the PR. looking forward to reviewing it soon

…down variant

The GitLab issue/MR dialog rendered its description and comment bodies with
the compact CommentMarkdown variant, which collapses headings to inline bold
spans and paragraphs to inline spans — so multi-section issue descriptions ran
together as a wall of text. Switch both surfaces to the document variant (with
the same typography classes the GitHub dialog already uses) so headings regain
size hierarchy and block spacing.

Add CommentMarkdown tests asserting the document variant renders headings as
block elements while the compact variant flattens them, guarding against a
regression of exactly this bug.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@SilvaViniF
SilvaViniF force-pushed the fix/gitlab-item-markdown-rendering branch from daa424a to 818425c Compare July 19, 2026 11:23
@SilvaViniF
SilvaViniF marked this pull request as ready for review July 19, 2026 11:43
@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

GitLab comments and work item descriptions now render with CommentMarkdown in document mode and dedicated styling for wrapping, links, inline code, and preformatted blocks. Tests verify that document mode renders Markdown headings as block-level elements, while compact mode preserves headings as inline text.

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main GitLab markdown rendering change.
Description check ✅ Passed The description includes Summary, Screenshots, Testing, AI Review Report, Security Audit, and Notes, covering the required template sections.

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.

@nwparker
nwparker requested review from AmethystLiang and removed request for brennanb2025 July 26, 2026 21:00
@nwparker nwparker added the bug Something isn't working label Jul 27, 2026
@nwparker

Copy link
Copy Markdown
Contributor

@AmethystLiang need your stamp

@nwparker
nwparker merged commit a1ad471 into stablyai:main Jul 27, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…down variant (stablyai#9161)

Co-authored-by: viniciussilva <vinicius.silva@plus10.de>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants