Skip to content

Commit 057965f

Browse files
author
DavidQ
committed
Refine point row layout and fix independent point rounding - PR_26133_081-point-row-layout-and-independent-rounding-fix
1 parent d5f965f commit 057965f

4 files changed

Lines changed: 78 additions & 10 deletions

File tree

docs/dev/reports/playwright_workspace_v2_results.md

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

3-
PR: PR_26133_080-point-rounding-and-point-delete-ui-fix
3+
PR: PR_26133_081-point-row-layout-and-independent-rounding-fix
44

55
## Validation
66

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

1313
## Targeted Checks Covered
1414

1515
- Shape Geometry point rows still render exactly one Round checkbox per row.
16-
- The global Delete Point(s) action no longer renders.
17-
- Editable point rows render a row-end trash button for deleting only that point.
18-
- Rounding checkboxes update only point rounding and do not delete rows.
19-
- Row trash deletion preserves independent rounding state for remaining points.
20-
- Deleting a point that would violate minimum geometry count is visibly rejected.
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.
2121

2222
## Console/Runtime Errors
2323

tests/playwright/tools/WorkspaceManagerV2.spec.mjs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3819,6 +3819,40 @@ test.describe("Workspace Manager V2 bootstrap", () => {
38193819
pointRounding: [false, true, false, false],
38203820
strokeLinejoin: "miter"
38213821
});
3822+
await page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-round='true'][data-polygon-point-index='2']").check();
3823+
await expect(page.locator("#statusLog")).toHaveValue(/OK Updated point 3 rounding to round for shape row \d+\./);
3824+
const polylineTwoRoundedJoints = await page.locator(`#objectVectorStudioV2RenderSurface [data-shape-index="${polylineIndex}"]`).evaluate((shape) => {
3825+
const markers = Array.from(document.querySelectorAll("#objectVectorStudioV2RenderSurface [data-point-style-caps='polyline'] [data-point-style-cap]")).map((marker) => marker.dataset.pointStyleCap);
3826+
return {
3827+
jointStyle: shape.dataset.pointStyle || "",
3828+
markers,
3829+
pointRounding: window.__objectVectorStudioV2App.selectedShape().style.pointRounding,
3830+
strokeLinejoin: shape.getAttribute("stroke-linejoin")
3831+
};
3832+
});
3833+
expect(polylineTwoRoundedJoints).toEqual({
3834+
jointStyle: "square",
3835+
markers: ["point-1", "point-2"],
3836+
pointRounding: [false, true, true, false],
3837+
strokeLinejoin: "miter"
3838+
});
3839+
await page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-round='true'][data-polygon-point-index='1']").uncheck();
3840+
await expect(page.locator("#statusLog")).toHaveValue(/OK Updated point 2 rounding to square for shape row \d+\./);
3841+
const polylineIndependentJoint = await page.locator(`#objectVectorStudioV2RenderSurface [data-shape-index="${polylineIndex}"]`).evaluate((shape) => {
3842+
const markers = Array.from(document.querySelectorAll("#objectVectorStudioV2RenderSurface [data-point-style-caps='polyline'] [data-point-style-cap]")).map((marker) => marker.dataset.pointStyleCap);
3843+
return {
3844+
jointStyle: shape.dataset.pointStyle || "",
3845+
markers,
3846+
pointRounding: window.__objectVectorStudioV2App.selectedShape().style.pointRounding,
3847+
strokeLinejoin: shape.getAttribute("stroke-linejoin")
3848+
};
3849+
});
3850+
expect(polylineIndependentJoint).toEqual({
3851+
jointStyle: "square",
3852+
markers: ["point-2"],
3853+
pointRounding: [false, false, true, false],
3854+
strokeLinejoin: "miter"
3855+
});
38223856

