Skip to content

Derive line-style icons and edge-detail line from CSS border style #1986

Description

@kmcginnes

Task

Line styles (solid/dashed/dotted) are currently represented three different ways:

  1. Hand-drawn LineSolid/LineDashed/LineDotted SVG icons in the style-dialog dropdowns.
  2. A styleForLineStyle() helper in EdgeDetail.tsx that hand-writes gradient CSS for the vertical connector line between the arrows.
  3. EdgePreview.tsx, which already renders the real line via borderTopStyle: edgeStyle.lineStyle.

The LineStyle values are valid CSS border-style keywords, so #1 and #2 are hand-rolled duplicates of what CSS gives for free (as demonstrated by #3). Additionally, LINE_STYLE_OPTIONS is defined twice (EdgesStyling/lineStyling.tsx and NodesStyling/lineStyling.tsx), and the NodesStyling copy carries unused render wrappers.

Scope

  • Add a LineStyleIcon drawn with borderTopStyle: lineStyle + currentColor (same native mechanism as the edge preview); replace the 3 SVG icons.
  • Replace EdgeDetail's styleForLineStyle() gradients with a border-based vertical line; delete the helper.
  • Consolidate the two LINE_STYLE_OPTIONS into one { label, value }[] (mirroring ARROW_STYLE_OPTIONS); delete both lineStyling.tsx files.
  • Move the icon before the label in the Line Style and Border Style dropdowns (both dialogs), matching the arrow-style dropdowns.
  • Delete LineSolid/LineDashed/LineDotted icon files and their barrel exports.

Notes

Follow-up to the arrow-icon dedup (#1985); same single-source-of-truth pattern.

Important

Internal only — this issue is maintained by the core team and is not accepting external contributions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    internalSignals that the team will work on this issue internally.tech debtIssues, typically tasks, that are mainly about cleaning up code that is problematic in some way

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions