Skip to content

✨ Allow custom underline styles#10

Draft
nwingt wants to merge 1 commit intolikecoin:masterfrom
nwingt:develop
Draft

✨ Allow custom underline styles#10
nwingt wants to merge 1 commit intolikecoin:masterfrom
nwingt:develop

Conversation

@nwingt
Copy link
Copy Markdown
Member

@nwingt nwingt commented Mar 30, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enables consumers of the marks pane underline renderer to customize underline appearance via passed-in SVG attributes, instead of hard-coded defaults.

Changes:

  • Allow fill to be overridden for the underline bounding <rect>.
  • Allow stroke, stroke-width, and stroke-linecap to be overridden for the underline <line>.
  • Preserve existing visual defaults when no custom attributes are provided.

Comment on lines +316 to +326
rect.setAttribute("fill", this.attributes.fill || "none");

const line = svgCreate("line");
line.setAttribute("x1", String(r.left - offset.left + container.left));
line.setAttribute("x2", String(r.left - offset.left + container.left + r.width));
line.setAttribute("y1", String(r.top - offset.top + container.top + r.height - 1));
line.setAttribute("y2", String(r.top - offset.top + container.top + r.height - 1));

line.setAttribute("stroke-width", "1");
line.setAttribute("stroke", "black");
line.setAttribute("stroke-linecap", "square");
line.setAttribute("stroke-width", this.attributes["stroke-width"] || "1");
line.setAttribute("stroke", this.attributes.stroke || "black");
line.setAttribute("stroke-linecap", this.attributes["stroke-linecap"] || "square");
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

The new underline style overrides (fill / stroke-width / stroke / stroke-linecap) aren’t covered by tests. There’s already a marks-pane test suite; consider adding a test that mocks Range.getClientRects to return at least one DOMRect so render() produces elements, then assert the generated / attributes reflect the provided attributes (and defaults when omitted).

Copilot generated this review using guidance from repository custom instructions.
@nwingt nwingt requested a review from williamchong March 30, 2026 17:22
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.

3 participants