Skip to content

Enhance About Yorkie#278

Merged
hackerwins merged 1 commit intomainfrom
about
Feb 3, 2026
Merged

Enhance About Yorkie#278
hackerwins merged 1 commit intomainfrom
about

Conversation

@hackerwins
Copy link
Member

@hackerwins hackerwins commented Feb 3, 2026

What this PR does / why we need it?

Enhance About Yorkie

Any background context you want to provide?

What are the relevant tickets?

Fixes #

Checklist

  • Added relevant tests or not required
  • Didn't break anything

Summary by CodeRabbit

  • Documentation

    • Restructured core documentation with expanded sections: What is Yorkie?, Why Yorkie?, use cases, and next steps.
    • Enhanced architecture and deployment diagrams with improved visualizations.
    • Removed legacy documentation references.
  • Bug Fixes

    • Added error handling for rendering failures with inline error messages.
  • Style

    • Improved dark theme styling for better label visibility.

@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

The pull request removes an Internals documentation link from navigation and documentation pages, enhances the Mermaid component with unique ID generation per render and error handling, substantially restructures the main documentation homepage with new sections and Mermaid diagrams, replaces ASCII diagrams with Mermaid visualizations throughout documentation, and updates dark mode styling for Mermaid elements.

Changes

Cohort / File(s) Summary
Navigation & Menu Updates
components/Layout/MobileGnbDropdown.tsx
Removed the Internals documentation submenu item; all other navigation behavior remains unchanged.
Mermaid Component Improvements
components/Mermaid.tsx
Replaced persistent idRef with locally generated ID for each render, added cleanup function to clear container on unmount, and introduced try-catch error handling with inline error message display.
Documentation Content Restructuring
docs/architecture-patterns.mdx, docs/index.mdx, docs/self-hosted-server.mdx
Removed Internals link from documentation; rewrote About Yorkie section with new subsections (What is Yorkie, Why Yorkie, Core Components, Use Cases, Next Steps); replaced ASCII diagrams with Mermaid visualizations for system architecture and shard cluster topology.
Mermaid Styling
styles/components/_mermaid.scss
Added dark mode styling for edge label text color (labelBkg and p elements) to ensure proper contrast.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Poem

🐰 Diagrams bloom where ASCII once stood,
Mermaid flows dancing through the code,
Internals fade, new paths are good,
Clean renders, errors caught and showed!

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
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.
Title check ❓ Inconclusive The title 'Enhance About Yorkie' is vague and generic, using a non-descriptive term ('Enhance') that doesn't convey what specific improvements or changes were made to the documentation. Consider a more specific title that describes the key changes, such as 'Refactor About Yorkie with new sections and Mermaid diagram' or 'Reorganize About Yorkie documentation with improved structure.'
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch about

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

@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 `@components/Mermaid.tsx`:
- Around line 40-45: The cleanup currently reads ref.current directly which can
be stale; capture the ref value when the effect runs (e.g., const current =
ref.current inside the useEffect in the Mermaid component) and then use that
captured variable in the returned cleanup function to clear innerHTML (or do
nothing if captured value is null) instead of referencing ref.current inside the
cleanup.
🧹 Nitpick comments (2)
components/Mermaid.tsx (1)

28-28: substr is deprecated; use substring instead.

String.prototype.substr is deprecated. Replace with substring(2, 11) for equivalent behavior.

♻️ Proposed fix
-          const id = `mermaid-${Math.random().toString(36).substr(2, 9)}-${Date.now()}`;
+          const id = `mermaid-${Math.random().toString(36).substring(2, 11)}-${Date.now()}`;
docs/index.mdx (1)

96-100: Add separators between use case titles and descriptions.

The list items lack separators between titles and descriptions, making them harder to read. Consider adding colons or using bold formatting consistently.

✏️ Proposed fix
-- Collaborative Editors Build the next Google Docs or Notion with [rich text editing examples](/examples/quill)
-- Real-time Whiteboards Create Figma-like experiences with [drawing applications](/examples/tldraw)
-- Project Management Tools Develop Trello-style boards with [kanban examples](/examples/kanban)
-- Code Collaboration Enable pair programming with [CodeMirror integration](/examples/codemirror)
-- Presence & Cursors Show who's online with [simultaneous cursors](/examples/simultaneous-cursors)
+- **Collaborative Editors:** Build the next Google Docs or Notion with [rich text editing examples](/examples/quill)
+- **Real-time Whiteboards:** Create Figma-like experiences with [drawing applications](/examples/tldraw)
+- **Project Management Tools:** Develop Trello-style boards with [kanban examples](/examples/kanban)
+- **Code Collaboration:** Enable pair programming with [CodeMirror integration](/examples/codemirror)
+- **Presence & Cursors:** Show who's online with [simultaneous cursors](/examples/simultaneous-cursors)

Comment on lines +40 to +45
return () => {
// Cleanup on unmount
if (ref.current) {
ref.current.innerHTML = '';
}
};
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Capture ref.current before the cleanup function.

Accessing ref.current directly inside the cleanup function can lead to stale or null references since the ref value may change between when the effect runs and when cleanup executes. Capture the reference at effect execution time.

🛠️ Proposed fix
   const renderDiagram = async () => {
+    const element = ref.current;
-    if (ref.current && chart) {
+    if (element && chart) {
       try {
         // Generate a unique ID for each render to avoid conflicts
         const id = `mermaid-${Math.random().toString(36).substr(2, 9)}-${Date.now()}`;
         const { svg } = await mermaid.render(id, chart);
-        ref.current.innerHTML = svg;
+        element.innerHTML = svg;
       } catch (error) {
         console.error('Failed to render mermaid diagram:', error);
-        ref.current.innerHTML = `<pre>Error rendering diagram: ${error}</pre>`;
+        element.innerHTML = `<pre>Error rendering diagram: ${error}</pre>`;
       }
     }
+
+    return element;
   };

-  renderDiagram();
+  const elementPromise = renderDiagram();

   return () => {
     // Cleanup on unmount
-    if (ref.current) {
-      ref.current.innerHTML = '';
-    }
+    elementPromise.then((element) => {
+      if (element) {
+        element.innerHTML = '';
+      }
+    });
   };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return () => {
// Cleanup on unmount
if (ref.current) {
ref.current.innerHTML = '';
}
};
const renderDiagram = async () => {
const element = ref.current;
if (element && chart) {
try {
// Generate a unique ID for each render to avoid conflicts
const id = `mermaid-${Math.random().toString(36).substr(2, 9)}-${Date.now()}`;
const { svg } = await mermaid.render(id, chart);
element.innerHTML = svg;
} catch (error) {
console.error('Failed to render mermaid diagram:', error);
element.innerHTML = `<pre>Error rendering diagram: ${error}</pre>`;
}
}
};
renderDiagram();
return () => {
// Cleanup on unmount
const element = ref.current;
if (element) {
element.innerHTML = '';
}
};
🤖 Prompt for AI Agents
In `@components/Mermaid.tsx` around lines 40 - 45, The cleanup currently reads
ref.current directly which can be stale; capture the ref value when the effect
runs (e.g., const current = ref.current inside the useEffect in the Mermaid
component) and then use that captured variable in the returned cleanup function
to clear innerHTML (or do nothing if captured value is null) instead of
referencing ref.current inside the cleanup.

@hackerwins hackerwins merged commit fa00e0d into main Feb 3, 2026
2 checks passed
@hackerwins hackerwins deleted the about branch February 3, 2026 05:31
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