Skip to content

Commit 07ead6c

Browse files
author
DavidQ
committed
Rename Auto Center to Auto Origin and align pivot terminology - PR_26133_089-auto-origin-terminology-final-polish
1 parent 78d824d commit 07ead6c

5 files changed

Lines changed: 75 additions & 70 deletions

File tree

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

3-
PR: PR_26133_088-select-all-rotate-auto-center-placement-and-copy-icon
3+
PR: PR_26133_089-auto-origin-terminology-final-polish
44

55
Command: `npm run test:workspace-v2`
66

@@ -9,10 +9,10 @@ Result: PASS
99
Coverage source: Playwright/Chromium built-in V8 coverage from the final passing workspace-v2 run.
1010

1111
Changed runtime JS coverage:
12-
- `tools/object-vector-studio-v2/js/bootstrap.js`: 83% entry coverage, 109/109 executed lines, 5/6 executed functions.
1312
- `tools/object-vector-studio-v2/js/ToolStarterApp.js`: 95% entry coverage, 7574/7574 executed lines, 771/809 executed functions.
1413

1514
Notes:
1615
- The generated detailed text artifact remains at `docs/dev/reports/playwright_v8_coverage_report.txt`.
1716
- Coverage is advisory for this PR; no new thresholds were introduced.
18-
- Changed runtime JS files were exercised by the passing Playwright run.
17+
- The changed runtime JS file was exercised by the passing Playwright run.
18+
- `tools/object-vector-studio-v2/js/bootstrap.js` remains covered by the run but is not changed by PR089.
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
# Playwright Workspace V2 Results
22

3-
PR: PR_26133_088-select-all-rotate-auto-center-placement-and-copy-icon
3+
PR: PR_26133_089-auto-origin-terminology-final-polish
44

55
Command: `npm run test:workspace-v2`
66

77
Result: PASS
88

99
Summary:
1010
- 54/54 Playwright tests passed.
11-
- Final run completed in 5.7 minutes.
12-
- Select All / explicit selected-set Rotate coverage verifies the full selected shape set rotates around the selected-set bounds center while preserving relative shape positions.
13-
- Single-shape Rotate and existing grouped-shape Rotate coverage remain in place and passed.
14-
- Auto Center now renders in Object Transform under Scale and continues to update the selected shape origin/pivot without changing geometry or moving visible bounds.
15-
- Copy now uses the `nf-fa-copy` Nerd Font glyph.
11+
- Final run completed in 5.5 minutes.
12+
- Object Transform now shows `Auto Origin` directly under the Origin X/Y/Apply row.
13+
- The origin-balancing action no longer uses Auto Center or Balance Center wording.
14+
- Auto Origin coverage verifies origin/pivot recalculation from visible object bounds without changing geometry or moving visible bounds, and dirty state is set through the existing transform update path.
15+
- Select All rotation behavior from PR088 remains covered and passing.
16+
- Copy icon remains `nf-fa-copy`.
1617
- Existing console/page error assertions remained clean in the covered flows.
1718

1819
Manual/targeted verification notes:
19-
- Object Transform layout shows Scale, then Auto Center, then the transform summary.
20-
- Auto Center logs OK after successful center/pivot balancing and marks the workspace dirty through the existing transform update path.
21-
- Selected-set rotation updates preview/bounds immediately after Rotate.
20+
- Origin controls remain grouped together: Origin row followed immediately by Auto Origin.
21+
- Preview Center dot control remains separate and unchanged.
22+
- Auto Origin logs an OK status after successful origin/pivot update.

