Skip to content

Conversation

@WcaleNieWolny
Copy link
Contributor

@WcaleNieWolny WcaleNieWolny commented Jan 18, 2026

Changes

Fixed the mermaid code block

Before After
CleanShot 2026-01-18 at 11 06 30@2x CleanShot 2026-01-18 at 11 06 49@2x

Motivation

Martin told me to improve the docs for Capgo Build, so I am doing that

Business impact

Low - docs

Summary by CodeRabbit

  • New Features

    • Enhanced diagram rendering with improved accessibility support, including ARIA labels and responsive layout options.
  • Documentation

    • Updated documentation across multiple language versions with improved visual diagrams and enhanced accessibility features.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 18, 2026

📝 Walkthrough

Walkthrough

The changes refactor diagram rendering from component-based implementations to a data-driven approach using an updated MermaidGraph.astro component. The component now accepts props for graph definitions, accessibility labels, and responsive layout. Multiple documentation pages across different language locales are updated to adopt this new pattern by exporting Mermaid flowchart constants and rendering them via the flexible MermaidGraph component.

Changes

Cohort / File(s) Summary
MermaidGraph Component
src/components/MermaidGraph.astro
Introduces typed Props interface with graph, ariaLabel, and fullWidth props. Replaces hardcoded diagram content with dynamic rendering via set:html. Adds responsive styling and accessibility attributes (aria-live, aria-label). Updates Mermaid initialization with fontSize 18 and revised startOnLoad logic.
Cloud Build Documentation
src/content/docs/docs/cli/cloud-build/getting-started.mdx
Exports buildProcessFlowGraph Mermaid constant and replaces inline Mermaid block with MermaidGraph component usage. Minor wording updates to step labels ("Logs Stream" → "Log Streaming").
Apple Login Android Docs (Multi-locale)
src/content/docs/de/docs/plugins/social-login/apple/android.mdx, src/content/docs/docs/plugins/social-login/apple/android.mdx, src/content/docs/es/docs/plugins/social-login/apple/android.mdx, src/content/docs/fr/plugins/social-login/apple/android.mdx, src/content/docs/id/docs/plugins/social-login/apple/android.mdx, src/content/docs/it/docs/plugins/social-login/apple/android.mdx, src/content/docs/ja/docs/plugins/social-login/apple/android.mdx, src/content/docs/ko/docs/plugins/social-login/apple/android.mdx, src/content/docs/zh/docs/plugins/social-login/apple/android.mdx
Each file replaces AndroidAppleLoginGraph component with MermaidGraph. Exports identical appleLoginFlowGraph Mermaid flowchart constant. Sets fullWidth={false} and includes ariaLabel for accessibility. Applied uniformly across all language variants.

Poem

🐰 A rabbit hops through diagrams bright,
From rigid components to graphs flowing right,
With props and with labels for all to perceive,
Dynamic and flexible—truly they'll believe! ✨

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions replacing a mermaid code block with a custom component, which aligns with the primary change across all modified files, though there is a typo ('procss' instead of 'process').
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/components/BuildProcessFlow.astro`:
- Around line 61-69: Wrap the mermaid diagram in an accessible live region: add
role="region" and aria-live="polite" (or "assertive" if immediate announcement
is required) to the container element and provide a concise aria-label
describing the diagram (e.g., "Build process flow diagram"). Specifically update
the div that contains the <pre class="mermaid"> (in BuildProcessFlow.astro) to
include role="region", aria-live, and aria-label attributes so screen readers
announce dynamic updates and know what the visual represents.

WcaleNieWolny and others added 2 commits January 18, 2026 11:42
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@sonarqubecloud
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/components/MermaidGraph.astro`:
- Around line 2-8: The component MermaidGraph.astro declares interface Props
with ariaLabel optional but renders an element with role="img"; update Props to
require ariaLabel (remove ? from ariaLabel) or supply a sensible default when
destructuring from Astro.props (e.g., const { graph, ariaLabel = 'Mermaid
diagram', fullWidth = true } = Astro.props) and ensure any usage of role="img"
references that required/defaulted ariaLabel so the rendered image always has an
accessible label; update both the Props definition and the destructuring in
MermaidGraph.astro (and the other occurrence at lines ~83-85) accordingly.
🧹 Nitpick comments (6)
src/components/MermaidGraph.astro (1)

81-86: Prefer text injection over set:html for Mermaid source.

Mermaid expects a plain-text definition; set:html will parse HTML and can introduce accidental markup or injection if the graph ever comes from non-static content. Using set:text (or inline {graph}) keeps it as text and matches Mermaid’s input expectations.

♻️ Suggested change
-    set:html={graph}
+    set:text={graph}
src/content/docs/zh/docs/plugins/social-login/apple/android.mdx (1)

30-30: Localize the ariaLabel to match the page language.

This is a Chinese page, but the ariaLabel is English. Consider translating it so screen readers match the locale (and apply the same pattern across other localized pages updated in this PR).

💡 Example
-<MermaidGraph graph={appleLoginFlowGraph} ariaLabel="Apple Login flow diagram on Android" fullWidth={false} />
+<MermaidGraph graph={appleLoginFlowGraph} ariaLabel="Android 上的 Apple 登录流程图" fullWidth={false} />
src/content/docs/es/docs/plugins/social-login/apple/android.mdx (1)

31-31: Consider localizing the ariaLabel for Spanish users.

The component usage is correct with proper accessibility attributes. However, for the Spanish locale, consider translating the ariaLabel to Spanish for screen reader users.

Suggested localized aria-label
-<MermaidGraph graph={appleLoginFlowGraph} ariaLabel="Apple Login flow diagram on Android" fullWidth={false} />
+<MermaidGraph graph={appleLoginFlowGraph} ariaLabel="Diagrama del flujo de inicio de sesión de Apple en Android" fullWidth={false} />

Based on learnings, aria-label should be added to interactive elements, and localizing it improves accessibility for non-English users.

src/content/docs/ko/docs/plugins/social-login/apple/android.mdx (1)

30-30: Consider localizing the ariaLabel for Korean users.

For better accessibility in the Korean locale, consider translating the aria-label.

Suggested localized aria-label
-<MermaidGraph graph={appleLoginFlowGraph} ariaLabel="Apple Login flow diagram on Android" fullWidth={false} />
+<MermaidGraph graph={appleLoginFlowGraph} ariaLabel="Android에서 Apple 로그인 흐름 다이어그램" fullWidth={false} />
src/content/docs/ja/docs/plugins/social-login/apple/android.mdx (1)

33-33: Consider localizing the ariaLabel for Japanese users.

For better accessibility in the Japanese locale, consider translating the aria-label.

Suggested localized aria-label
-<MermaidGraph graph={appleLoginFlowGraph} ariaLabel="Apple Login flow diagram on Android" fullWidth={false} />
+<MermaidGraph graph={appleLoginFlowGraph} ariaLabel="AndroidでのAppleログインフロー図" fullWidth={false} />
src/content/docs/de/docs/plugins/social-login/apple/android.mdx (1)

33-33: Consider localizing the ariaLabel for German users.

For better accessibility in the German locale, consider translating the aria-label.

Suggested localized aria-label
-<MermaidGraph graph={appleLoginFlowGraph} ariaLabel="Apple Login flow diagram on Android" fullWidth={false} />
+<MermaidGraph graph={appleLoginFlowGraph} ariaLabel="Apple Login Flussdiagramm für Android" fullWidth={false} />

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