Skip to content

docs: add a Guides section for task oriented pages - #1207

Merged
redfish4ktc merged 9 commits into
mainfrom
docs/add_extending-maxgraph_page
Oct 4, 2026
Merged

redfish4ktc merged 9 commits into
mainfrom
docs/add_extending-maxgraph_page

Conversation

@redfish4ktc

@redfish4ktc redfish4ktc commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Why

The documentation explains how each feature works, but never how to extend maxGraph, and no page walks a reader through one complete task from end to end. Someone who wants to write a custom shape, move an application off Graph, or configure a BaseGraph from scratch has to assemble the answer from three or four reference pages, in an order nothing states.

What

A new Guides section, placed before Usage, for pages that walk a reader through one task. It holds four pages, ordered by what a reader needs first:

Page Content
configure-basegraph.md Building an application on BaseGraph from the bare graph up, deciding one concern at a time
reduce-bundle-size.md The ordered procedure for moving an existing application from Graph to BaseGraph
extend-maxgraph.md Overriding behavior that no factory exposes, writing a custom Shape, declaring your own Cell style properties
migrate-from-mxgraph.md Moved here from usage/, since it is a task rather than a feature

extend-maxgraph.md is new and is the substance of the change. reduce-bundle-size.md takes the procedure out of usage/tree-shaking.md, which contradicted it on getDefaultPlugins() and the registerDefault* functions; the reference page keeps the per-family reference and each prohibition now names the migration as its exception. configure-basegraph.md gathers material that existed, spread over the graph, plugins and tree-shaking pages, but with nothing saying in which order to decide.

usage/plugins.md gains a Kind column, answering what each built-in plugin does when the application never calls it, and an Id column, which is what a reader needs to map a getPlugin call back to a class.

The milestone table of usage/tree-shaking.md gains a What it buys column, since it named the change made in each release but never its effect. Writing it meant reading the release notes of every version from 0.6.0 on, the CHANGELOG recording breaking changes only: four milestones were missing, 0.17.0, 0.19.0, 0.20.0 and 0.21.0, each claimed and measured by its own release. One row was dropped, the 0.20.0 registry consolidation, whose bundle gain could not be shown against the 0.19.0 tree.

How the content was verified

Every factual claim was checked against packages/core rather than written from memory, over several rounds, which invalidated about forty of them. Among the corrections worth knowing while reviewing: the paint hooks are called by Shape.paintVertexShape, so they run on every shape that does not replace it, and the shapes that do replace it include the whole AbstractPathShape family; augmentBoundingBox is almost never reached, useSvgBoundingBox defaulting to true; the mixin members are properties rather than methods, except insertVertex and insertEdge; inside registerDefaults() the prototype members are callable and only the container and the five collaborators are missing; the bundle floor comes from importing Graph, not from instantiating it.

A final pass re-checked extend-maxgraph.md line by line after the review round, which invalidated three more: the two collaborator factories are skipped per argument rather than together, baseStyleNames is the only style property that is always an array rather than the only one that can be, and the clone misstatement above.

Each guide was then validated by following it literally to build an application, which corrected it further: the first snippet compiles, the steps that ask the reader to check the result have a diagram to look at, the stylesheet import appears in the snippet that needs it, and the default styles are set before the cells that depend on them.

The advice on custom style properties rests on behaviour measured against the built library rather than read off the source, since the source suggests a plain deep copy: Cell.getClonedStyle() is a hand written recursive copy that gives back the current date for a Date, an empty Map or Set, null for an object created with Object.create(null), and calls every other constructor with no argument at all, so an instance comes back with its fields undefined, or the clone throws outright when that constructor reads its parameter.

Points a reviewer should decide on

  • One published anchor is lost deliberately. #guide-improving-the-tree-shaking-of-an-application-using-graph disappears with the split of usage/tree-shaking.md. An anchor cannot be redirected, since the browser never sends the fragment to the server, so the alternatives were to keep a stub heading or to accept the loss. The page itself keeps its URL, and migrate-from-mxgraph.md keeps its own through a { from, to } redirect entry.
  • The naming convention is now a rule. A guide file name starts with a verb and every other section names a subject with a singular noun, recorded in .claude/rules/documentation/website.md next to the redirect rule it depends on, with the structure the guides follow in guides-structure.md.
  • packages/ts-example changes too. Its two custom shapes set strokeWidth and isRounded in a constructor the registry calls with no argument, and which resetStyles() wipes at the first style change. They are rewritten the way the new page recommends, since an example that contradicts the guide is worse than no example. The same fix is open on the examples repository, maxgraph-integration-examples#312.

