Skip to content

Conversation

@Aqil-Ahmad
Copy link

@Aqil-Ahmad Aqil-Ahmad commented Oct 24, 2025

fixes: #1576
/claim #1576

before:
image

after:
image

@vercel
Copy link

vercel bot commented Oct 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview Comment Oct 24, 2025 9:23pm

Comment on lines 1 to 52
import { test, expect } from "bun:test"
import { getAllDimensionsForSchematicBox } from "lib/utils/schematic/getAllDimensionsForSchematicBox"

test("schPinSpacing should not change the width of the schematic box", () => {
// Test with different pin spacings but same port arrangement
const baseParams = {
schPortArrangement: {
leftSize: 2,
rightSize: 2,
topSize: 2,
bottomSize: 2,
},
pinCount: 8,
numericSchPinStyle: {},
}

// Get dimensions with default spacing (0.2)
const dims1 = getAllDimensionsForSchematicBox({
...baseParams,
schPinSpacing: 0.2,
})
const size1 = dims1.getSize()

// Get dimensions with larger spacing (0.5)
const dims2 = getAllDimensionsForSchematicBox({
...baseParams,
schPinSpacing: 0.5,
})
const size2 = dims2.getSize()

// Get dimensions with even larger spacing (1.0)
const dims3 = getAllDimensionsForSchematicBox({
...baseParams,
schPinSpacing: 1.0,
})
const size3 = dims3.getSize()

console.log("Width with spacing 0.2:", size1.width)
console.log("Width with spacing 0.5:", size2.width)
console.log("Width with spacing 1.0:", size3.width)
console.log("Height with spacing 0.2:", size1.height)
console.log("Height with spacing 0.5:", size2.height)
console.log("Height with spacing 1.0:", size3.height)

// Width should remain constant regardless of pin spacing
expect(size1.width).toBe(size2.width)
expect(size2.width).toBe(size3.width)

// Height is expected to change with spacing (left/right pins)
expect(size1.height).toBeLessThan(size2.height)
expect(size2.height).toBeLessThan(size3.height)
})
Copy link
Contributor

Choose a reason for hiding this comment

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

The test file name 'repro-schPinSpacing-changes-box-width.test.tsx' is inconsistent with the project's naming conventions. The file contains only one test function, but uses a very long descriptive name instead of following the kebab-case pattern or matching export names as specified in the file naming rule. Consider renaming to a shorter, more consistent name like 'sch-pin-spacing-box-width.test.tsx' or similar kebab-case format that aligns with the project's naming conventions.

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

Fix in Graphite


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

Copy link
Contributor

@nailoo nailoo left a comment

Choose a reason for hiding this comment

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

some workflows failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix schPinSpacing changing the width of the schematic box

2 participants