Skip to content

Add Mermaid diagram support with initial diagrams#132

Merged
kilbot merged 2 commits into
mainfrom
feature/add-mermaid-diagrams
Apr 15, 2026
Merged

Add Mermaid diagram support with initial diagrams#132
kilbot merged 2 commits into
mainfrom
feature/add-mermaid-diagrams

Conversation

@kilbot
Copy link
Copy Markdown
Contributor

@kilbot kilbot commented Mar 12, 2026

Summary

  • Enable @docusaurus/theme-mermaid with automatic light/dark mode switching (neutral / dark themes)
  • Add data sync strategy flowchart to the architecture page — shows how initial, incremental, background, and manual syncs feed into local IndexedDB
  • Add checkout architecture diagram to the architecture page — shows the iframe/webview approach connecting POS client to WooCommerce Order Pay and payment gateways
  • Add barcode scanning decision tree to the barcode scanning page — visualizes the three outcomes (exact match → cart, multiple → search, none → online lookup)
  • Add checkout process sequence diagram to the checkout page — shows the full request/response flow from user click through payment to receipt

Test plan

  • Run npm run start and visit /reference/architecture — verify both the sync strategy flowchart and checkout architecture diagram render correctly
  • Toggle dark mode — diagrams should switch between neutral (light) and dark themes automatically
  • Visit /pos/product-panel/barcode-scanning — verify the decision tree diagram appears between the intro text and the numbered list
  • Visit /pos/checkout — verify the sequence diagram appears in the "How Checkout Works" section before Payment Methods
  • Run npm run build — confirm no build errors across all 11 locales
  • Check that existing LocalizedSVG diagrams on the architecture and WC REST API pages still render correctly

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Enhanced the barcode scanning guide with a visual flowchart depicting the control flow, including database lookup results and corresponding actions (automatic cart addition, search bar population, or online search).

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Apr 15, 2026 8:12pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: wcpos/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3ef78145-f3ae-47a7-8ba9-cdd429aaa3f0

📥 Commits

Reviewing files that changed from the base of the PR and between 2052bf3 and 59ebf35.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • docusaurus.config.js
  • package.json
  • versioned_docs/version-1.x/pos/product-panel/barcode-scanning.mdx
✅ Files skipped from review due to trivial changes (2)
  • package.json
  • versioned_docs/version-1.x/pos/product-panel/barcode-scanning.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docusaurus.config.js

📝 Walkthrough

Walkthrough

The changes enable Mermaid diagram support in a Docusaurus documentation project by installing the required theme package, configuring markdown rendering with appropriate light and dark theme settings, and adding a sample flowchart documenting barcode scanning control flow.

Changes

Cohort / File(s) Summary
Docusaurus Mermaid Setup
docusaurus.config.js, package.json
Enabled Mermaid rendering by adding @docusaurus/theme-mermaid dependency and configuring markdown, themes array, and light/dark theme settings in Docusaurus config.
Documentation Addition
versioned_docs/version-1.x/pos/product-panel/barcode-scanning.mdx
Added inline Mermaid flowchart illustrating barcode scanning outcomes: local database lookup with branching logic for single match (auto-add), multiple matches (search bar population), or no match (online WooCommerce search).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 With Mermaid's brush, our docs now flow,
Diagrams bright from here to there we go,
Barcodes dance in flowcharts neat,
Configuration complete—our vision sweet! 🎨

🚥 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 directly describes the main objective of the PR: adding Mermaid diagram support and including initial diagrams as part of the implementation.
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.

✨ 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 feature/add-mermaid-diagrams

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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.

🧹 Nitpick comments (1)
package.json (1)

47-47: Clarify purpose of sharp dependency.

The sharp package appears unrelated to Mermaid diagram support. If it's for the @docusaurus/plugin-ideal-image plugin (which can use sharp for image optimization), consider mentioning this in the PR description or moving it to a separate commit for clearer change tracking.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 47, The dependency "sharp" appears unrelated to Mermaid
support; either clarify its purpose by updating the PR description to state it
is used by `@docusaurus/plugin-ideal-image` (or other image-optimization usage),
or separate the addition of "sharp" into its own commit so change history is
clearer; locate the dependency entry "sharp": "^0.34.5" in package.json and
update the PR text or split the commit accordingly to explicitly state why sharp
was added and which symbol (e.g., `@docusaurus/plugin-ideal-image`) depends on it.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@package.json`:
- Line 47: The dependency "sharp" appears unrelated to Mermaid support; either
clarify its purpose by updating the PR description to state it is used by
`@docusaurus/plugin-ideal-image` (or other image-optimization usage), or separate
the addition of "sharp" into its own commit so change history is clearer; locate
the dependency entry "sharp": "^0.34.5" in package.json and update the PR text
or split the commit accordingly to explicitly state why sharp was added and
which symbol (e.g., `@docusaurus/plugin-ideal-image`) depends on it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f0a46072-c7db-49ab-b9d5-521da77dd58b

📥 Commits

Reviewing files that changed from the base of the PR and between f5f3afe and 2052bf3.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • docusaurus.config.js
  • package.json
  • versioned_docs/version-1.x/pos/checkout/index.mdx
  • versioned_docs/version-1.x/pos/product-panel/barcode-scanning.mdx
  • versioned_docs/version-1.x/reference/architecture.mdx

@wcpos-bot
Copy link
Copy Markdown
Contributor

wcpos-bot Bot commented Mar 12, 2026

👀 Ada is reviewing this PR... (runtime: pending)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 12, 2026

Dependency Review Summary

The full dependency review summary was too large to display here (2741KB, limit is 1024KB).

Please download the artifact named "dependency-review-summary" to view the complete report.

View full job summary

kilbot added 2 commits April 15, 2026 21:58
Enable @docusaurus/theme-mermaid with automatic light/dark mode
switching. Add four diagrams to clarify core concepts:

- Data sync strategy flowchart (architecture page)
- Checkout architecture diagram (architecture page)
- Barcode scanning decision tree (barcode scanning page)
- Checkout process sequence diagram (checkout page)
Keep only the barcode scanning decision tree diagram.
@kilbot kilbot force-pushed the feature/add-mermaid-diagrams branch from 90e83a1 to 59ebf35 Compare April 15, 2026 19:58
@kilbot kilbot enabled auto-merge (squash) April 15, 2026 19:58
@kilbot kilbot merged commit 565b8f2 into main Apr 15, 2026
8 checks passed
@kilbot kilbot deleted the feature/add-mermaid-diagrams branch April 15, 2026 20:12
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