Related

The Patching a prototype section of the new guide gives the replacement advice that #420 asks the JSDoc to point at.

This work also produced twelve issues, #1193 to #1204, and a comment on #418; none of them is a prerequisite for this pull request.

Summary by CodeRabbit

  • New Features

    • Added guides for configuring BaseGraph, extending maxGraph, migrating from mxGraph, and reducing bundle size.
  • Documentation

    • Expanded guidance on plugins, tree-shaking, graph setup, CSS, custom shapes, and version requirements.
    • Reorganized guide navigation and updated links across the documentation.
    • Added a redirect from the previous mxGraph migration guide URL.
    • Updated the selected-features example description and category, and clarified production setup guidance.

The documentation explained how each feature works, but never how to extend maxGraph, and no page walked a reader
through one complete task. Add a `Guides` section for that kind of page, ordered by what a reader needs first, and move
`migrate-from-mxgraph.md` into it with a redirect keeping its published URL alive.

`extend-maxgraph.md` documents the extension points users actually reach for, with the rules the types do not expose,
such as a shape having to survive construction with no argument. `reduce-bundle-size.md` takes the procedure out of
`usage/tree-shaking.md`, which contradicted it on `getDefaultPlugins()` and the `registerDefault*` functions: a guide
now says what to do and the reference page what to know. `configure-basegraph.md` covers the opposite trajectory, for
which the material existed, spread over the graph, plugins and tree-shaking pages, but nothing said in which order to
decide.

Every factual claim was checked against `packages/core`, which invalidated about forty of them, and each guide was
validated by following it literally to build an application. The two custom shapes of `packages/ts-example` are
rewritten along the way, since their constructor defaults were wiped at the first style change, which is exactly what
the new page tells readers to avoid.

The extending guide also advises flat style properties holding simple types, because the natural reflex, one object
gathering related values, is the shape the API handles worst: `setCellStyles` assigns a top level key only, and it
first clones the style through a hand written recursive copy that corrupts a `Date`, a `Map`, a `Set` and an object
created with `Object.create(null)`, and throws when a constructor requires an argument. Measured against the built
library, since the source suggests a plain deep copy.

The published anchor `#guide-improving-the-tree-shaking-of-an-application-using-graph` disappears with this work,
deliberately, an anchor being impossible to redirect.
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
packages/website/docs/development/release.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 57063c8f-f1a4-40a9-8a2a-e8c3370a3be1
📥 Commits

Reviewing files that changed from the base of the PR and between 2451b1d and a46a990.

📒 Files selected for processing (5)
  • .claude/rules/documentation/guides-structure.md
  • .claude/rules/documentation/website.md
  • packages/website/docs/development/release.md
  • packages/website/docs/guides/extend-maxgraph.md
  • packages/website/docs/guides/reduce-bundle-size.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/website/docs/guides/reduce-bundle-size.md
  • packages/website/docs/guides/extend-maxgraph.md

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


Walkthrough

This PR adds BaseGraph configuration and bundle-size guides, revises guidance for extending maxGraph, and updates the mxGraph migration guide. It adds website documentation rules, updates reference pages and links, and changes a TypeScript custom-shape example to restore defaults after style resets.

Changes

Website documentation and examples

