Skip to content

Commit 2af1c70

Browse files
author
DavidQ
committed
Fix Workspace Manager V2 layout spacing and move context JSON into accordion - PR_26127_003-workspace-manager-v2-layout-space-fix
1 parent a8164d8 commit 2af1c70

4 files changed

Lines changed: 86 additions & 2 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# PR_26127_003-workspace-manager-v2-layout-space-fix
2+
3+
## Scope
4+
- Updated Workspace Manager V2 layout only.
5+
- Kept Tools above Workspace Context.
6+
- Kept tool grouping labels: Editors, Utilities, Viewers.
7+
- Kept tile action labels: How To Use, Read Me, Samples (x).
8+
- Did not modify deprecated `tools/workspace-v2`.
9+
- Did not modify sample JSON.
10+
- Did not add fallback behavior.
11+
12+
## Layout Notes
13+
- Tools is now a compact accordion that sizes to the listed tool tiles instead of consuming extra panel height.
14+
- Workspace Context is now a compact accordion containing only the active palette, asset registry, and launch context summary tiles.
15+
- Workspace JSON is now a separate accordion that owns `#workspaceContextOutput` and can use the remaining center-panel space.
16+
- The Workspace Context summary tiles keep consistent height while the JSON output is isolated from the summary control.
17+
18+
## Validation
19+
- PASS: `node --check tests/playwright/tools/WorkspaceManagerV2.spec.mjs`
20+
- PASS: `npm run test:workspace-v2` completed with 24 passed tests.
21+
- PASS: Scope check found no diffs under deprecated `tools/workspace-v2` or sample schema paths.
22+
- SKIPPED: Full samples smoke test, per PR instructions. This PR is Workspace Manager V2 layout scoped.
23+
24+
## Manual Validation Notes
25+
- Verified the center panel order is Tools, Workspace Context, then Workspace JSON.
26+
- Verified Tools and Workspace Context do not use the shared open-accordion fill behavior.
27+
- Verified Workspace Context JSON moved out of the Workspace Context accordion and into its own accordion section.
28+
- Verified Workspace Manager V2 launch, import/export, UAT, and tool tile flows remain covered by `npm run test:workspace-v2`.

