@@ -1520,6 +1520,10 @@ test.describe("Workspace Manager V2 bootstrap", () => {
15201520 render: icon("#objectVectorStudioV2GridRenderButton"),
15211521 snap: icon("#objectVectorStudioV2SnapModeButton")
15221522 },
1523+ inactiveIconColors: {
1524+ inactiveRectangle: getComputedStyle(document.querySelector("[data-shape-tool='rectangle'] .object-vector-studio-v2__shape-icon")).color,
1525+ snapAngle: getComputedStyle(document.querySelector("#objectVectorStudioV2AngleSnapButton")).color
1526+ },
15231527 modeButtons: {
15241528 paint: {
15251529 iconOrder: getComputedStyle(document.querySelector("#objectVectorStudioV2PaintModeButton"), "::before").order,
@@ -1684,20 +1688,22 @@ test.describe("Workspace Manager V2 bootstrap", () => {
16841688 expect(iconStyleState.viewportIcons.zoomOut.iconName).toBe("nf-oct-zoom_out");
16851689 expect(iconStyleState.titles).toEqual({
16861690 add: "Add a schema-valid object to the loaded payload",
1687- angle: "Angle Snap is wired to Object Transform Rotate. Enable it before pressing Rotate to round the entered rotation delta to 15 degree increments.",
1691+ angle: "Snap Angle is wired to Object Transform Rotate. Enable it before pressing Rotate to round the entered rotation delta to 15 degree increments.",
16881692 grid: "Show or hide the preview grid",
16891693 polygon: "Create a polygon shape on the selected object. Click to add points.\n\nDouble-click to finish.",
16901694 polyline: "Create a polyline shape on the selected object. Click to add points.\n\nDouble-click to finish.",
16911695 rename: "Disabled until a schema-valid object is selected.",
16921696 shape: "Create a rectangle shape on the selected object",
16931697 zoomIn: "Zoom the work surface in"
16941698 });
1699+ expect(new Set(Object.values(iconStyleState.inactiveIconColors)).size).toBe(1);
1700+ await expect(page.locator("#objectVectorStudioV2AngleSnapButton")).toHaveText("Snap Angle");
16951701 await page.locator("#objectVectorStudioV2AngleSnapButton").click();
16961702 await expect(page.locator("#objectVectorStudioV2AngleSnapButton")).toHaveAttribute("aria-pressed", "true");
1697- await expect(page.locator("#statusLog")).toHaveValue(/OK Angle snap enabled: Rotate action rounds entered rotation delta to 15 degree increments\./);
1703+ await expect(page.locator("#statusLog")).toHaveValue(/OK Snap angle enabled: Rotate action rounds entered rotation delta to 15 degree increments\./);
16981704 await page.locator("#objectVectorStudioV2AngleSnapButton").click();
16991705 await expect(page.locator("#objectVectorStudioV2AngleSnapButton")).toHaveAttribute("aria-pressed", "false");
1700- await expect(page.locator("#statusLog")).toHaveValue(/OK Angle snap disabled: Rotate action uses raw entered rotation delta\./);
1706+ await expect(page.locator("#statusLog")).toHaveValue(/OK Snap angle disabled: Rotate action uses raw entered rotation delta\./);
17011707
17021708 await drawDefaultObjectVectorShape(page, "rectangle");
17031709 await expect(page.locator('[data-shape-tool="rectangle"]')).toHaveAttribute("aria-pressed", "true");
@@ -2225,8 +2231,10 @@ test.describe("Workspace Manager V2 bootstrap", () => {
22252231 noApplyButton: !details.querySelector("#objectVectorStudioV2ApplyGeometryButton"),
22262232 noHelperText: !details.textContent.includes("Editable fields below"),
22272233 noSelectedShapeText: !details.textContent.includes("Selected Shape"),
2234+ pointStyleHeading: details.querySelector(".object-vector-studio-v2__point-style-heading")?.textContent.trim() || "",
22282235 pointStyleBeforeGroup: Boolean(pointStyleControls && groupSummary && (pointStyleControls.compareDocumentPosition(groupSummary) & Node.DOCUMENT_POSITION_FOLLOWING)),
22292236 pointStyleControls: Array.from(details.querySelectorAll("[data-shape-point-style-field]")).map((control) => ({
2237+ disabled: control.disabled,
22302238 label: control.closest("label").querySelector("span").textContent.trim(),
22312239 value: control.value
22322240 })),
@@ -2237,15 +2245,16 @@ test.describe("Workspace Manager V2 bootstrap", () => {
22372245 expect(shapeGeometryOrder.noApplyButton).toBe(true);
22382246 expect(shapeGeometryOrder.noHelperText).toBe(true);
22392247 expect(shapeGeometryOrder.noSelectedShapeText).toBe(true);
2248+ expect(shapeGeometryOrder.pointStyleHeading).toBe("Point Style:");
22402249 expect(shapeGeometryOrder.pointStyleBeforeGroup).toBe(true);
2241- expect(shapeGeometryOrder.pointStyleControls).toEqual([{ label: "Point Style ", value: "round" }]);
2250+ expect(shapeGeometryOrder.pointStyleControls).toEqual([{ disabled: false, label: "Joints ", value: "round" }]);
22422251 expect(shapeGeometryOrder.summaryItems).toEqual([
22432252 "Rectangle Geometry",
22442253 "Group",
22452254 "None"
22462255 ]);
22472256 await page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-shape-point-style-field='pointStyle']").selectOption("square");
2248- await expect(page.locator("#statusLog")).toHaveValue(/OK Updated Point Style to square for shape row 0\./);
2257+ await expect(page.locator("#statusLog")).toHaveValue(/OK Updated Joints to square for shape row 0\./);
22492258 const rectanglePointStyleRender = await page.locator("#objectVectorStudioV2RenderSurface [data-shape-index='0']").evaluate((shape) => ({
22502259 pointStyle: shape.dataset.pointStyle,
22512260 strokeLinejoin: shape.getAttribute("stroke-linejoin")
@@ -3685,6 +3694,11 @@ test.describe("Workspace Manager V2 bootstrap", () => {
36853694 await expect(page.locator("#objectVectorStudioV2SnapModeButton")).toHaveAttribute("data-snap-mode", "point");
36863695 await expect(page.locator("#objectVectorStudioV2SnapModeButton")).toHaveAttribute("aria-pressed", "true");
36873696 await expect(page.locator("#objectVectorStudioV2RenderSurface .object-vector-studio-v2__snap-target")).not.toHaveCount(0);
3697+ const snapPointColorState = await page.evaluate(() => ({
3698+ buttonColor: getComputedStyle(document.querySelector("#objectVectorStudioV2SnapModeButton")).color,
3699+ targetStroke: getComputedStyle(document.querySelector("#objectVectorStudioV2RenderSurface .object-vector-studio-v2__snap-target")).stroke
3700+ }));
3701+ expect(snapPointColorState.buttonColor).toBe(snapPointColorState.targetStroke);
36883702 await drawObjectVectorShape(page, "line", [{ x: 1.3, y: 2.2 }, { x: 4.2, y: 4.1 }]);
36893703 const pointSnappedLine = await page.evaluate(() => window.__objectVectorStudioV2App.selectedShape().geometry);
36903704 expect(pointSnappedLine).toEqual({ point1: { x: 1, y: 2 }, point2: { x: 4, y: 4 } });
@@ -3693,6 +3707,11 @@ test.describe("Workspace Manager V2 bootstrap", () => {
36933707 await expect(page.locator("#objectVectorStudioV2SnapModeButton")).toHaveText("Snap None");
36943708 await expect(page.locator("#objectVectorStudioV2SnapModeButton")).toHaveAttribute("data-snap-mode", "none");
36953709 await expect(page.locator("#objectVectorStudioV2SnapModeButton")).toHaveAttribute("aria-pressed", "false");
3710+ const snapNoneColorState = await page.evaluate(() => ({
3711+ disabledIconColor: getComputedStyle(document.querySelector("#objectVectorStudioV2AngleSnapButton")).color,
3712+ snapNoneColor: getComputedStyle(document.querySelector("#objectVectorStudioV2SnapModeButton")).color
3713+ }));
3714+ expect(snapNoneColorState.snapNoneColor).toBe(snapNoneColorState.disabledIconColor);
36963715 await drawObjectVectorShape(page, "line", [{ x: 5.25, y: 6.5 }, { x: 7.75, y: 8.25 }]);
36973716 const unsnappedLine = await page.evaluate(() => window.__objectVectorStudioV2App.selectedShape().geometry);
36983717 expect(unsnappedLine).toEqual({ point1: { x: 5.25, y: 6.5 }, point2: { x: 7.75, y: 8.25 } });
@@ -3732,7 +3751,7 @@ test.describe("Workspace Manager V2 bootstrap", () => {
37323751 await page.locator("#objectVectorStudioV2StrokeWidth").dispatchEvent("change");
37333752 await page.locator('[data-shape-tool="line"]').click();
37343753 await clickObjectVectorLogicalPoint(page, -40, -50);
3735- await moveObjectVectorLogicalPoint(page, { x: -10, y: -50 });
3754+ await moveObjectVectorLogicalPoint(page, { x: -10, y: -30 });
37363755 const wideStrokePreview = await page.locator("#objectVectorStudioV2RenderSurface .object-vector-studio-v2__drawing-preview").evaluate((preview) => ({
37373756 dash: preview.style.strokeDasharray,
37383757 strokeLinecap: preview.style.strokeLinecap,
@@ -3745,7 +3764,7 @@ test.describe("Workspace Manager V2 bootstrap", () => {
37453764 expect(wideStrokeDash[0]).toBeGreaterThan(5);
37463765 expect(wideStrokeDash[0]).toBeLessThan(220);
37473766 expect(wideStrokeDash[1]).toBeGreaterThan(4);
3748- await clickObjectVectorLogicalPoint(page, -10, -50 );
3767+ await clickObjectVectorLogicalPoint(page, -10, -30 );
37493768 const wideStrokeLine = await page.evaluate(() => {
37503769 const app = window.__objectVectorStudioV2App;
37513770 return {
@@ -3760,15 +3779,17 @@ test.describe("Workspace Manager V2 bootstrap", () => {
37603779 strokeWidth: 20
37613780 });
37623781 const openPointStyleControls = await page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-shape-point-style-field]").evaluateAll((controls) => controls.map((control) => ({
3782+ disabled: control.disabled,
37633783 label: control.closest("label").querySelector("span").textContent.trim(),
37643784 value: control.value
37653785 })));
37663786 expect(openPointStyleControls).toEqual([
3767- { label: "Start Point Style", value: "round" },
3768- { label: "End Point Style", value: "round" }
3787+ { disabled: false, label: "Start", value: "round" },
3788+ { disabled: true, label: "Joints", value: "round" },
3789+ { disabled: false, label: "End", value: "round" }
37693790 ]);
37703791 await page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-shape-point-style-field='endPointStyle']").selectOption("square");
3771- await expect(page.locator("#statusLog")).toHaveValue(/OK Updated End Point Style to square for shape row \d+\./);
3792+ await expect(page.locator("#statusLog")).toHaveValue(/OK Updated End to square for shape row \d+\./);
37723793 const wideStrokeLineAfterPointStyle = await page.evaluate(() => {
37733794 const app = window.__objectVectorStudioV2App;
37743795 return JSON.parse(JSON.stringify(app.selectedShape().style));
@@ -3790,12 +3811,26 @@ test.describe("Workspace Manager V2 bootstrap", () => {
37903811 const splitPointCaps = await page.locator(`#objectVectorStudioV2RenderSurface [data-point-style-caps='line'] [data-point-style-cap]`).evaluateAll((caps) => caps.map((cap) => ({
37913812 endpoint: cap.dataset.pointStyleCap,
37923813 pointStyle: cap.dataset.pointStyle,
3793- tag: cap.tagName.toLowerCase()
3814+ tag: cap.tagName.toLowerCase(),
3815+ transform: cap.getAttribute("transform") || ""
37943816 })));
3795- expect(splitPointCaps).toEqual([
3796- { endpoint: "start", pointStyle: "round", tag: "circle" },
3797- { endpoint: "end", pointStyle: "square", tag: "rect" }
3798- ]);
3817+ expect(splitPointCaps[0]).toMatchObject({ endpoint: "start", pointStyle: "round", tag: "circle", transform: "" });
3818+ expect(splitPointCaps[1]).toMatchObject({ endpoint: "end", pointStyle: "square", tag: "rect" });
3819+ expect(splitPointCaps[1].transform).toMatch(/^rotate\((?!0(?:\\.0+)? )/);
3820+
3821+ await page.locator('[data-shape-tool="polyline"]').click();
3822+ await clickObjectVectorLogicalPoint(page, 10, -40);
3823+ await clickObjectVectorLogicalPoint(page, 20, -20);
3824+ await clickObjectVectorLogicalPoint(page, 40, -40);
3825+ await page.keyboard.press("Enter");
3826+ await expect(page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-shape-point-style-field]")).toHaveCount(3);
3827+ await page.locator("#objectVectorStudioV2ShapeGeometryDetails [data-shape-point-style-field='pointStyle']").selectOption("square");
3828+ await expect(page.locator("#statusLog")).toHaveValue(/OK Updated Joints to square for shape row \d+\./);
3829+ const polylineJoinStyle = await page.locator(`#objectVectorStudioV2RenderSurface [data-shape-index="${await page.evaluate(() => window.__objectVectorStudioV2App.selectedShapeIndex)}"]`).evaluate((shape) => ({
3830+ jointStyle: shape.dataset.pointStyle || "",
3831+ strokeLinejoin: shape.getAttribute("stroke-linejoin")
3832+ }));
3833+ expect(polylineJoinStyle).toEqual({ jointStyle: "square", strokeLinejoin: "miter" });
37993834
38003835 await page.locator('[data-shape-tool="text"]').click();
38013836 await clickObjectVectorLogicalPoint(page, 70, 60);
0 commit comments