Layer / File(s) Summary
Guide structure and website conventions
.claude/rules/documentation/*, CLAUDE.md, packages/website/docs/guides/_category_.json, packages/website/docs/intro.md
Adds guidance for guide structure, naming, version statements, build checks, redirects, and Storybook links. Updates the Guides category and overview.
BaseGraph setup and bundle guidance
packages/website/docs/guides/configure-basegraph.md, packages/website/docs/guides/reduce-bundle-size.md, packages/website/docs/usage/graph.md, packages/website/docs/usage/tree-shaking.md, packages/website/docs/usage/global-configuration.md, packages/website/docs/usage/css-and-images.md, packages/website/docs/getting-started.mdx, packages/website/docs/demo-and-examples.md, README.md
Adds guides for configuring BaseGraph and reducing bundle size. Updates related registration, initialization, CSS, measurement, and example guidance.
Extension and plugin guidance
packages/website/docs/guides/extend-maxgraph.md, packages/website/docs/usage/plugins.md, packages/website/docs/usage/cell-handlers.md, packages/core/src/view/shape/Shape.ts, packages/ts-example/src/custom-shapes.ts
Adds guidance for overrides, custom shapes, and custom style properties. Updates plugin guidance and makes custom shape defaults persist across style resets.
Migration guide and related links
packages/website/docs/guides/migrate-from-mxgraph.md, packages/website/docusaurus.config.ts, packages/website/docs/usage/_category_.json, packages/website/docs/manual/cells.md, docs/adr/*, README.md
Updates the mxGraph migration guide, points references to its Guides location, and adds a redirect from its previous URL.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to a46a9

The examples are listed under their correct language and build-tool sections, and custom-shape defaults survive style resets. No material merge risk remains beyond normal checks.

Architecture Summary

Architecture risk: 🔵 Low · up to a46a9

The change affects 6 systems.

Changed systems: packages/website, docs, CLAUDE.md, packages/core, packages/ts-example, README.md

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/website (library) was modified; 18 changed files map to changed impact.
  • observed — docs (service) was modified; 2 changed files map to changed impact.
  • observed — CLAUDE.md (service) was modified; 1 changed file maps to changed impact.
  • observed — packages/core (library) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in CLAUDE.md: Adds references to the website documentation rules covering website-doc changes and guide structure.
  • observed — Modified behavior in README.md: The TypeScript selected-features example description now specifies that it draws the same diagram without custom shape classes, reproducing their appearance with plain style properties.
  • observed — Modified behavior in README.md: The JavaScript selected-features example description was re-added unchanged; the old hunk’s removal is part of the surrounding replacement.
  • observed — Modified behavior in README.md: The migration guide link now targets guides/migrate-from-mxgraph.md instead of usage/migrate-from-mxgraph.md.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a Guides section for task-oriented pages. It is concise and follows the repository’s documented Conventional Commits format.
Description check ✅ Passed The description explains why the change is needed, summarizes the new guides and related documentation changes, and provides verification details and reviewer considerations. It does not reproduce the…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
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.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

Comment thread packages/website/docs/guides/configure-basegraph.md Outdated
Comment thread packages/website/docs/usage/tree-shaking.md Outdated
Comment thread packages/website/docs/guides/reduce-bundle-size.md Outdated
Comment thread packages/website/docs/guides/reduce-bundle-size.md Outdated
Comment thread packages/website/docs/guides/reduce-bundle-size.md
Review findings on the Guides section, each checked against the sources rather than taken as a wording preference.

The default vertex and edge styles are returned by reference from the `Stylesheet` map, so one property can be assigned
in place. Spreading the whole object into `putDefaultVertexStyle` restated every value to change one, and needed a
warning about the merge that the shorter form makes pointless. The class JSDoc already documents the in place form.

The over-trimming table said an unrouted edge becomes a straight line between its terminals. `GraphView.updatePoints`
falls back to the waypoints of the geometry when no edge style resolves, so that is only true of an edge without any.
The same table named the arrow head alone, where `ConnectorShape.createMarker` runs for `startArrow` and `endArrow`
alike and the symbol a registration carries can be any shape.

The sizes of step 7 are tied to a version, which the page said in a paragraph placed after them, so a first reader met
the numbers before learning what they were measured on. Moved ahead of them.

`registerDefaultStyleElements()` leaves the tree-shaking milestone table: it groups four registration calls for
convenience and removes nothing from a bundle, so it is not an improvement of that kind.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9dc88b8f-23dc-42b3-b168-5518d768c8d3

📥 Commits

Reviewing files that changed from the base of the PR and between e630d48 and f587301.

📒 Files selected for processing (3)
  • packages/website/docs/guides/configure-basegraph.md
  • packages/website/docs/guides/reduce-bundle-size.md
  • packages/website/docs/usage/tree-shaking.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/website/docs/guides/reduce-bundle-size.md
  • packages/website/docs/usage/tree-shaking.md

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

Comment thread packages/website/docs/guides/configure-basegraph.md Outdated
The milestone table named the change made in each release but never its effect, so a reader could not tell which
versions mattered to them. Add a column stating what leaves the bundle, or what a bundler can newly do.

Writing that column meant reading the release notes of every version from 0.6.0 on, which is what the table was
missing: the CHANGELOG records breaking changes only, and most of this work breaks nothing. Four milestones were
absent, each one claimed and measured by its own release. The i18n provider becoming configurable in 0.17.0 drops the
`Translations` machinery for applications that never translate. `EdgeStyle` and `Perimeter` becoming namespaces in
0.19.0 removes a shape that defeated the module level analysis of several bundlers. The library no longer naming the
built-in edge styles in 0.20.0 is what finally lets an unregistered one be dropped, and what the per style helpers of
0.24.0 are built on. `fit` moved to a plugin in 0.21.0.

The 0.24.0 row was incomplete, `EdgeHandler` having also stopped importing `EdgeStyle` that release, and the 0.12.0
row claimed no side effects where the declaration excepts the CSS files.

The row about the dedicated registries of 0.20.0 is dropped. Comparing the 0.19.0 tree showed the perimeters were
already separate modules and the registry it replaced imported no implementation, so the change was a consistency one
with no bundle gain to report. The enum removal of the same release and the `Dictionary` removal of 0.21.0 are left
out for the opposite reason: both shrink every bundle unconditionally, where this table lists what an application can
choose not to load.
The example replacing the default `perimeter` and `endArrow` read as one gesture, where the two lines differ: `'none'`
names no marker and removes a registration, while `'ellipsePerimeter'` is a perimeter like any other and has to be
registered in turn, so it only pays off for an application that registers it anyway. Nothing said so, and nothing said
the name has to match the shapes the cells draw either, although an ellipse perimeter on a rectangular vertex computes
the attach point on an ellipse that is not there.

Raised by a reviewer reading the snippet as copyable, which it is.
The previous commit claimed a perimeter has no equivalent of the `'none'` marker value, which is wrong: leaving the
property at `null` or `undefined` uses no perimeter and registers nothing, as `GraphView.getPerimeterFunction` returns
null and the terminal point is then never computed. The JSDoc of `CellStateStyle.perimeter` and the Perimeters page
both say so already, so the guide now points at the latter instead of contradicting it.

Framing it as an option also balances the warning next to it: edges meeting their terminals at the centre is a symptom
when it comes from a registration left out by mistake, and a legitimate choice when it is wanted.
A re-read of the page against `packages/core` found three statements that do not hold, among roughly 170 checked.

`createGraphDataModel` and `createStylesheet` were described as running only when the constructor received neither a
model nor a stylesheet. The two fallbacks are independent, so passing only a model still runs `createStylesheet`.

`baseStyleNames` was called the only array among the built-in style properties. `portConstraint`,
`sourcePortConstraint` and `targetPortConstraint` are typed `DirectionValue | DirectionValue[]`, so three others accept
one. It is the only property that is always an array, which is the claim the advice around it actually needs.

The clone table said an instance whose constructor requires an argument makes the copy throw. The copy calls the
constructor with no argument, so a constructor that only stores its parameter yields an object with undefined fields
instead, which is just as wrong for the reader and worth naming. The row now covers both outcomes, and applies to any
class rather than only that one shape of constructor.

Two wordings were also too wide. The five `create*` factories belong to `Graph`, `BaseGraph` having none, and the
constraint handler snippet is adapted from its story rather than taken from it, since it adds a modifier and a return
type the story does not carry.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (6)

🟡 Minor · Move the cross-guide paragraph below “Before you start”. · configure-basegraph.md:17-19

packages/website/docs/guides/configure-basegraph.md:17-19
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Move the cross-guide paragraph below “Before you start”.

The guide rule requires the “Before you start” block to follow the goal. This cross-guide paragraph is separate guidance, not part of the goal. Its current position places an alternate workflow before the guide’s prerequisites.

Suggested fix
-[Reduce the Bundle Size of an Application](./reduce-bundle-size.md) covers the opposite direction, an application
-already built on `Graph` and moved over. Follow that one if this is your case: it starts from everything and removes
-progressively, which is the safer order when the application already works.
-
 ## Before you start
@@
 This guide assumes you know how the two graph classes differ, see
 [Graph vs BaseGraph](../usage/graph.md#graph-vs-basegraph).
 
+[Reduce the Bundle Size of an Application](./reduce-bundle-size.md) covers the opposite direction, an application
+already built on `Graph` and moved over. Follow that one if this is your case: it starts from everything and removes
+progressively, which is the safer order when the application already works.
+
 ## 1. Start from the bare graph
🟡 Minor · Move non-goal prose below Before you start. · reduce-bundle-size.md:18-19

packages/website/docs/guides/reduce-bundle-size.md:18-19
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Move non-goal prose below Before you start.

The cross-guide paragraph is navigation content, not part of the goal. The rule requires the block to follow the goal immediately. This file also places the version note before the block, so moving only the cross-guide paragraph would not satisfy the rule. Move both paragraphs below the block.

Suggested fix
-This guide was written and verified with `maxGraph` 0.25.0, which step 2 requires since it uses
-`registerDefaultStyleElements`. Earlier versions are not documented here.
-
-A new application does not need this procedure, since it has nothing to remove:
-[Set Up an Application on BaseGraph](./configure-basegraph.md) builds the same configuration from the other end.
-
 ## Before you start
@@
 This guide assumes you know how the two graph classes differ, see
 [Graph vs BaseGraph](../usage/graph.md#graph-vs-basegraph).
 
+This guide was written and verified with `maxGraph` 0.25.0, which step 2 requires since it uses
+`registerDefaultStyleElements`. Earlier versions are not documented here.
+
+A new application does not need this procedure, since it has nothing to remove:
+[Set Up an Application on BaseGraph](./configure-basegraph.md) builds the same configuration from the other end.
+
🟡 Minor · State that earlier versions are not covered. · reduce-bundle-size.md:15-16

packages/website/docs/guides/reduce-bundle-size.md:15-16
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

State that earlier versions are not covered.

“Not documented here” does not make clear that earlier versions are outside this guide’s scope. Use the required wording.

Suggested fix
-`registerDefaultStyleElements`. Earlier versions are not documented here.
+`registerDefaultStyleElements`. Earlier versions are not covered.
🟡 Minor · Add the required page-level version boundary. · extend-maxgraph.md:12-16

packages/website/docs/guides/extend-maxgraph.md:12-16
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add the required page-level version boundary.

The Since notes apply only to individual features. Add This guide was written and verified with \maxGraph` . Earlier versions are not covered.` using the version actually used for the guide. Without this statement, readers cannot identify the supported version for the recipe collection and may apply a recipe to an untested release.

🟡 Minor · Place “Before you start” directly after the guide goal. · migrate-from-mxgraph.md:46

packages/website/docs/guides/migrate-from-mxgraph.md:46
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Place “Before you start” directly after the guide goal.

This linear guide must put its prerequisite block immediately after the goal. The current warning, table of contents, background, and information block delay the hard-gate checklist. Move the block before the warning. Update “notice above” to “notice below” so the checklist keeps its meaning.

Suggested fix
 This documentation provides instructions for migrating from `mxGraph` to `maxGraph`.
 It includes information about application setup changes, code changes, styles, event handling and other relevant information.
 
+## Before you start
+
+- **An `mxGraph` application that builds and runs**, since every section below changes it in place and you check it as
+  you go.
+- **Node.js and npm**, the first step replacing the dependency.
+- **An inventory of the `mx` prefixed names your code uses**, classes, constants and style keys, which the sections
+  below rename family by family.
+- **The maxGraph version you are migrating to**, using the migration notice below to identify what changed after 0.18.0.
+
+This guide assumes you know `mxGraph` itself: it states what changed, not how a diagram works. It migrates to `Graph`,
+see [Graph vs BaseGraph](../usage/graph.md#graph-vs-basegraph).
+
 :::danger[Important Notice]
 
 As of version `0.18.0`, this migration guide isn't updated with the latest `maxGraph` API changes, particularly breaking ones.
@@
-## Before you start
-
-- **An `mxGraph` application that builds and runs**, since every section below changes it in place and you check it as
-  you go.
-- **Node.js and npm**, the first step replacing the dependency.
-- **An inventory of the `mx` prefixed names your code uses**, classes, constants and style keys, which the sections
-  below rename family by family.
-- **The maxGraph version you are migrating to**, the notice above listing what changed after 0.18.0.
-
-This guide assumes you know `mxGraph` itself: it states what changed, not how a diagram works. It migrates to `Graph`,
-see [Graph vs BaseGraph](../usage/graph.md#graph-vs-basegraph).
-
 ## Application setup
🟡 Minor · State the guide's written-and-verified version. · migrate-from-mxgraph.md:13-18

packages/website/docs/guides/migrate-from-mxgraph.md:13-18
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

State the guide's written-and-verified version.

The notice identifies 0.18.0 as the point where updates stopped, but it does not state the version with which the guide was written and verified. Add the actual verified version in the required page-level notice. Without it, readers cannot determine which maxGraph version the migration steps were validated against.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e9235c48-f3b9-4885-9ab7-15cd7e95fd32
📥 Commits

Reviewing files that changed from the base of the PR and between f587301 and 2451b1d.

📒 Files selected for processing (3)
  • packages/website/docs/guides/configure-basegraph.md
  • packages/website/docs/guides/extend-maxgraph.md
  • packages/website/docs/usage/tree-shaking.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/website/docs/guides/configure-basegraph.md

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

The rule asking for a demo link paired with a source link said nothing about which ref the source link uses, which
leaves it looking like an oversight next to the habit of pinning a repository link to a commit so it keeps showing
what it showed when written.

It is a choice, so write it down with its reason: the two links of a pair have to agree, and the demo always runs the
implementation on `main`, so pinning the source would send the reader to code the demo no longer runs. The usual risk
of an unpinned link barely applies to a story file, which is renamed rarely and moved almost never.

The twenty five story links already in the documentation all point at `main`, so nothing changes in the pages.
The release page pointed at `blob/development/.github/release.yml`. There is no `development` branch on the remote,
so the link has been returning a 404 to anyone following the release procedure.

Pinned to the commit that last changed that file rather than moved to `main`, since it is a configuration file and not
a Storybook story, the only link the documentation deliberately leaves on a branch.
A review read the guides against their own rule and found three gaps, two in the pages and one in the rule itself.

`reduce-bundle-size.md` closed its version sentence with "Earlier versions are not documented here" where the rule
prescribes "Earlier versions are not covered", the wording `configure-basegraph.md` already used. The two siblings now
agree.

`extend-maxgraph.md` carried no page level version at all. Its three `Since 0.25.0` markers cover single features, so
a reader had nothing telling them which release the recipes as a whole were verified against. The exemption that page
holds is from the prerequisites block, not from naming a version.

The rule asked for that block "right after the goal" while two guides put a redirect to their sibling in between, so
it read as a violation rather than as the deliberate choice it is: a reader on the wrong page should leave before
working through prerequisites that do not apply to them. The rule now says what may stand there, and records why
`migrate-from-mxgraph.md` puts its danger notice first.
@redfish4ktc

redfish4ktc commented Oct 4, 2026 •

Copy link
Copy Markdown
Member Author

@coderabbitai four of the six outside-diff comments are addressed in
a46a990, two by changing the pages and two by changing the rule they were measured against. Two are declined.

Taken. reduce-bundle-size.md now says "Earlier versions are not covered", the wording the rule prescribes and the one configure-basegraph.md already used. And extend-maxgraph.md gains a page level version statement: you are right that its three Since 0.25.0 markers cover single features and leave the collection as a whole unattributed, and the exemption that page holds is from the prerequisites block rather than from naming a version.

Taken, but by amending the rule rather than the pages. The two comments about moving a paragraph below ## Before you start describe a real mismatch with the rule as written, so the rule was underspecified. The redirect to a sibling guide stays where it is, deliberately: a reader who is on the wrong page should leave before working through prerequisites that do not apply to them, which is the opposite of what moving it would achieve. guides-structure.md now states what may stand between the goal and the block, the version sentence and that one redirect paragraph, and nothing else. Note that the reduce-bundle-size.md comment also proposed moving the version sentence below the block, which the rule already contradicted: it says that guide states its version "in a single preamble sentence rather than in a bullet".

Declined, both on migrate-from-mxgraph.md.

Moving ## Before you start above the :::danger notice would bury the most important thing on that page. The notice says the guide stopped being updated at 0.18.0, so a reader targeting a newer version needs it before investing any effort, and the last bullet of the block refers back to it. Your own suggested diff has to rewrite "the notice above" into "the notice below", which is the signal that the move works against the content rather than with it. The rule now records this page as the explicit exception, so it should stop reading as an oversight.

Stating a written-and-verified version on that page would be inaccurate. The page announces that it is not maintained past 0.18.0, so claiming it was verified against a release would assert exactly the maintenance it disclaims. The notice already gives the honest boundary, together with what a reader should do about it.

@sonarqubecloud

sonarqubecloud Bot commented Oct 4, 2026

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
fd --hidden --type f '^(guides-structure|configure-basegraph|reduce-bundle-size|extend-maxgraph|migrate-from-mxgraph)\.md$' . --exclude .git | sort | while IFS= read -r file; do
  printf '\n--- %s ---\n' "$file"
  if [[ "$file" == *guides-structure.md ]]; then
    cat -n "$file"
  else
    sed -n '1,100p' "$file"
  fi
done

Length of output: 26770


@redfish4ktc, thanks for the clarification. I checked the revised rule and all four guide preambles.

The four accepted comments are addressed:

  • reduce-bundle-size.md now says “Earlier versions are not covered.”
  • extend-maxgraph.md now has a page-level verified-version statement.
  • guides-structure.md explicitly permits the version sentence and one sibling-guide redirect before ## Before you start.

My suggestion to move the version sentence below the prerequisites also contradicted the existing preamble rule. That suggestion was incorrect.

I withdraw both comments on migrate-from-mxgraph.md. The maintenance warning must remain before the prerequisites. The warning states the maintenance boundary at 0.18.0; it does not establish a verified release. Requesting a verified-version claim without that evidence was incorrect.

No further changes are needed for these six comments.


✏️ Learnings added
Learnt from: redfish4ktc
URL: https://github.com/maxGraph/maxGraph/pull/1207

Timestamp: 2026-10-04T02:28:21.124Z
Learning: For maxGraph documentation under packages/website/docs/guides/, .claude/rules/documentation/guides-structure.md permits a page-level version sentence and one sibling-guide redirect paragraph between the goal and the Before you start block. The redirect intentionally precedes prerequisites so readers can select the appropriate guide first. A collection of independent recipes such as extend-maxgraph.md omits the prerequisites block but still states its verified version.

Learnt from: redfish4ktc
URL: https://github.com/maxGraph/maxGraph/pull/1207

Timestamp: 2026-10-04T02:28:21.124Z
Learning: In packages/website/docs/guides/migrate-from-mxgraph.md, the danger notice intentionally precedes Before you start and states that the guide is not maintained past maxGraph 0.18.0. This maintenance boundary is not evidence of verification against a release. Do not request an unsupported written-and-verified version claim for this page.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
fd --hidden --type f '^(guides-structure|configure-basegraph|reduce-bundle-size|extend-maxgraph|migrate-from-mxgraph)\.md$' . --exclude .git | sort | while IFS= read -r file; do
  printf '\n--- %s ---\n' "$file"
  if [[ "$file" == *guides-structure.md ]]; then
    cat -n "$file"
  else
    sed -n '1,85p' "$file"
  fi
done

Length of output: 24741


@redfish4ktc, thanks for the clarification. I checked the revised rule and all four guide preambles.

The four accepted comments are addressed:

  • reduce-bundle-size.md now says “Earlier versions are not covered.”
  • extend-maxgraph.md now states its page-level verified version.
  • guides-structure.md now permits the version sentence and one sibling-guide redirect before ## Before you start. This resolves both paragraph-order comments.

My suggestion to move the version sentence below the prerequisites contradicted the existing rule. That suggestion was incorrect.

I withdraw both comments on migrate-from-mxgraph.md:

  • The danger notice must precede the prerequisites. The rule now states this exception.
  • The 0.18.0 maintenance boundary does not establish verification against a release. I should not have requested an unsupported verified-version claim.

No further changes are needed for these six comments.


🧠 Learnings used
Learnt from: redfish4ktc
URL: https://github.com/maxGraph/maxGraph/pull/1207

Timestamp: 2026-10-04T02:28:21.283Z
Learning: In packages/website/docs/guides/migrate-from-mxgraph.md, the danger notice intentionally precedes Before you start and states that the guide is not maintained past maxGraph 0.18.0. This maintenance boundary is not evidence of verification against a release. Do not request an unsupported written-and-verified version claim for this page.

Learnt from: redfish4ktc
URL: https://github.com/maxGraph/maxGraph/pull/1207

Timestamp: 2026-10-04T02:28:21.283Z
Learning: For maxGraph documentation under packages/website/docs/guides/, .claude/rules/documentation/guides-structure.md permits a page-level version sentence and one sibling-guide redirect paragraph between the goal and the Before you start block. The redirect intentionally precedes prerequisites so readers can select the appropriate guide first. A collection of independent recipes such as extend-maxgraph.md omits the prerequisites block but still states its verified version.

You are interacting with an AI system.

@redfish4ktc
redfish4ktc merged commit 029d692 into main Oct 4, 2026
14 checks passed
@redfish4ktc
redfish4ktc deleted the docs/add_extending-maxgraph_page branch October 4, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant