Skip to content

Add dash length and gap support to schematic line and path#586

Merged
seveibar merged 1 commit into
mainfrom
codex/cj-introduce-dashgap-and-dashlength
May 26, 2026
Merged

Add dash length and gap support to schematic line and path#586
seveibar merged 1 commit into
mainfrom
codex/cj-introduce-dashgap-and-dashlength

Conversation

@seveibar
Copy link
Copy Markdown
Contributor

Summary

  • Added optional dash_length and dash_gap distance fields to schematic_line and schematic_path
  • Updated the generated schematic docs and README schema excerpts to match the new fields
  • Added tests covering default absence and distance parsing for both shapes

Testing

  • bun test
  • bunx tsc --noEmit
  • bun run scripts/zod-lint.ts
  • git diff --check

@seveibar seveibar requested a review from Sang-it May 26, 2026 20:38
@seveibar seveibar marked this pull request as ready for review May 26, 2026 20:38
Comment on lines 7 to 54
@@ -17,6 +18,39 @@ test("schematic_line defaults stroke width and color", () => {
expect(line.schematic_line_id).toMatch(/^schematic_line_/)
expect(line.color).toBe("#000000")
expect(line.is_dashed).toBe(false)
expect(line).not.toHaveProperty("dash_length")
expect(line).not.toHaveProperty("dash_gap")
})

test("schematic_line accepts dash distance parameters", () => {
const line = schematic_line.parse({
type: "schematic_line",
x1: 0,
y1: 0,
x2: 1,
y2: 1,
is_dashed: true,
dash_length: "2mm",
dash_gap: "1mm",
})

expect(line.dash_length).toBe(2)
expect(line.dash_gap).toBe(1)
})

test("schematic_path accepts dash distance parameters", () => {
const path = schematic_path.parse({
type: "schematic_path",
points: [
{ x: 0, y: 0 },
{ x: 1, y: 1 },
],
dash_length: "2mm",
dash_gap: "1mm",
})

expect(path.dash_length).toBe(2)
expect(path.dash_gap).toBe(1)
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file now contains multiple test(...) calls (at least 4: 'schematic_line defaults stroke width and color', 'schematic_line accepts dash distance parameters', 'schematic_path accepts dash distance parameters', and 'schematic_rect assigns defaults'). The rule states that a *.test.ts file may have AT MOST one test(...). The tests should be split into multiple numbered files, e.g. schematic_shapes1.test.ts, schematic_shapes2.test.ts, etc. — or named more specifically per shape, e.g. schematic_line1.test.ts, schematic_line2.test.ts, schematic_path1.test.ts, schematic_rect1.test.ts.

Suggested change
test("schematic_line defaults stroke width and color", () => {
const line = schematic_line.parse({
expect(line.schematic_line_id).toMatch(/^schematic_line_/)
expect(line.color).toBe("#000000")
expect(line.is_dashed).toBe(false)
expect(line).not.toHaveProperty("dash_length")
expect(line).not.toHaveProperty("dash_gap")
})

Spotted by Graphite (based on custom rule: Custom rule)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@seveibar seveibar merged commit 19cc44c into main May 26, 2026
5 checks passed
@seveibar seveibar deleted the codex/cj-introduce-dashgap-and-dashlength branch May 26, 2026 22:29
@tscircuitbot
Copy link
Copy Markdown
Contributor


Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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