Skip to content

feat(markdown): render GitHub-style callouts - #26255

Merged
brennanb2025 merged 1 commit into
stablyai:mainfrom
AmoabaKelvin:render-github-callouts-in-markdown
Oct 7, 2026
Merged

brennanb2025 merged 1 commit into
stablyai:mainfrom
AmoabaKelvin:render-github-callouts-in-markdown

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​81 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​81
Prod 15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​268 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​253

ELI5

Agents often write notes like this:

> [!NOTE]
> Restart the app after changing this.

GitHub shows that as a coloured box titled "Note". Orca showed it as a plain quote with the text [!NOTE] at the top. Now Orca shows the coloured, titled box too.

What Changed

Before: a quote starting with [!NOTE], [!TIP], [!IMPORTANT], [!WARNING] or [!CAUTION] rendered as an ordinary grey quote with the marker left in as literal text.

After: it renders as a callout with a coloured left border, an icon and a title ("Note", "Tip", "Important", "Warning", "Caution"), and the marker line is gone. This applies everywhere Orca renders markdown read-only:

  • agent chat messages, reasoning, notices and approval cards
  • PR, issue, Linear, Jira and GitLab comments and descriptions
  • the markdown file preview, and PDF/HTML exports made from it

Mechanism: these callouts are a GitHub extension, not part of standard GitHub-flavoured markdown, so the markdown parser leaves the marker as text. A small parser plugin now looks at each quote: if its first line is exactly one of the five markers, it removes that line and tags the quote with the callout kind. The quote renderers check for that tag and draw a shared callout component instead of a quote. Both HTML sanitizers allow the tag, limited to the five known kinds.

As on GitHub, a marker that shares its line with other text (> [!NOTE] some text) and unknown markers (> [!DANGER]) stay ordinary quotes.

Titles are translated in all six languages. Tip, warning and caution reuse the existing success, warning and destructive colours. Note and important had no matching colour, so this adds two tokens for them (GitHub's blue and purple, light and dark).

Not changed: the rich (WYSIWYG) markdown editor still shows the marker as text, so editing a file never rewrites it.

Why

Agents use these callouts to flag the part of a reply that matters most. Rendering them as a quote with a stray [!IMPORTANT] in front made that part look like noise.

Visual Proof

Before:
CleanShot 2026-10-07 at 3 54 18 PM@2x

After:
CleanShot 2026-10-07 at 3 50 23 PM@2x

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

New tests render markdown through the real chat, comment and preview pipelines and cover: all three surfaces, a marker followed by a blank line and more blocks, a body that starts with bold text, and the three cases that must stay plain quotes. The export styles are not covered by a test.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security: the new attribute passes the HTML sanitizers only with one of five fixed values. Raw HTML in a comment can set it, which only changes how that quote is drawn.
  • Cross-platform, SSH, folder workspaces: rendering only, in the renderer process; no file, process or platform behaviour changes.
  • Backwards compatibility: nothing exchanged between clients and hosts changes. Quotes without a marker render exactly as before.
  • Performance: one extra pass over the parsed markdown, the same shape as the existing link plugins.
  • Mobile: not changed; the mobile app has its own renderer.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Walkthrough

The change adds a remark plugin that recognizes supported GitHub callout markers in blockquotes and preserves their metadata through sanitization. Markdown previews and comment renderers display recognized callouts with kind-specific icons, labels, and styling. The change also adds export and preview styles, translations in six locales, and tests for supported markers and cases that remain ordinary blockquotes.

Priority: ⬇️ Low

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 8 files. (8 skipped: 8… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the user impact, implementation, rationale, testing, visual proof, compatibility considerations, and checklist items. It does not include the required linked issue, and it doe… Add an actual linked issue under “Linked Issue” using Fixes #<issue-number> or provide the required pre-existing issue reference. If the author is an external contributor, complete the AI Disclosure section. Also state whether lint, typec…
✅ Passed checks (3 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 clearly and concisely describes the primary change: rendering GitHub-style Markdown callouts.
Full details: Docstring Coverage

Explanation

Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 8 files. (8 skipped: 8 unsupported.)

Full details: Description check

Explanation

The description explains the user impact, implementation, rationale, testing, visual proof, compatibility considerations, and checklist items. It does not include the required linked issue, and it does not state AI usage or non-usage for an external contribution.

Resolution

Add an actual linked issue under “Linked Issue” using Fixes #&lt;issue-number&gt; or provide the required pre-existing issue reference. If the author is an external contributor, complete the AI Disclosure section. Also state whether lint, typecheck, test, and build checks passed locally or will be covered by CI if this information is not already recorded elsewhere.

  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 05e1fc7b-9b48-40a1-8602-a4ef38e10d0c
📥 Commits

Reviewing files that changed from the base of the PR and between 76d1b7b and bbff9ff.

📒 Files selected for processing (16)
  • src/renderer/src/assets/main.css
  • src/renderer/src/assets/markdown-preview.css
  • src/renderer/src/components/editor/export-css.ts
  • src/renderer/src/components/editor/markdown-preview-plugins.ts
  • src/renderer/src/components/editor/use-markdown-preview-components.tsx
  • src/renderer/src/components/markdown-github-callout.tsx
  • src/renderer/src/components/sidebar/CommentMarkdown.github-callout.test.tsx
  • src/renderer/src/components/sidebar/CommentMarkdown.tsx
  • src/renderer/src/components/sidebar/comment-markdown-element-renderers.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/remark-github-callouts.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment on lines +37 to +44
} else if (match[0].endsWith('\n') || paragraph.children.length === 1) {
paragraph.children.shift()
if (paragraph.children.length === 0) {
node.children.shift()
}
} else {
// `[!NOTE]*aside*`: an inline sibling shares the marker's line.
return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Accept a hard break after a standalone marker.

For > [!NOTE] \n> Body, mdast puts a break node after the marker text. This branch treats that sibling as same-line content and leaves the marker visible in an ordinary quote. Check whether the next sibling is a line break before rejecting inline siblings; keep > [!NOTE]*aside* as an ordinary quote. (github.com)

@brennanb2025

Copy link
Copy Markdown
Contributor

Amazing

@brennanb2025
brennanb2025 merged commit 42a40f8 into stablyai:main Oct 7, 2026
30 checks passed
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.

2 participants