Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
as-notes | a024f05 | Commit Preview URL Branch Preview URL |
Mar 26 2026, 10:19 AM |
There was a problem hiding this comment.
Pull request overview
Integrates an inline Markdown editor experience (syntax shadowing) into the extension, along with updated/bundled Mermaid assets and documentation/licensing updates.
Changes:
- Add inline editor user docs (settings + usage) and internal technical documentation.
- Include third-party license notices in-repo and copy them into the packaged
dist/output. - Bundle/update Mermaid runtime chunks used by the inline editor/preview pipeline (layouts, rendering, utilities).
Reviewed changes
Copilot reviewed 44 out of 557 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| vs-code-extension/media/mermaid/chunks/mermaid.core/cose-bilkent-S5V4N54A.mjs | Adds cose-bilkent Cytoscape layout/rendering chunk for Mermaid. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/classDiagram-v2-WZHVMYZB.mjs | Adds class diagram v2 entry chunk for Mermaid. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/classDiagram-2ON5EDUG.mjs | Adds class diagram entry chunk for Mermaid. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-XAJISQIX.mjs | Adds Mermaid package metadata chunk (deps/version). |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-TZMSLE5B.mjs | Adds SVG drawing helpers (rect/text/image) chunk. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-S3R3BYOJ.mjs | Adds Mermaid core utils chunk (directives, text sizing, URL formatting, etc.). |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-QZHKN3VN.mjs | Adds imperative state helper chunk. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-QXUST7PY.mjs | Adds edge rendering/markers/labels chunk. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-QN33PNHL.mjs | Adds SVG viewport sizing helper chunk. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-N4CR4FBY.mjs | Adds layout loader registry (dagre + cose-bilkent) chunk. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-JA3XYJ7Z.mjs | Adds Markdown/Katex/icon rendering for labels chunk. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-HN2XXSSU.mjs | Adds line-with-offset utilities and marker offsets chunk. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-FMBD7UC4.mjs | Adds global icon styling chunk. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-EXTU4WIE.mjs | Adds sandbox-aware SVG selection helper chunk. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-CVBHYZKI.mjs | Adds subgraph title margin helper chunk. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-ATLVNIR6.mjs | Adds compiled style helpers for shapes/labels chunk. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-AGHRB4JF.mjs | Adds logger shim chunk used across Mermaid runtime. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-55IACEB6.mjs | Adds helper for locating diagram SVG element chunk. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/chunk-4BX2VUAB.mjs | Adds common DB population helper chunk. |
| vs-code-extension/media/mermaid/chunks/mermaid.core/architectureDiagram-VXUJARFQ.mjs | Adds architecture diagram implementation chunk. |
| vs-code-extension/media/mermaid/channel-f19f13a4.js | Adds bundled color channel helper (build artifact). |
| vs-code-extension/media/mermaid/channel-d3ce1aa3.js | Adds bundled color channel helper (build artifact). |
| vs-code-extension/media/mermaid/array-b7dcf730.js | Adds bundled array helper (build artifact). |
| vs-code-extension/media/mermaid/array-2ff2c7a6.js | Adds bundled array helper (build artifact). |
| vs-code-extension/media/mermaid/arc-a15e19dc.js | Adds bundled arc generator (build artifact). |
| vs-code-extension/media/mermaid/arc-911b4007.js | Adds bundled arc generator (build artifact). |
| vs-code-extension/media/mermaid/Tableau10-558cc280.js | Adds bundled Tableau10 palette helper (build artifact). |
| vs-code-extension/media/mermaid/Tableau10-31042135.js | Adds bundled Tableau10 palette helper (build artifact). |
| vs-code-extension/build.mjs | Copies third-party license notice into dist during build. |
| vs-code-extension/LICENCE-THIRD-PARTY.md | Adds third-party license notice within extension package scope. |
| docs-src/docs/Settings.md | Documents inline editor settings. |
| docs-src/docs/Inline Editor.md | Adds end-user inline editor documentation page. |
| docs-src/docs/Getting Started.md | Links getting started docs to inline editor docs. |
| TECHNICAL.md | Adds internal architecture notes for inline editor (syntax shadowing). |
| README.md | Adds inline editor overview and key settings to README. |
| LICENCE-THIRD-PARTY.md | Adds third-party license notice at repo root. |
| CHANGELOG.md | Documents inline editor features + conflict detection in pending release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let styles = styleArray ? styleArray.reduce((acc, style) => acc + ";" + style, "") : ""; | ||
| return styles; |
There was a problem hiding this comment.
getLabelStyles assumes styleArray is an array (uses .reduce()), but it’s called with edge.labelStyle, which is set to a string earlier (styles2String(edge) returns labelStyles as a string). This will throw at runtime (reduce is not a function) when start/end labels are present. Fix by either (a) making getLabelStyles accept both arrays and strings (return the string unchanged), or (b) stop calling getLabelStyles here and pass edge.labelStyle directly to createLabel_default.
| let styles = styleArray ? styleArray.reduce((acc, style) => acc + ";" + style, "") : ""; | |
| return styles; | |
| if (!styleArray) { | |
| return ""; | |
| } | |
| if (Array.isArray(styleArray)) { | |
| return styleArray.reduce((acc, style) => acc + ";" + style, ""); | |
| } | |
| if (typeof styleArray === "string") { | |
| return styleArray; | |
| } | |
| return ""; |
| const startLabelElement = await createLabel_default( | ||
| edge.startLabelLeft, | ||
| getLabelStyles(edge.labelStyle) | ||
| ); |
There was a problem hiding this comment.
getLabelStyles assumes styleArray is an array (uses .reduce()), but it’s called with edge.labelStyle, which is set to a string earlier (styles2String(edge) returns labelStyles as a string). This will throw at runtime (reduce is not a function) when start/end labels are present. Fix by either (a) making getLabelStyles accept both arrays and strings (return the string unchanged), or (b) stop calling getLabelStyles here and pass edge.labelStyle directly to createLabel_default.
| const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals"); | ||
| const inner = startEdgeLabelRight.insert("g").attr("class", "inner"); | ||
| fo = startEdgeLabelRight.node().appendChild(startLabelElement); | ||
| inner.node().appendChild(startLabelElement); | ||
| const slBox = startLabelElement.getBBox(); |
There was a problem hiding this comment.
The same DOM node (startLabelElement) is appended twice to two different parents. In the DOM, the second append will move the node, so only the last append 'wins' and fo will reference a node that is no longer under the original parent. This pattern appears in multiple start/end label branches; choose a single parent (typically inner.node()) and append only once, keeping fo consistent with the appended element.
| var drawEmbeddedImage = /* @__PURE__ */ __name((element, x, y, link) => { | ||
| const imageElement = element.append("use"); | ||
| imageElement.attr("x", x); | ||
| imageElement.attr("y", y); | ||
| const sanitizedLink = sanitizeUrl(link); | ||
| imageElement.attr("xlink:href", `#${sanitizedLink}`); |
There was a problem hiding this comment.
drawEmbeddedImage uses sanitizeUrl() (meant for URLs) and then forces it into an SVG fragment reference (#...). sanitizeUrl() can return values like about:blank (contains :) or full URLs, which aren’t valid element IDs and will break <use> references. For embedded references, sanitize/normalize to a valid SVG id token (or keep a separate code path that strictly accepts only fragment IDs) rather than treating it as a URL.
| var drawEmbeddedImage = /* @__PURE__ */ __name((element, x, y, link) => { | |
| const imageElement = element.append("use"); | |
| imageElement.attr("x", x); | |
| imageElement.attr("y", y); | |
| const sanitizedLink = sanitizeUrl(link); | |
| imageElement.attr("xlink:href", `#${sanitizedLink}`); | |
| const sanitizeFragmentId = (link) => { | |
| if (typeof link !== "string") { | |
| return ""; | |
| } | |
| let id = link; | |
| const hashIndex = id.lastIndexOf("#"); | |
| if (hashIndex !== -1) { | |
| id = id.slice(hashIndex + 1); | |
| } | |
| id = id.trim(); | |
| const idPattern = /^[A-Za-z_][A-Za-z0-9_.-]*$/; | |
| if (!idPattern.test(id)) { | |
| return ""; | |
| } | |
| return id; | |
| }; | |
| var drawEmbeddedImage = /* @__PURE__ */ __name((element, x, y, link) => { | |
| const imageElement = element.append("use"); | |
| imageElement.attr("x", x); | |
| imageElement.attr("y", y); | |
| const sanitizedId = sanitizeFragmentId(link); | |
| if (sanitizedId) { | |
| imageElement.attr("xlink:href", `#${sanitizedId}`); | |
| } |
| const rscratch = edge._private.rscratch; | ||
| const positionedEdge = { | ||
| id: data.id, | ||
| source: data.source, | ||
| target: data.target, | ||
| startX: rscratch.startX, | ||
| startY: rscratch.startY, | ||
| midX: rscratch.midX, | ||
| midY: rscratch.midY, | ||
| endX: rscratch.endX, | ||
| endY: rscratch.endY |
There was a problem hiding this comment.
This reads edge._private.rscratch, which is an internal Cytoscape implementation detail and can change between Cytoscape versions or layouts, creating brittle behavior. Prefer a public API to derive edge geometry (e.g., edge.sourceEndpoint(), edge.targetEndpoint(), and edge.midpoint() if available in your Cytoscape build), or store the needed points in a supported scratchpad/public field during layout execution instead of accessing _private.
| const rscratch = edge._private.rscratch; | |
| const positionedEdge = { | |
| id: data.id, | |
| source: data.source, | |
| target: data.target, | |
| startX: rscratch.startX, | |
| startY: rscratch.startY, | |
| midX: rscratch.midX, | |
| midY: rscratch.midY, | |
| endX: rscratch.endX, | |
| endY: rscratch.endY | |
| const sourcePoint = edge.sourceEndpoint(); | |
| const targetPoint = edge.targetEndpoint(); | |
| const midPoint = typeof edge.midpoint === "function" | |
| ? edge.midpoint() | |
| : { | |
| x: (sourcePoint.x + targetPoint.x) / 2, | |
| y: (sourcePoint.y + targetPoint.y) / 2 | |
| }; | |
| const positionedEdge = { | |
| id: data.id, | |
| source: data.source, | |
| target: data.target, | |
| startX: sourcePoint.x, | |
| startY: sourcePoint.y, | |
| midX: midPoint.x, | |
| midY: midPoint.y, | |
| endX: targetPoint.x, | |
| endY: targetPoint.y |
| const renderEl = select("body").append("div").attr("id", "cy").attr("style", "display:none"); | ||
| const cy = cytoscape({ | ||
| container: document.getElementById("cy"), | ||
| // container to render in | ||
| style: [ | ||
| { | ||
| selector: "edge", | ||
| style: { | ||
| "curve-style": "bezier" | ||
| } | ||
| } | ||
| ] | ||
| }); | ||
| renderEl.remove(); | ||
| addNodes(data.nodes, cy); | ||
| addEdges(data.edges, cy); |
There was a problem hiding this comment.
The temporary Cytoscape container is removed immediately after creating the instance. Some Cytoscape layouts/plugins rely on the container being present (even if hidden) for size/geometry calculations and event timing, which can cause nondeterministic layouts across environments. Consider either keeping the container until after layout completion/ready, or initialize Cytoscape in a supported headless mode (if compatible with the layout/plugin) to avoid DOM coupling.
| // Copy third-party licence notice to dist/ | ||
| copyFileSync( | ||
| resolve(__dirname, 'LICENCE-THIRD-PARTY.md'), |
There was a problem hiding this comment.
There are now two LICENCE-THIRD-PARTY.md files (repo root and vs-code-extension/LICENCE-THIRD-PARTY.md). This duplication is likely to drift over time. Consider keeping a single source of truth (e.g., only at repo root) and copying that into dist/, or generating the packaged notice from a shared path to ensure both locations stay identical.
| // Copy third-party licence notice to dist/ | |
| copyFileSync( | |
| resolve(__dirname, 'LICENCE-THIRD-PARTY.md'), | |
| // Copy third-party licence notice from repo root to dist/ | |
| copyFileSync( | |
| resolve(__dirname, '..', 'LICENCE-THIRD-PARTY.md'), |
No description provided.