Skip to content

fix(vscode): use theme colours for canvas edges - #3359

Merged
rocketstack-matt merged 3 commits into
mainfrom
fix/3076-themed-arrowheads
Oct 15, 2026
Merged

rocketstack-matt merged 3 commits into
mainfrom
fix/3076-themed-arrowheads

Conversation

@markscott-ms

Copy link
Copy Markdown
Contributor

Description

Follow-up to #3076 and #3331. Fixes edge colour issues left in the CALM Canvas after #3331.

Issue Fix
Arrowheads stay React Flow's grey #b1b1b7 and do not change on hover Each edge draws its own arrowhead markers in the colour of its line
On hover, the arrowhead can be covered by other edges that end at the same point The hovered edge is drawn again in the edge label layer, which is above all edges and below the nodes
TooltipEdge ignores a stroke in the edge style The order is hover colour, then the edge style stroke, then the theme colour, as before #3331. The unused #94a3b8 strokes are removed
The line while dragging a new edge, and the CSS edge hover fallback, use a fixed #60a5fa (2.5:1 contrast on white) Both use --calm-link, the colour of a hovered edge

Technical notes:

  • A color on React Flow's markers does not work with theme variables. React Flow puts the colour in the marker id, and a var(..., #888888) value breaks the url('#…') reference. A shared marker also cannot follow the hover state of one edge.
  • The width and height in the markerEnd objects no longer have an effect. The arrowhead size is fixed at 15 in ArrowMarker, which is the value that all call sites use.
  • Labels now have zIndex: 1, so a hovered line goes under them.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Code style/formatting changes
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvements
  • ✅ Test additions or updates
  • 🔧 Chore (maintenance, dependencies, CI, etc.)

Affected Components

  • CLI (cli/)
  • Schema (calm/)
  • CALM AI (calm-ai/)
  • CALM Hub (calm-hub/)
  • CALM Hub UI (calm-hub-ui/)
  • CALM Server (calm-server/)
  • CALM Widgets (calm-widgets/)
  • Documentation (docs/)
  • Shared (shared/)
  • VS Code Extension (calm-plugins/vscode/)
  • Dependencies
  • CI/CD

Commit Message Format ✅

Testing

  • I have tested my changes locally
  • I have added/updated unit tests
  • All existing tests pass

Unit tests cover the marker ids, the marker colour and the stroke order. The hover overlay needs a running canvas, so I checked it visually in the webview, with several edges ending at one point.

Checklist

  • My commits follow the conventional commit format
  • I have updated documentation if necessary
  • I have added tests for my changes (if applicable)
  • My changes follow the project's coding standards

Each edge draws its own arrowheads in the colour of its line, so they
follow the VS Code theme and turn the link colour on hover. A hovered
edge is drawn again in the edge label layer, so edges that end at the
same point no longer cover its arrowhead.

TooltipEdge again keeps a stroke set in the edge style, and the unused
#94a3b8 strokes are removed.
… canvas

The connection line while dragging a new edge and the CSS edge hover
fallback used a fixed #60a5fa, which has low contrast in light themes.
They now use --calm-link, the colour of a hovered edge.

@rocketstack-matt rocketstack-matt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One regression inline.

React Flow passes an edge end with no marker as url('#'), which is truthy, so every edge got arrowheads at both ends.
@rocketstack-matt
rocketstack-matt merged commit 9e507cb into main Oct 15, 2026
23 checks passed
@rocketstack-matt
rocketstack-matt deleted the fix/3076-themed-arrowheads branch October 15, 2026 13:32
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