Skip to content

Commit 963bfec

Browse files
author
DavidQ
committed
Fix middle point rounding and verify Snap Angle rotate behavior - PR_26133_083-fix-middle-point-rounding-and-verify-snap-angle
1 parent cdbbdbb commit 963bfec

4 files changed

Lines changed: 95 additions & 12 deletions

File tree

docs/dev/reports/playwright_v8_coverage_report.md

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

3-
PR: PR_26133_081-point-row-layout-and-independent-rounding-fix
3+
PR: PR_26133_083-fix-middle-point-rounding-and-verify-snap-angle
44

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

@@ -21,9 +21,9 @@ 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 7011/7011; executed functions 712/750
24+
- (95%) tools/object-vector-studio-v2/js/ToolStarterApp.js - executed lines 7092/7092; executed functions 714/752
2525

2626
## Changed JS Files Considered
2727

28-
- (95%) tools/object-vector-studio-v2/js/ToolStarterApp.js - changed runtime JS file with browser V8 coverage
29-
- (0%) tests/playwright/tools/WorkspaceManagerV2.spec.mjs - Playwright test file, not collected as browser runtime coverage
28+
- (95%) tools/object-vector-studio-v2/js/ToolStarterApp.js - Object Vector Studio V2 runtime covered by browser V8 coverage while focused rounding and Snap Angle behavior was exercised.
29+
- (0%) tests/playwright/tools/WorkspaceManagerV2.spec.mjs - Playwright test file, not collected as browser runtime coverage.

docs/dev/reports/playwright_workspace_v2_results.md

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

3-
PR: PR_26133_081-point-row-layout-and-independent-rounding-fix
3+
PR: PR_26133_083-fix-middle-point-rounding-and-verify-snap-angle
44

55
## Validation
66

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

1313
## Targeted Checks Covered
1414

15-
- Shape Geometry point rows still render exactly one Round checkbox per row.
16-
- Point rows now use one right-aligned action cell containing Round and the row trash button.
17-
- Editable point row layout keeps Point, X, Y, and actions in four stable columns.
18-
- Polygon/polyline point-list shapes no longer inherit shared middle/corner rounding from legacy pointStyle fallback.
19-
- Checking two middle polyline points and then unchecking one leaves the other middle point rounded.
20-
- Row trash deletion and invalid delete rejection coverage remain green.
15+
- Shape Geometry point rows still render exactly one Round checkbox per point row.
16+
- Row-local plus buttons still insert a copied point directly after the current row.
17+
- Row-local trash buttons still delete only their row and reject invalid minimum-count deletion.
18+
- Polygon interior point rounding now verifies two rounded middle/corner points, then unrounds one and confirms the other stays rounded.
19+
- Polyline middle point rounding still verifies independent middle-joint round/unround behavior.
20+
- Arc start/end rounding still verifies independent endpoint controls.
21+
- Snap Angle Rotate is explicitly verified with Snap Angle enabled: Rotate input 22 applies 15 degrees using the current 15 degree snap increment.
22+
- Snap Angle disabled still applies the raw entered rotation delta.
2123

2224
## Console/Runtime Errors
2325

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Snap Angle Rotate Verification
2+
3+
PR: PR_26133_083-fix-middle-point-rounding-and-verify-snap-angle
4+
5+
## Status
6+
7+
- PASS: Snap Angle affects Object Transform Rotate when enabled.
8+
9+
## Validation
10+
11+
- PASS: npm run test:workspace-v2
12+
- Result: 54 passed
13+
- Focused coverage: tests/playwright/tools/WorkspaceManagerV2.spec.mjs
14+
15+
## Rotate Behavior Verified
16+
17+
- Enabled Snap Angle.
18+
- Entered Rotate value `22`.
19+
- Clicked Rotate.
20+
- PASS: selected shape transform rotation became `15`.
21+
- PASS: Rotate input stayed `22` while the applied delta snapped to the current 15 degree increment.
22+
- PASS: status log reported `Snap Angle active: 22 -> 15`.
23+
- Disabled Snap Angle.
24+
- Entered Rotate value `-30`.
25+
- PASS: Rotate applied the raw `-30` degree delta and the wrapped transform summary showed `rot 345`.
26+
27+
## Conclusion
28+
29+
PASS: Snap Angle Rotate behavior is verified and must not be marked complete without this passing coverage.

