Skip to content

Commit 20d1991

Browse files
author
DavidQ
committed
Make middle joint rounding fully independent per Shape Geometry point - PR_26133_079-independent-middle-joint-rounding
1 parent d75290d commit 20d1991

4 files changed

Lines changed: 37 additions & 28 deletions

File tree

docs/dev/reports/playwright_v8_coverage_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Playwright V8 Coverage Report
22

3-
PR: PR_26133_078-point-rounding-checkbox-correction
3+
PR: PR_26133_079-independent-middle-joint-rounding
44

55
Source: docs/dev/reports/playwright_v8_coverage_report.txt generated by the latest npm run test:workspace-v2 run.
66

@@ -21,7 +21,7 @@ Source: docs/dev/reports/playwright_v8_coverage_report.txt generated by the late
2121

2222
## Changed Runtime JS Files Covered
2323

24-
- (95%) tools/object-vector-studio-v2/js/ToolStarterApp.js - executed lines 6968/6968; executed functions 717/751
24+
- (95%) tools/object-vector-studio-v2/js/ToolStarterApp.js - executed lines 6964/6964; executed functions 711/746
2525

2626
## Changed JS Files Considered
2727

docs/dev/reports/playwright_workspace_v2_results.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
# Playwright Workspace V2 Results
22

3-
PR: PR_26133_078-point-rounding-checkbox-correction
3+
PR: PR_26133_079-independent-middle-joint-rounding
44

55
## Validation
66

77
- PASS: npm run test:workspace-v2
88
- Result: 54 passed
9-
- Runtime: 5.2m
9+
- Runtime: 5.8m
1010
- Browser project: playwright
1111
- Workers: 1
1212

1313
## Targeted Checks Covered
1414

15-
- Shape Geometry point rows now render exactly one checkbox per row.
16-
- The remaining checkbox is the Round control; unchecked rows render square and checked rows render round.
17-
- The old second point-selection checkbox was removed from polygon/polyline/triangle point rows.
18-
- Add/Delete point row targeting now uses row selection state instead of an extra checkbox.
19-
- No global Start/Joints/End or Joints point-style controls remain.
20-
- Independent per-point rounding coverage remains in place for open and closed multi-point geometry.
15+
- Shape Geometry point rows still render exactly one Round checkbox per row.
16+
- Checking one middle polyline point now renders only that point's round marker.
17+
- Other middle joints remain square/miter and are not globally rounded.
18+
- Start and end point rounding behavior remains independent.
19+
- No global Start/Joints/End or Joints point-style controls are used for point rounding.
2120

2221
## Console/Runtime Errors
2322

