Skip to content

v0.6.19 — per-edge connection color (hex picker)

Choose a tag to compare

@wwppee wwppee released this 16 Jul 00:55

v0.6.19 — Per-edge connection color (hex picker)

Each /compose edge can now pick its own color. The Inspector gets a
native color swatch next to the existing label / kind / direction
controls, and the SVG line + arrow head render in the picked color
through the existing currentColor cascade — no new marker shapes.

What you get

  • Inspector gets a 4th control: <input type="color"> for the hex
    swatch, plus a small reset button (visible only when a color is
    set). Click reset to drop the override and fall back to the theme
    accent — same as a v0.6.18 edge.
  • Canvas threads the color through style.color on the wrapping
    <g>. The line stroke and the marker fill both consume
    currentColor, so the single style change cascades to both ends.
    Selected vs unselected markers still differ via the existing
    markerId swap; the color is independent of selection state.
  • Format is hex-only#rgb / #rgba / #rrggbb / #rrggbbaa.
    Named colors and rgb() / hsl() are deliberately rejected so the
    "use theme accent" semantic stays clean (a user who wants theme
    default should leave the field empty, not set a color that
    coincidentally matches).

Files touched (15)

Area Files
Schema web/src/lib/types.ts, src/core/compose-boards.ts (zod regex + v5 version union)
Compose state web/src/lib/compose-history.ts, web/src/app/compose/ComposeBoard.tsx
UI web/src/app/compose/Inspector.tsx, web/src/app/compose/ConnectionPath.tsx
i18n web/src/lib/i18n/types.ts, web/src/lib/i18n/dict.en.ts, web/src/lib/i18n/dict.zh.ts (+5 keys)
Docs CHANGELOG.md, docs/roadmap.md
Tests 2 schema + 4 history + 2 backward-compat (v4↔v5 round-trip)

Backward compat

color is optional in the schema and omitted by default
same pattern as v0.6.18's dir field. A v0.6.18 board saved before
this release round-trips through v0.6.19 byte-identical (no
color: undefined floating around, no migration script needed).
The schema is now v5; v1 / v2 / v3 / v4 boards all continue to load.

Why a minor bump

Same hotfix / additive-feature precedent as v0.6.6, v0.6.13, v0.6.17,
v0.6.18: v0.6.19 is purely additive (every v0.6.18 board still opens
and edits fine), so a minor bump is in line with the project's
release-please conventions.

Backlog after v0.6.19

  • v0.6.20 — auto-route (avoid overlapping edges on the canvas)
  • v0.6.21 — hooks 抽离 (move web/src/app/api hooks into src/hooks/)
  • placeholder parameter audit (15 keys remain hardcoded)
  • per-direction palette (e.g. "all forward connections get this
    color") — deferred; per-edge is the v0.6.19 minimum and the
    schema's color?: string field already supports a future palette
    expansion without a v6 bump.