tests/playwright/tools/WorkspaceManagerV2.spec.mjs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2694,6 +2694,22 @@ test.describe("Workspace Manager V2 bootstrap", () => {
26942694
await expect(page.locator("#objectVectorStudioV2JsonDetails")).toContainText('"rotation": 15');
26952695
await expect(page.locator("#objectVectorStudioV2RotateInput")).toHaveValue("22");
26962696
await expect(page.locator("#statusLog")).toHaveValue(/OK Rotated shape row 0 by 15 degrees\. Snap Angle active: 22 -> 15\./);
2697+
const snapAngleRotateVerification = await page.evaluate(() => {
2698+
const shape = window.__objectVectorStudioV2App.selectedShape();
2699+
const statusLines = document.querySelector("#statusLog").value.trim().split("\n");
2700+
return {
2701+
angleSnapEnabled: window.__objectVectorStudioV2App.angleSnapEnabled,
2702+
inputValue: document.querySelector("#objectVectorStudioV2RotateInput").value,
2703+
rotation: shape.transform.rotation,
2704+
status: statusLines[statusLines.length - 1].replace(/^\[[^\]]+\]\s*/, "")
2705+
};
2706+
});
2707+
expect(snapAngleRotateVerification).toEqual({
2708+
angleSnapEnabled: true,
2709+
inputValue: "22",
2710+
rotation: 15,
2711+
status: "OK Rotated shape row 0 by 15 degrees. Snap Angle active: 22 -> 15."
2712+
});
26972713
await page.locator("#objectVectorStudioV2AngleSnapButton").click();
26982714
await page.locator("#objectVectorStudioV2RotateInput").fill("-30");
26992715
await expect(page.locator("#objectVectorStudioV2RotateInput")).toHaveValue("-30");
@@ -4075,6 +4091,42 @@ test.describe("Workspace Manager V2 bootstrap", () => {
40754091
pointRounding: [false, true, false, false],
40764092
strokeLinejoin: "miter"
40774093
});
4094+
await page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-round='true'][data-polygon-point-index='2']").check();
4095+
await expect(page.locator("#statusLog")).toHaveValue(/OK Updated point 3 rounding to round for shape row 0\./);
4096+
const twoInteriorPointsRounded = await page.locator("#objectVectorStudioV2RenderSurface").evaluate((surface) => {
4097+
const shape = surface.querySelector("[data-shape-index='0']");
4098+
const markers = Array.from(surface.querySelectorAll("[data-point-style-caps='polygon'] [data-point-style-cap]")).map((marker) => marker.dataset.pointStyleCap);
4099+
return {
4100+
markers,
4101+
pointRounding: window.__objectVectorStudioV2App.selectedShape().style.pointRounding,
4102+
strokeLinejoin: shape.getAttribute("stroke-linejoin")
4103+
};
4104+
});
4105+
expect(twoInteriorPointsRounded).toEqual({
4106+
markers: ["point-1", "point-2"],
4107+
pointRounding: [false, true, true, false],
4108+
strokeLinejoin: "miter"
4109+
});
4110+
await page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-round='true'][data-polygon-point-index='1']").uncheck();
4111+
await expect(page.locator("#statusLog")).toHaveValue(/OK Updated point 2 rounding to square for shape row 0\./);
4112+
const independentInteriorPoint = await page.locator("#objectVectorStudioV2RenderSurface").evaluate((surface) => {
4113+
const shape = surface.querySelector("[data-shape-index='0']");
4114+
const markers = Array.from(surface.querySelectorAll("[data-point-style-caps='polygon'] [data-point-style-cap]")).map((marker) => marker.dataset.pointStyleCap);
4115+
return {
4116+
markers,
4117+
pointRounding: window.__objectVectorStudioV2App.selectedShape().style.pointRounding,
4118+
strokeLinejoin: shape.getAttribute("stroke-linejoin")
4119+
};
4120+
});
4121+
expect(independentInteriorPoint).toEqual({
4122+
markers: ["point-2"],
4123+
pointRounding: [false, false, true, false],
4124+
strokeLinejoin: "miter"
4125+
});
4126+
await page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-round='true'][data-polygon-point-index='1']").check();
4127+
await expect(page.locator("#statusLog")).toHaveValue(/OK Updated point 2 rounding to round for shape row 0\./);
4128+
await page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-round='true'][data-polygon-point-index='2']").uncheck();
4129+
await expect(page.locator("#statusLog")).toHaveValue(/OK Updated point 3 rounding to square for shape row 0\./);
40784130
await page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-add='true'][data-polygon-point-index='1']").click();
40794131
await expect.poll(() => page.locator("#objectVectorStudioV2ShapeGeometryDetails .object-vector-studio-v2__polygon-point-field").evaluateAll((rows) => rows.map((row) => ({
40804132
label: row.querySelector(".object-vector-studio-v2__polygon-point-label").textContent.trim(),

0 commit comments

Comments
 (0)