tests/playwright/tools/WorkspaceManagerV2.spec.mjs

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,37 +2187,41 @@ test.describe("Workspace Manager V2 bootstrap", () => {
21872187
await expect(page.locator("#objectVectorStudioV2ObjectTransform .object-vector-studio-v2__transform-summary")).toHaveText("x 0, y 0, rot 0, scale 1");
21882188
await expect(page.locator("#objectVectorStudioV2ObjectTransform #objectVectorStudioV2MoveShapeButton")).toHaveCount(1);
21892189
const transformSummaryLayout = await page.locator("#objectVectorStudioV2ObjectTransform").evaluate((panel) => {
2190+
const originRow = panel.querySelector(".object-vector-studio-v2__transform-control-row--origin");
2191+
const rotateRow = panel.querySelector(".object-vector-studio-v2__transform-control-row--rotate");
21902192
const scaleRow = panel.querySelector(".object-vector-studio-v2__scale-control-row");
2191-
const autoCenterRow = panel.querySelector(".object-vector-studio-v2__transform-control-row--auto-center");
2192-
const autoCenterButton = panel.querySelector("#objectVectorStudioV2AutoCenterButton");
2193+
const autoOriginRow = panel.querySelector(".object-vector-studio-v2__transform-control-row--auto-origin");
2194+
const autoOriginButton = panel.querySelector("#objectVectorStudioV2AutoOriginButton");
21932195
const summary = panel.querySelector(".object-vector-studio-v2__transform-summary");
21942196
const summaryStyle = getComputedStyle(summary);
21952197
return {
2196-
autoCenterAfterScale: Boolean(scaleRow && autoCenterRow && (scaleRow.compareDocumentPosition(autoCenterRow) & Node.DOCUMENT_POSITION_FOLLOWING)),
2197-
autoCenterButtonText: autoCenterButton?.textContent.trim() || "",
2198-
autoCenterTitle: autoCenterButton?.title || "",
2199-
summaryAfterAutoCenter: Boolean(autoCenterRow && summary && (autoCenterRow.compareDocumentPosition(summary) & Node.DOCUMENT_POSITION_FOLLOWING)),
2198+
autoOriginAfterOrigin: Boolean(originRow && autoOriginRow && (originRow.compareDocumentPosition(autoOriginRow) & Node.DOCUMENT_POSITION_FOLLOWING)),
2199+
autoOriginBeforeRotate: Boolean(autoOriginRow && rotateRow && (autoOriginRow.compareDocumentPosition(rotateRow) & Node.DOCUMENT_POSITION_FOLLOWING)),
2200+
autoOriginButtonText: autoOriginButton?.textContent.trim() || "",
2201+
autoOriginTitle: autoOriginButton?.title || "",
2202+
autoOriginUsesCenterWord: Boolean(autoOriginRow?.textContent.includes("Center") || autoOriginButton?.title.includes("Center")),
22002203
summaryAfterScale: Boolean(scaleRow && summary && (scaleRow.compareDocumentPosition(summary) & Node.DOCUMENT_POSITION_FOLLOWING)),
22012204
summaryCentered: summaryStyle.textAlign === "center",
22022205
summaryStartsWithoutTransform: !summary.textContent.trim().startsWith("Transform"),
2203-
summaryTopAtBottom: summary.getBoundingClientRect().top >= autoCenterRow.getBoundingClientRect().bottom
2206+
summaryTopAtBottom: summary.getBoundingClientRect().top >= scaleRow.getBoundingClientRect().bottom
22042207
};
22052208
});
22062209
expect(transformSummaryLayout).toEqual({
2207-
autoCenterAfterScale: true,
2208-
autoCenterButtonText: "Auto Center",
2209-
autoCenterTitle: "Balance Center",
2210-
summaryAfterAutoCenter: true,
2210+
autoOriginAfterOrigin: true,
2211+
autoOriginBeforeRotate: true,
2212+
autoOriginButtonText: "Auto Origin",
2213+
autoOriginTitle: "Auto Origin",
2214+
autoOriginUsesCenterWord: false,
22112215
summaryAfterScale: true,
22122216
summaryCentered: true,
22132217
summaryStartsWithoutTransform: true,
22142218
summaryTopAtBottom: true
22152219
});
22162220
const transformIconState = await page.locator("#objectVectorStudioV2ObjectTransform").evaluate((panel) => ({
2217-
autoCenter: {
2218-
iconKey: panel.querySelector("#objectVectorStudioV2AutoCenterButton").dataset.ovsIconKey,
2219-
iconName: panel.querySelector("#objectVectorStudioV2AutoCenterButton").dataset.ovsIconName,
2220-
title: panel.querySelector("#objectVectorStudioV2AutoCenterButton").title
2221+
autoOrigin: {
2222+
iconKey: panel.querySelector("#objectVectorStudioV2AutoOriginButton").dataset.ovsIconKey,
2223+
iconName: panel.querySelector("#objectVectorStudioV2AutoOriginButton").dataset.ovsIconName,
2224+
title: panel.querySelector("#objectVectorStudioV2AutoOriginButton").title
22212225
},
22222226
resize: {
22232227
iconKey: panel.querySelector("#objectVectorStudioV2ResizeShapeButton").dataset.ovsIconKey,
@@ -2227,7 +2231,7 @@ test.describe("Workspace Manager V2 bootstrap", () => {
22272231
scaleActionRemoved: panel.querySelector("#objectVectorStudioV2ScaleShapeButton") === null
22282232
}));
22292233
expect(transformIconState).toEqual({
2230-
autoCenter: { iconKey: "center", iconName: "nf-fa-dot_circle_o", title: "Balance Center" },
2234+
autoOrigin: { iconKey: "center", iconName: "nf-fa-dot_circle_o", title: "Auto Origin" },
22312235
resize: { iconKey: "resize", iconName: "nf-md-resize", title: "Resize Geometry" },
22322236
scaleActionRemoved: true
22332237
});
@@ -2371,6 +2375,19 @@ test.describe("Workspace Manager V2 bootstrap", () => {
23712375
visibleInputIds: ["objectVectorStudioV2OriginXInput", "objectVectorStudioV2OriginYInput"],
23722376
visibleSelectIds: []
23732377
},
2378+
{
2379+
allOneLine: true,
2380+
axisLabels: [],
2381+
buttonId: "objectVectorStudioV2AutoOriginButton",
2382+
buttonText: "Auto Origin",
2383+
buttonTitle: "Auto Origin",
2384+
inputIds: [],
2385+
label: "Origin",
2386+
rowType: "auto-origin",
2387+
selectIds: [],
2388+
visibleInputIds: [],
2389+
visibleSelectIds: []
2390+
},
23742391
{
23752392
allOneLine: true,
23762393
axisLabels: [],
@@ -2383,19 +2400,6 @@ test.describe("Workspace Manager V2 bootstrap", () => {
23832400
selectIds: ["objectVectorStudioV2RotateSnapSelect", "objectVectorStudioV2SnapAngleStepSelect"],
23842401
visibleInputIds: ["objectVectorStudioV2RotateInput"],
23852402
visibleSelectIds: []
2386-
},
2387-
{
2388-
allOneLine: true,
2389-
axisLabels: [],
2390-
buttonId: "objectVectorStudioV2AutoCenterButton",
2391-
buttonText: "Auto Center",
2392-
buttonTitle: "Balance Center",
2393-
inputIds: [],
2394-
label: "Center",
2395-
rowType: "auto-center",
2396-
selectIds: [],
2397-
visibleInputIds: [],
2398-
visibleSelectIds: []
23992403
}
24002404
]);
24012405
await expect(page.locator("#objectVectorStudioV2RotateInput")).toHaveAttribute("min", "-359");
@@ -10074,11 +10078,11 @@ test.describe("Workspace Manager V2 bootstrap", () => {
1007410078
await page.locator("#objectVectorStudioV2MoveYInput").fill("-5");
1007510079
await page.locator("#objectVectorStudioV2MoveShapeButton").click();
1007610080
});
10077-
await expectObjectVectorDirtyAfter("object auto center edit", async () => {
10081+
await expectObjectVectorDirtyAfter("object auto origin edit", async () => {
1007810082
await page.evaluate(() => {
1007910083
const app = window.__objectVectorStudioV2App;
10080-
app.selectObject("object.asteroids.ship", "auto center dirty test");
10081-
app.selectShape(0, "auto center dirty test");
10084+
app.selectObject("object.asteroids.ship", "auto origin dirty test");
10085+
app.selectShape(0, "auto origin dirty test");
1008210086
const shape = app.selectedShape();
1008310087
const frame = app.activeFrame();
1008410088
const override = frame?.shapeOverrides?.find((entry) => entry.shapeIndex === app.selectedShapeIndex) || null;
@@ -10087,7 +10091,7 @@ test.describe("Workspace Manager V2 bootstrap", () => {
1008710091
target.transform.origin = { x: 123, y: -45 };
1008810092
app.renderPayload({ syncPaletteSelection: false });
1008910093
});
10090-
const autoCenterBefore = await page.evaluate(() => {
10094+
const autoOriginBefore = await page.evaluate(() => {
1009110095
const app = window.__objectVectorStudioV2App;
1009210096
const shape = app.selectedShape();
1009310097
const effectiveShape = app.effectiveShape(shape);
@@ -10103,9 +10107,9 @@ test.describe("Workspace Manager V2 bootstrap", () => {
1010310107
pivot: app.transformedPoint(transform.origin, transform)
1010410108
};
1010510109
});
10106-
await page.locator("#objectVectorStudioV2AutoCenterButton").click();
10107-
await expect(page.locator("#statusLog")).toHaveValue(/OK Auto Center balanced shape row \d+ origin\/pivot to visible object center/);
10108-
const autoCenterAfter = await page.evaluate(() => {
10110+
await page.locator("#objectVectorStudioV2AutoOriginButton").click();
10111+
await expect(page.locator("#statusLog")).toHaveValue(/OK Auto Origin updated shape row \d+ origin\/pivot from visible object bounds/);
10112+
const autoOriginAfter = await page.evaluate(() => {
1010910113
const app = window.__objectVectorStudioV2App;
1011010114
const shape = app.selectedShape();
1011110115
const effectiveShape = app.effectiveShape(shape);
@@ -10116,13 +10120,13 @@ test.describe("Workspace Manager V2 bootstrap", () => {
1011610120
pivot: app.transformedPoint(transform.origin, transform)
1011710121
};
1011810122
});
10119-
expect(autoCenterAfter.geometryText).toBe(autoCenterBefore.geometryText);
10123+
expect(autoOriginAfter.geometryText).toBe(autoOriginBefore.geometryText);
1012010124
["x", "y", "width", "height"].forEach((key) => {
10121-
expect(autoCenterAfter.bounds[key]).toBeCloseTo(autoCenterBefore.bounds[key], 3);
10125+
expect(autoOriginAfter.bounds[key]).toBeCloseTo(autoOriginBefore.bounds[key], 3);
1012210126
});
10123-
expect(autoCenterAfter.pivot.x).toBeCloseTo(autoCenterBefore.center.x, 3);
10124-
expect(autoCenterAfter.pivot.y).toBeCloseTo(autoCenterBefore.center.y, 3);
10125-
expect(autoCenterAfter.pivot.x).not.toBeCloseTo(autoCenterBefore.pivot.x, 3);
10127+
expect(autoOriginAfter.pivot.x).toBeCloseTo(autoOriginBefore.center.x, 3);
10128+
expect(autoOriginAfter.pivot.y).toBeCloseTo(autoOriginBefore.center.y, 3);
10129+
expect(autoOriginAfter.pivot.x).not.toBeCloseTo(autoOriginBefore.pivot.x, 3);
1012610130
});
1012710131
await expectObjectVectorDirtyAfter("palette color edit", async () => {
1012810132
await page.locator("#objectVectorStudioV2PaintModeButton").click();

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2667,9 +2667,9 @@ export class ToolStarterApp {
26672667
heading,
26682668
this.createMoveControlRow(),
26692669
this.createOriginControlRow(transform),
2670+
this.createAutoOriginControlRow(),
26702671
this.createRotateControlRow(),
2671-
this.createScaleControlRow(transform),
2672-
this.createAutoCenterControlRow()
2672+
this.createScaleControlRow(transform)
26732673
);
26742674
return section;
26752675
}
@@ -2878,21 +2878,21 @@ export class ToolStarterApp {
28782878
return row;
28792879
}
28802880

2881-
createAutoCenterControlRow() {
2881+
createAutoOriginControlRow() {
28822882
const row = document.createElement("div");
2883-
row.className = "object-vector-studio-v2__transform-control-row object-vector-studio-v2__transform-control-row--auto-center";
2884-
row.dataset.transformControlRow = "auto-center";
2883+
row.className = "object-vector-studio-v2__transform-control-row object-vector-studio-v2__transform-control-row--auto-origin";
2884+
row.dataset.transformControlRow = "auto-origin";
28852885
const label = document.createElement("span");
28862886
label.className = "object-vector-studio-v2__transform-control-label";
2887-
label.textContent = "Center";
2887+
label.textContent = "Origin";
28882888
row.append(
28892889
label,
28902890
this.createTransformActionButton({
2891-
handler: () => this.autoCenterSelectedShapePivot(),
2891+
handler: () => this.autoOriginSelectedShapePivot(),
28922892
iconKey: "center",
2893-
id: "objectVectorStudioV2AutoCenterButton",
2894-
label: "Auto Center",
2895-
title: "Balance Center"
2893+
id: "objectVectorStudioV2AutoOriginButton",
2894+
label: "Auto Origin",
2895+
title: "Auto Origin"
28962896
})
28972897
);
28982898
return row;
@@ -6613,33 +6613,33 @@ export class ToolStarterApp {
66136613
}, `OK Updated shape row ${this.selectedShapeIndex} origin/pivot to ${originX.value}, ${originY.value}.`);
66146614
}
66156615

6616-
autoCenterSelectedShapePivot() {
6616+
autoOriginSelectedShapePivot() {
66176617
const object = this.selectedObject();
66186618
if (!object) {
6619-
this.statusLog.write("WARN Auto Center skipped: no object is selected.");
6619+
this.statusLog.write("WARN Auto Origin skipped: no object is selected.");
66206620
return;
66216621
}
66226622
const selected = this.selectedShape();
66236623
if (!selected) {
6624-
this.statusLog.write("WARN Auto Center skipped: no shape is selected.");
6624+
this.statusLog.write("WARN Auto Origin skipped: no shape is selected.");
66256625
return;
66266626
}
66276627
const activeFrame = this.activeFrame();
66286628
const visibleShapes = sortedShapes(object)
66296629
.map((shape, shapeIndex) => this.effectiveShapeForFrame(shape, activeFrame, shapeIndex))
66306630
.filter((shape) => shape.visible !== false);
66316631
if (!visibleShapes.length) {
6632-
this.statusLog.write(`FAIL Auto Center blocked: object ${object.name} has no visible geometry.`);
6632+
this.statusLog.write(`FAIL Auto Origin blocked: object ${object.name} has no visible geometry.`);
66336633
return;
66346634
}
66356635
const bounds = this.objectBounds(object, { includeInvisible: false });
66366636
const center = {
66376637
x: this.formatViewportNumber(bounds.x + bounds.width / 2),
66386638
y: this.formatViewportNumber(bounds.y + bounds.height / 2)
66396639
};
6640-
this.updateSelectedShapeTransform("auto center", (shape) => {
6640+
this.updateSelectedShapeTransform("auto origin", (shape) => {
66416641
shape.transform = this.transformWithBalancedOrigin(this.ensureShapeTransform(shape), center);
6642-
}, `OK Auto Center balanced shape row ${this.selectedShapeIndex} origin/pivot to visible object center ${center.x}, ${center.y}.`);
6642+
}, `OK Auto Origin updated shape row ${this.selectedShapeIndex} origin/pivot from visible object bounds ${center.x}, ${center.y}.`);
66436643
}
66446644

66456645
groupSelectedShapes() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,7 @@ textarea:hover {
18561856
grid-template-columns: 50px minmax(54px, 1fr) minmax(54px, max-content) max-content;
18571857
}
18581858

1859-
.object-vector-studio-v2__transform-control-row--auto-center {
1859+
.object-vector-studio-v2__transform-control-row--auto-origin {
18601860
grid-template-columns: 50px minmax(0, 1fr);
18611861
}
18621862

0 commit comments

Comments
 (0)