38233857
await page.locator('[data-shape-tool="text"]').click();
38243858
await clickObjectVectorLogicalPoint(page, 70, 60);
@@ -4000,6 +4034,23 @@ test.describe("Workspace Manager V2 bootstrap", () => {
40004034
await expect(page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-delete='true']")).toHaveCount(4);
40014035
await expect(page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-select='true']")).toHaveCount(0);
40024036
await expect.poll(() => page.locator("#objectVectorStudioV2ShapeGeometryDetails .object-vector-studio-v2__polygon-point-field").evaluateAll((rows) => rows.map((row) => row.querySelectorAll("input[type='checkbox']").length))).toEqual([1, 1, 1, 1]);
4037+
const polygonPointRowLayoutState = await page.locator("#objectVectorStudioV2ShapeGeometryDetails .object-vector-studio-v2__polygon-point-field").first().evaluate((row) => {
4038+
const actions = row.querySelector(".object-vector-studio-v2__polygon-point-actions");
4039+
return {
4040+
actionCellLast: row.lastElementChild === actions,
4041+
actionJustify: getComputedStyle(actions).justifyContent,
4042+
columnCount: getComputedStyle(row).gridTemplateColumns.split(" ").length,
4043+
deleteAfterRound: actions?.lastElementChild?.matches("[data-polygon-point-delete='true']") === true,
4044+
roundCheckboxes: actions?.querySelectorAll("[data-polygon-point-round='true']").length || 0
4045+
};
4046+
});
4047+
expect(polygonPointRowLayoutState).toEqual({
4048+
actionCellLast: true,
4049+
actionJustify: "flex-end",
4050+
columnCount: 4,
4051+
deleteAfterRound: true,
4052+
roundCheckboxes: 1
4053+
});
40034054
await page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-polygon-point-round='true'][data-polygon-point-index='1']").check();
40044055
await expect(page.locator("#statusLog")).toHaveValue(/OK Updated point 2 rounding to round for shape row 0\./);
40054056
await expect(page.locator("#objectVectorStudioV2ShapeGeometryDetails .object-vector-studio-v2__polygon-point-field")).toHaveCount(4);

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,9 @@ export class ToolStarterApp {
923923
return Array.from({ length: pointCount }, (_, index) => explicit[index] === true);
924924
}
925925
const geometryTool = shapeGeometryTool(shape);
926+
if (geometryTool === "polygon") {
927+
return Array.from({ length: pointCount }, () => false);
928+
}
926929
return Array.from({ length: pointCount }, (_, index) => {
927930
if (geometryTool === "line" || geometryTool === "polyline") {
928931
if (index === 0) {
@@ -931,6 +934,9 @@ export class ToolStarterApp {
931934
if (index === pointCount - 1) {
932935
return this.pointStyleValue(shape?.style?.endPointStyle ?? shape?.style?.strokeLinecap ?? shape?.style?.pointStyle) === "round";
933936
}
937+
if (geometryTool === "polyline") {
938+
return false;
939+
}
934940
}
935941
return this.pointStyleValue(shape?.style?.pointStyle ?? shape?.style?.strokeLinecap) === "round";
936942
});
@@ -2344,7 +2350,9 @@ export class ToolStarterApp {
23442350
roundCheckbox.addEventListener("click", (event) => event.stopPropagation());
23452351
roundCheckbox.addEventListener("change", () => this.updateSelectedShapePointRounding(index, roundCheckbox.checked));
23462352
roundLabel.append(roundCaption, roundCheckbox);
2347-
row.append(roundLabel);
2353+
const actions = document.createElement("div");
2354+
actions.className = "object-vector-studio-v2__polygon-point-actions";
2355+
actions.append(roundLabel);
23482356
if (deletable) {
23492357
const deleteButton = document.createElement("button");
23502358
deleteButton.type = "button";
@@ -2360,8 +2368,9 @@ export class ToolStarterApp {
23602368
event.stopPropagation();
23612369
this.deletePolygonPointRow(index, deleteButton);
23622370
});
2363-
row.append(deleteButton);
2371+
actions.append(deleteButton);
23642372
}
2373+
row.append(actions);
23652374
return row;
23662375
}
23672376

tools/object-vector-studio-v2/styles/toolStarter.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1674,7 +1674,7 @@ textarea:hover {
16741674

16751675
.object-vector-studio-v2__polygon-point-field {
16761676
display: grid;
1677-
grid-template-columns: 62px minmax(0, 1fr) minmax(0, 1fr) max-content 24px;
1677+
grid-template-columns: 62px minmax(54px, 1fr) minmax(54px, 1fr) minmax(82px, max-content);
16781678
align-items: center;
16791679
gap: 6px;
16801680
}
@@ -1724,6 +1724,14 @@ textarea:hover {
17241724
padding: 5px 7px;
17251725
}
17261726

1727+
.object-vector-studio-v2__polygon-point-actions {
1728+
min-width: 0;
1729+
display: inline-flex;
1730+
align-items: center;
1731+
justify-content: flex-end;
1732+
gap: 5px;
1733+
}
1734+
17271735
.object-vector-studio-v2__polygon-point-rounding {
17281736
display: inline-grid;
17291737
grid-template-columns: max-content 14px;

0 commit comments

Comments
 (0)