tests/playwright/tools/WorkspaceManagerV2.spec.mjs

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3792,19 +3792,33 @@ test.describe("Workspace Manager V2 bootstrap", () => {
37923792
await clickObjectVectorLogicalPoint(page, 10, -40);
37933793
await clickObjectVectorLogicalPoint(page, 20, -20);
37943794
await clickObjectVectorLogicalPoint(page, 40, -40);
3795+
await clickObjectVectorLogicalPoint(page, 55, -20);
37953796
await page.keyboard.press("Enter");
37963797
await expect(page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-shape-point-style-field]")).toHaveCount(0);
3797-
await expect(page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-round='true']")).toHaveCount(3);
3798-
await expect.poll(() => page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-round='true']").evaluateAll((checkboxes) => checkboxes.map((checkbox) => checkbox.checked))).toEqual([false, false, false]);
3798+
await expect(page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-round='true']")).toHaveCount(4);
3799+
await expect.poll(() => page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-round='true']").evaluateAll((checkboxes) => checkboxes.map((checkbox) => checkbox.checked))).toEqual([false, false, false, false]);
37993800
await page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-round='true'][data-polygon-point-index='1']").check();
38003801
await expect(page.locator("#statusLog")).toHaveValue(/OK Updated point 2 rounding to round for shape row \d+\./);
38013802
const polylineIndex = await page.evaluate(() => window.__objectVectorStudioV2App.selectedShapeIndex);
3802-
const polylineJoinStyle = await page.locator(`#objectVectorStudioV2RenderSurface [data-shape-index="${polylineIndex}"]`).evaluate((shape) => ({
3803-
jointStyle: shape.dataset.pointStyle || "",
3804-
pointRounding: window.__objectVectorStudioV2App.selectedShape().style.pointRounding,
3805-
strokeLinejoin: shape.getAttribute("stroke-linejoin")
3806-
}));
3807-
expect(polylineJoinStyle).toEqual({ jointStyle: "round", pointRounding: [false, true, false], strokeLinejoin: "round" });
3803+
const polylineJoinStyle = await page.locator(`#objectVectorStudioV2RenderSurface [data-shape-index="${polylineIndex}"]`).evaluate((shape) => {
3804+
const markers = Array.from(document.querySelectorAll("#objectVectorStudioV2RenderSurface [data-point-style-caps='polyline'] [data-point-style-cap]")).map((marker) => ({
3805+
id: marker.dataset.pointStyleCap,
3806+
pointStyle: marker.dataset.pointStyle,
3807+
tag: marker.tagName.toLowerCase()
3808+
}));
3809+
return {
3810+
jointStyle: shape.dataset.pointStyle || "",
3811+
markers,
3812+
pointRounding: window.__objectVectorStudioV2App.selectedShape().style.pointRounding,
3813+
strokeLinejoin: shape.getAttribute("stroke-linejoin")
3814+
};
3815+
});
3816+
expect(polylineJoinStyle).toEqual({
3817+
jointStyle: "square",
3818+
markers: [{ id: "point-1", pointStyle: "round", tag: "circle" }],
3819+
pointRounding: [false, true, false, false],
3820+
strokeLinejoin: "miter"
3821+
});
38083822

38093823
await page.locator('[data-shape-tool="text"]').click();
38103824
await clickObjectVectorLogicalPoint(page, 70, 60);

tools/object-vector-studio-v2/js/ToolStarterApp.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -869,11 +869,11 @@ export class ToolStarterApp {
869869
shapeUnifiedPointStyle(shape) {
870870
const pointStyles = this.shapePointStyleValues(shape);
871871
if (pointStyles.length) {
872-
const joinIndexes = this.shapeJoinPointIndexes(shape, pointStyles.length);
873-
if (!joinIndexes.length) {
874-
return this.pointStyleValue(shape?.style?.pointStyle ?? shape?.style?.strokeLinecap);
872+
const geometryTool = shapeGeometryTool(shape);
873+
if (geometryTool === "polygon" || geometryTool === "polyline") {
874+
return "square";
875875
}
876-
return joinIndexes.every((index) => pointStyles[index] === "round") ? "round" : "square";
876+
return this.pointStyleValue(shape?.style?.pointStyle ?? shape?.style?.strokeLinecap);
877877
}
878878
return this.pointStyleValue(shape?.style?.pointStyle ?? shape?.style?.strokeLinecap);
879879
}
@@ -3170,13 +3170,10 @@ export class ToolStarterApp {
31703170
}
31713171
const points = this.shapeGeometryPoints(shape);
31723172
const styles = this.shapePointStyleValues(shape);
3173-
const joinIndexes = this.shapeJoinPointIndexes(shape, points.length);
3174-
const allJoinsRound = joinIndexes.length && joinIndexes.every((index) => styles[index] === "round");
31753173
return points
31763174
.map((point, index) => ({ index, point, pointStyle: styles[index] }))
31773175
.filter(({ index, pointStyle }) => pointStyle === "round"
3178-
&& !(geometryTool === "polyline" && (index === 0 || index === points.length - 1))
3179-
&& !(allJoinsRound && joinIndexes.includes(index)))
3176+
&& !(geometryTool === "polyline" && (index === 0 || index === points.length - 1)))
31803177
.map(({ index, point, pointStyle }) => ({
31813178
markerId: `point-${index}`,
31823179
point,
@@ -6243,8 +6240,7 @@ export class ToolStarterApp {
62436240
delete shape.style.strokeLinecap;
62446241
shape.style.startPointStyle = normalized[0] ? "round" : "square";
62456242
shape.style.endPointStyle = normalized.at(-1) ? "round" : "square";
6246-
const joinIndexes = this.shapeJoinPointIndexes(shape, normalized.length);
6247-
shape.style.pointStyle = joinIndexes.length && joinIndexes.every((index) => normalized[index]) ? "round" : "square";
6243+
shape.style.pointStyle = "square";
62486244
}
62496245

62506246
rebuildPolygonPointList(points, pointRounding = null) {

0 commit comments

Comments
 (0)