Skip to content

feat(markdown): render GitHub alert callouts as tinted cards#616

Merged
rainxchzed merged 1 commit into
mainfrom
feat/markdown-github-alerts
May 16, 2026
Merged

feat(markdown): render GitHub alert callouts as tinted cards#616
rainxchzed merged 1 commit into
mainfrom
feat/markdown-github-alerts

Conversation

@rainxchzed
Copy link
Copy Markdown
Member

@rainxchzed rainxchzed commented May 16, 2026

README and release-notes blockquotes starting with `> [!NOTE]`, `[!TIP]`, `[!IMPORTANT]`, `[!WARNING]`, `[!CAUTION]` now render as tinted Material 3 Card with category icon + colored container, matching GitHub mobile. Today they show as literal text in a plain blockquote.

How

  • Custom `blockQuote` slot via `markdownComponents(...)` on the Markdown call in About + WhatsNew
  • `AlertBlockQuote` inspects node text; if first line matches the alert pattern, renders Card with icon (`Outlined.Info`/`Lightbulb`/`Campaign`/`Warning`/`Report`) and body via nested `Markdown(...)`. Else falls through to default blockquote
  • 5 label strings × 13 locales

Test plan

  • Android compile clean
  • Device: open a repo with alert blockquotes (e.g. astral-sh/uv, vercel/next.js README) — verify all 5 kinds render as colored cards. Non-alert blockquotes still render as plain blockquote.

Summary by CodeRabbit

Release Notes

  • New Features
    • GitHub-style alerts (Note, Tip, Important, Warning, Caution) in README and release notes now render as styled icon cards instead of plain text.
    • Manual app linking now automatically suggests matching GitHub repositories with ranked candidates.

Review Change Stack

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

rainxchzed has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2358a62e-c9f2-4236-a7ab-9a179d558097

📥 Commits

Reviewing files that changed from the base of the PR and between a98ac82 and 6e93a4d.

📒 Files selected for processing (30)
  • core/presentation/src/commonMain/composeResources/files/whatsnew/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ar/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/bn/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/es/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/fr/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/hi/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/it/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ja/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ko/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/pl/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ru/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/tr/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/zh-CN/18.json
  • core/presentation/src/commonMain/composeResources/values-ar/strings-ar.xml
  • core/presentation/src/commonMain/composeResources/values-bn/strings-bn.xml
  • core/presentation/src/commonMain/composeResources/values-es/strings-es.xml
  • core/presentation/src/commonMain/composeResources/values-fr/strings-fr.xml
  • core/presentation/src/commonMain/composeResources/values-hi/strings-hi.xml
  • core/presentation/src/commonMain/composeResources/values-it/strings-it.xml
  • core/presentation/src/commonMain/composeResources/values-ja/strings-ja.xml
  • core/presentation/src/commonMain/composeResources/values-ko/strings-ko.xml
  • core/presentation/src/commonMain/composeResources/values-pl/strings-pl.xml
  • core/presentation/src/commonMain/composeResources/values-ru/strings-ru.xml
  • core/presentation/src/commonMain/composeResources/values-tr/strings-tr.xml
  • core/presentation/src/commonMain/composeResources/values-zh-rCN/strings-zh-rCN.xml
  • core/presentation/src/commonMain/composeResources/values/strings.xml
  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/sections/About.kt
  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/sections/WhatsNew.kt
  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/markdown/AlertBlockQuote.kt
  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/markdown/GithubStoreMarkdownComponents.kt

Walkthrough

The pull request adds GitHub-style alert block rendering for markdown content, transforming [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], and [!CAUTION] blockquote prefixes into styled icon cards with localized labels across 13 languages, integrated into About and What's New detail sections.

Changes

GitHub Alert Block Rendering

Layer / File(s) Summary
Markdown alert label strings
core/presentation/src/commonMain/composeResources/values*/strings-*.xml
Five markdown alert label string resources (markdown_alert_note, markdown_alert_tip, markdown_alert_important, markdown_alert_warning, markdown_alert_caution) added across 13 language variants to provide localized UI text for alert headers.
Alert block rendering component
feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/markdown/AlertBlockQuote.kt
GithubAlertKind enum with regex parser extracts alert type from blockquote start; AlertBlockQuote composable renders matched alerts as colored Surface cards with icons and localized labels, delegates non-alerts to fallback; helper functions map alert kind to palette/icon/label.
Custom markdown components factory
feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/markdown/GithubStoreMarkdownComponents.kt
githubStoreMarkdownComponents(imageTransformer) returns MarkdownComponents with custom blockQuote renderer using AlertBlockQuote and fallback handling.
Integration into detail sections
feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/sections/About.kt, WhatsNew.kt
Markdown composables in ExpandableMarkdownContent now receive custom components argument from githubStoreMarkdownComponents(imageTransformer), enabling alert rendering in both sections.
Release notes documentation
core/presentation/src/commonMain/composeResources/files/whatsnew/*/18.json
Release notes across 13 languages updated to document GitHub alert styling and manual app linking improvements in version 1.8.3.

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly Related PRs

🐰 Alert cards bloom with GitHub's flair,
Five flavors styled beyond compare—
Note and Tip and Warning bright,
Icon'd badges, pixel-light!
Markdown prose now dressed just right. 💚✨

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: implementing GitHub alert callout rendering as tinted cards, which matches the primary objective of the PR.
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.

✏️ 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 feat/markdown-github-alerts

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.

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.

1 participant