tests/playwright/tools/WorkspaceManagerV2.spec.mjs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,35 @@ test.describe("Workspace Manager V2 bootstrap", () => {
170170
await expect(page.locator("#launchAssetManagerV2Button")).toHaveCount(0);
171171
await expect(page.locator("#workspaceToolsContent #workspaceToolTiles")).toBeVisible();
172172
await expect(page.locator("#workspaceContextContent #workspaceToolTiles")).toHaveCount(0);
173+
await expect(page.locator("#workspaceContextContent #workspaceContextOutput")).toHaveCount(0);
174+
await expect(page.locator("#workspaceJsonContent #workspaceContextOutput")).toBeVisible();
173175
const centerControlLabels = await page.locator(".workspace-manager-v2__panel--center > .accordion-v2 > .accordion-v2__header span:first-child")
174176
.evaluateAll((labels) => labels.map((label) => label.textContent.trim()));
175-
expect(centerControlLabels.slice(0, 2)).toEqual(["Tools", "Workspace Context"]);
177+
expect(centerControlLabels.slice(0, 3)).toEqual(["Tools", "Workspace Context", "Workspace JSON"]);
176178
await expect(page.locator("#workspaceToolTiles [data-workspace-tool-id]")).toHaveCount(5);
177179
expect(await page.locator("#workspaceToolTiles [data-workspace-tool-id]").evaluateAll((tiles) => tiles.every((tile) => tile.disabled))).toBe(true);
180+
const compactCenterLayout = await page.evaluate(() => {
181+
const getRect = (selector) => {
182+
const element = document.querySelector(selector);
183+
return element ? element.getBoundingClientRect() : null;
184+
};
185+
const toolsRect = getRect(".workspace-manager-v2__accordion--tools");
186+
const toolGridRect = getRect("#workspaceToolTiles");
187+
const contextRect = getRect(".workspace-manager-v2__accordion--context");
188+
const summaryGridRect = getRect(".workspace-manager-v2__summary-grid");
189+
const jsonRect = getRect(".workspace-manager-v2__accordion--json");
190+
return {
191+
contextExtraHeight: Math.round(contextRect.height - summaryGridRect.height),
192+
contextHeight: Math.round(contextRect.height),
193+
jsonTop: Math.round(jsonRect.top),
194+
toolsBottom: Math.round(toolsRect.bottom),
195+
toolsExtraHeight: Math.round(toolsRect.height - toolGridRect.height),
196+
toolsHeight: Math.round(toolsRect.height)
197+
};
198+
});
199+
expect(compactCenterLayout.toolsExtraHeight).toBeLessThanOrEqual(90);
200+
expect(compactCenterLayout.contextExtraHeight).toBeLessThanOrEqual(90);
201+
expect(compactCenterLayout.jsonTop).toBeGreaterThan(compactCenterLayout.toolsBottom);
178202
await expect(page.locator("#activeGameSelect option")).toHaveText([
179203
"Select a game",
180204
"Asteroids",

tools/workspace-manager-v2/index.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h2 class="tools-platform-frame__eyebrow">Games-only launch context</h2>
6969
</div>
7070
</section>
7171

72-
<section class="accordion-v2 workspace-manager-v2__accordion workspace-manager-v2__accordion--fill is-open" data-accordion-v2-open="true">
72+
<section class="accordion-v2 workspace-manager-v2__accordion workspace-manager-v2__accordion--context is-open" data-accordion-v2-open="true">
7373
<button class="accordion-v2__header" type="button" aria-expanded="true" aria-controls="workspaceContextContent">
7474
<span>Workspace Context</span>
7575
<span class="accordion-v2__icon" aria-hidden="true">+</span>
@@ -89,6 +89,15 @@ <h2>Launch Context</h2>
8989
<p id="launchContextSummary">Asset Manager V2 launch is waiting for a game and palette.</p>
9090
</section>
9191
</div>
92+
</div>
93+
</section>
94+
95+
<section class="accordion-v2 workspace-manager-v2__accordion workspace-manager-v2__accordion--json workspace-manager-v2__accordion--fill is-open" data-accordion-v2-open="true">
96+
<button class="accordion-v2__header" type="button" aria-expanded="true" aria-controls="workspaceJsonContent">
97+
<span>Workspace JSON</span>
98+
<span class="accordion-v2__icon" aria-hidden="true">+</span>
99+
</button>
100+
<div id="workspaceJsonContent" class="accordion-v2__content">
92101
<pre id="workspaceContextOutput" class="workspace-manager-v2__output">{}</pre>
93102
</div>
94103
</section>

tools/workspace-manager-v2/styles/workspaceManagerV2.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,15 @@ textarea:hover {
201201
flex: 0 0 auto;
202202
}
203203

204+
.workspace-manager-v2__accordion--tools.is-open,
205+
.workspace-manager-v2__accordion--context.is-open {
206+
flex: 0 0 auto;
207+
}
208+
209+
.workspace-manager-v2__accordion--json.is-open {
210+
flex: 1 1 auto;
211+
}
212+
204213
.accordion-v2__header {
205214
width: 100%;
206215
min-height: 42px;
@@ -246,6 +255,15 @@ textarea:hover {
246255
display: none;
247256
}
248257

258+
.workspace-manager-v2__accordion--tools .accordion-v2__content,
259+
.workspace-manager-v2__accordion--context .accordion-v2__content {
260+
flex: 0 0 auto;
261+
}
262+
263+
.workspace-manager-v2__accordion--json .accordion-v2__content {
264+
flex: 1 1 auto;
265+
}
266+
249267
.workspace-manager-v2__field {
250268
display: grid;
251269
gap: 6px;
@@ -357,6 +375,11 @@ textarea:hover {
357375
white-space: pre-wrap;
358376
}
359377

378+
.workspace-manager-v2__accordion--json .workspace-manager-v2__output {
379+
height: 100%;
380+
min-height: 0;
381+
}
382+
360383
.workspace-manager-v2__status-accordion-header {
361384
cursor: pointer;
362385
}

0 commit comments

Comments
 (0)