@@ -1740,14 +1740,17 @@ test.describe("Workspace Manager V2 bootstrap", () => {
17401740 const widthInput = content.querySelector("#objectVectorStudioV2StrokeWidth").getBoundingClientRect();
17411741 const fillOpacityLabel = content.querySelector("label[for='objectVectorStudioV2FillOpacity']").getBoundingClientRect();
17421742 const strokeOpacityLabel = content.querySelector("label[for='objectVectorStudioV2StrokeOpacity']").getBoundingClientRect();
1743+ const opacityHeading = content.querySelector(".object-vector-studio-v2__palette-opacity-heading").getBoundingClientRect();
17431744 const opacityInputs = Array.from(opacityRow.querySelectorAll("input"));
17441745 const opacityInputRects = opacityInputs.map((input) => input.getBoundingClientRect());
17451746 return {
17461747 opacityBelowPrimary: fillOpacityLabel.top >= Math.max(paintButton.bottom, strokeButton.bottom, widthLabel.bottom),
1747- opacityInline: Math.abs((fillOpacityLabel.top + fillOpacityLabel.height / 2) - (strokeOpacityLabel.top + strokeOpacityLabel.height / 2)) < 4,
1748+ opacityHeading: content.querySelector(".object-vector-studio-v2__palette-opacity-heading").textContent.trim(),
1749+ opacityInline: [fillOpacityLabel, strokeOpacityLabel].every((rect) => Math.abs((opacityHeading.top + opacityHeading.height / 2) - (rect.top + rect.height / 2)) < 4),
17481750 opacityInputFitsFourDigits: opacityInputRects.every((rect) => Math.round(rect.width) >= 54),
17491751 opacityInputRanges: opacityInputs.map((input) => ({ max: input.max, min: input.min, step: input.step, value: input.value })),
17501752 opacityLabels: Array.from(opacityRow.querySelectorAll("label > span")).map((label) => label.textContent.trim()),
1753+ opacityOrder: Array.from(opacityRow.children).map((element) => element.textContent.trim().replace(/\s+/g, " ")),
17511754 primaryInline: [strokeButton, widthLabel].every((rect) => Math.abs((paintButton.top + paintButton.height / 2) - (rect.top + rect.height / 2)) < 4),
17521755 primaryOrder: Array.from(primaryRow.children).map((element) => element.textContent.trim()),
17531756 widthInputFitsXxDotX: Math.round(widthInput.width) >= 58,
@@ -1756,13 +1759,15 @@ test.describe("Workspace Manager V2 bootstrap", () => {
17561759 });
17571760 expect(paletteControlLayout).toEqual({
17581761 opacityBelowPrimary: true,
1762+ opacityHeading: "Opacity",
17591763 opacityInline: true,
17601764 opacityInputFitsFourDigits: true,
17611765 opacityInputRanges: [
17621766 { max: "255", min: "0", step: "1", value: "255" },
17631767 { max: "255", min: "0", step: "1", value: "255" }
17641768 ],
1765- opacityLabels: ["Fill Op", "Stroke Op"],
1769+ opacityLabels: ["Fill", "Stroke"],
1770+ opacityOrder: ["Opacity", "Fill", "Stroke"],
17661771 primaryInline: true,
17671772 primaryOrder: ["Paint", "Stroke", "Width"],
17681773 widthInputFitsXxDotX: true,
@@ -2625,9 +2630,15 @@ test.describe("Workspace Manager V2 bootstrap", () => {
26252630 await page.locator("#objectVectorStudioV2FillOpacity").dispatchEvent("change");
26262631 await expect(page.locator("#objectVectorStudioV2FillOpacity")).not.toHaveAttribute("aria-invalid", "true");
26272632 await expect(page.locator("#objectVectorStudioV2FillOpacity")).toHaveValue("128");
2633+ await expect(page.locator("#objectVectorStudioV2JsonDetails")).not.toContainText('"fillOpacity": 0.502');
2634+ await expect(page.locator("#objectVectorStudioV2RenderSurface [data-shape-index='1']")).toHaveAttribute("fill-opacity", "1");
2635+ await expect(page.locator("#statusLog")).toHaveValue(/OK Selected fill opacity 0\.502\./);
2636+ const shapeOneStyleAfterFillOpacityInput = await page.evaluate(() => ({ ...window.__objectVectorStudioV2App.selectedShape().style }));
2637+ expect(shapeOneStyleAfterFillOpacityInput.fillOpacity).toBe(1);
2638+ await clickPreviewShape(1);
26282639 await expect(page.locator("#objectVectorStudioV2JsonDetails")).toContainText('"fillOpacity": 0.502');
26292640 await expect(page.locator("#objectVectorStudioV2RenderSurface [data-shape-index='1']")).toHaveAttribute("fill-opacity", "0.502");
2630- await expect(page.locator("#statusLog")).toHaveValue(/OK Applied fill opacity 0\.502 to shape row 1\./);
2641+ await expect(page.locator("#statusLog")).toHaveValue(/OK Applied palette color #6fd3ff from cyan to shape row 1 by render surface click\. Target: paint opacity 0\.502 \./);
26312642 const shapeOneStyleBeforeStrokeMode = await page.evaluate(() => ({ ...window.__objectVectorStudioV2App.selectedShape().style }));
26322643 await page.locator("#objectVectorStudioV2StrokeModeButton").click();
26332644 await expect(page.locator("#statusLog")).toHaveValue(/OK Palette target set to Stroke\./);
@@ -2649,9 +2660,15 @@ test.describe("Workspace Manager V2 bootstrap", () => {
26492660 await page.locator("#objectVectorStudioV2StrokeOpacity").dispatchEvent("change");
26502661 await expect(page.locator("#objectVectorStudioV2StrokeOpacity")).not.toHaveAttribute("aria-invalid", "true");
26512662 await expect(page.locator("#objectVectorStudioV2StrokeOpacity")).toHaveValue("166");
2663+ await expect(page.locator("#objectVectorStudioV2JsonDetails")).not.toContainText('"strokeOpacity": 0.651');
2664+ await expect(page.locator("#objectVectorStudioV2RenderSurface [data-shape-index='1']")).toHaveAttribute("stroke-opacity", "1");
2665+ await expect(page.locator("#statusLog")).toHaveValue(/OK Selected stroke opacity 0\.651\./);
2666+ const shapeOneStyleAfterStrokeOpacityInput = await page.evaluate(() => ({ ...window.__objectVectorStudioV2App.selectedShape().style }));
2667+ expect(shapeOneStyleAfterStrokeOpacityInput.strokeOpacity).toBe(1);
2668+ await clickPreviewShape(1);
26522669 await expect(page.locator("#objectVectorStudioV2JsonDetails")).toContainText('"strokeOpacity": 0.651');
26532670 await expect(page.locator("#objectVectorStudioV2RenderSurface [data-shape-index='1']")).toHaveAttribute("stroke-opacity", "0.651");
2654- await expect(page.locator("#statusLog")).toHaveValue(/OK Applied stroke opacity 0\.651 to shape row 1\./);
2671+ await expect(page.locator("#statusLog")).toHaveValue(/OK Applied palette color #6fd3ff from cyan to shape row 1 by render surface click\. Target: stroke width 2, opacity 0\.651 \./);
26552672 await page.evaluate(() => {
26562673 window.__objectVectorStudioV2App.selectedStrokeColor = "#123456";
26572674 window.__objectVectorStudioV2App.selectedStrokeLabel = "manual rogue";
0 commit comments