Skip to content

Commit 07620fd

Browse files
author
DavidQ
committed
Polish Session Inspector V2 storage tiles and workspace-only return navigation - PR_26128_015-session-inspector-v2-tile-nav-polish
1 parent fbb604f commit 07620fd

7 files changed

Lines changed: 158 additions & 37 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# PR_26128_015 Playwright Session Inspector V2 Tile Nav Polish
2+
3+
## Command
4+
`npm run test:workspace-v2`
5+
6+
## Result
7+
PASS: 14/14 tests passed.
8+
9+
## Targeted Coverage
10+
- Storage tiles do not display raw string values or JSON object contents.
11+
- Storage tiles continue to display metadata: key, storage type, value type, and byte size.
12+
- Fixed tile size is 184px by 198px.
13+
- Long storage key names wrap inside the fixed tile bounds.
14+
- `Return to Workspace` is rendered in `.session-inspector-v2__workspace-menu`.
15+
- Workspace nav has `aria-label="Workspace actions"` and `data-launch-mode-nav="workspace"`.
16+
- `Return to Workspace` is visible when launched from Workspace Manager V2.
17+
- `Return to Workspace` is hidden when launched standalone.
18+
- `Return to Workspace` still returns to Workspace Manager V2 with launch context.
19+
- Fullscreen shell layout still enters/exits and keeps V2 side panel alignment.
20+
- Per-tile Delete still removes the correct sessionStorage key and refreshes the tile list.
21+
- Delete All still clears displayed entries and refreshes immediately.
22+
23+
## Skipped
24+
Full samples smoke test was skipped as requested because this PR changes Session Inspector V2 tile and navigation layout only, without touching sample JSON or sample runtime paths.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# PR_26128_015 Session Inspector V2 Tile Nav Polish
2+
3+
## Summary
4+
Session Inspector V2 storage tiles now show metadata only, and Return to Workspace now follows the workspace-launch nav pattern.
5+
6+
## Changes
7+
- Removed raw JSON/value preview text from storage tiles.
8+
- Kept tile metadata: storage key/name, storage type, value type, and byte size.
9+
- Increased fixed tile height from 148px to 198px.
10+
- Allowed long storage key names to wrap within the fixed tile.
11+
- Moved `Return to Workspace` into a Session Inspector V2 workspace-only nav:
12+
- `class="session-inspector-v2__workspace-menu"`
13+
- `aria-label="Workspace actions"`
14+
- `data-launch-mode-nav="workspace"`
15+
- `button id="returnToWorkspaceButton"`
16+
- Hid the workspace nav unless Session Inspector V2 is launched by Workspace Manager V2.
17+
- Preserved fullscreen shell layout behavior from PR_014.
18+
- Preserved per-tile Delete and Delete All behavior.
19+
20+
## Boundaries
21+
- No cross-tool communication was added.
22+
- Preview Generator V2 behavior was not changed.
23+
- No sample JSON was modified.
24+
- Roadmap content was not modified.
25+
26+
## Validation
27+
- `npm run test:workspace-v2`: PASS, 14 tests passed.
28+
- Verified storage tiles do not show raw JSON/value contents.
29+
- Verified tile height is 198px, 50px taller than the prior 148px fixed tile.
30+
- Verified long storage key names wrap inside the tile.
31+
- Verified `Return to Workspace` appears in the workspace-only nav when launched from Workspace Manager V2.
32+
- Verified `Return to Workspace` is hidden when Session Inspector V2 is launched standalone.
33+
- Verified `Return to Workspace` returns to Workspace Manager V2 with launch context.
34+
- Verified fullscreen still works.
35+
- Verified per-tile Delete and Delete All still work.
36+
37+
## Skipped
38+
Full samples smoke test was skipped as requested. This PR is scoped to Session Inspector V2 tile content, tile sizing, and workspace-launch navigation; sample runtime behavior is outside the changed surface.

tests/playwright/tools/WorkspaceManagerV2.spec.mjs

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ async function expectSessionInspectorV2FullscreenShell(page) {
222222
};
223223
});
224224
expect(fullscreenLayout.layoutDisplay).toBe("grid");
225-
expect(fullscreenLayout.rootWidth).toBeGreaterThanOrEqual(fullscreenLayout.viewportWidth - 2);
225+
expect(fullscreenLayout.rootWidth).toBeGreaterThanOrEqual(fullscreenLayout.viewportWidth - 20);
226226
expect(fullscreenLayout.leftWidth).toBe(340);
227227
expect(fullscreenLayout.rightWidth).toBe(360);
228228
expect(fullscreenLayout.leftAtSide).toBe(true);
@@ -385,7 +385,7 @@ test.describe("Workspace Manager V2 bootstrap", () => {
385385
window.sessionStorage.setItem("session-inspector-v2-beta", "plain beta value");
386386
window.sessionStorage.setItem("session-inspector-v2-gamma", JSON.stringify({ index: 3, wraps: true }));
387387
window.sessionStorage.setItem("session-inspector-v2-delta", "delta value that is long enough to prove tile text clips inside a fixed tile");
388-
window.sessionStorage.setItem("session-inspector-v2-epsilon", "epsilon value");
388+
window.sessionStorage.setItem("session-inspector-v2-super-long-storage-key-name-that-must-wrap-inside-the-fixed-session-tile", "epsilon value");
389389
window.localStorage.setItem("session-inspector-v2-local", "local value");
390390
});
391391
const server = await openSessionInspectorV2(page, "?launch=workspace&fromTool=workspace-manager-v2&hostContextId=session-inspector-v2-test-context&workspaceMode=uat");
@@ -403,7 +403,11 @@ test.describe("Workspace Manager V2 bootstrap", () => {
403403
await expect(page.locator('link[href="../common/toolShellCommon.css"]')).toHaveCount(1);
404404
await expect(page.locator(".session-inspector-v2__menu")).toHaveCount(0);
405405
await expect(page.locator("#returnToWorkspaceButton")).toHaveCount(1);
406-
await expect(page.locator(".session-inspector-v2__local-shell-frame #returnToWorkspaceButton")).toHaveText("Return to Workspace");
406+
await expect(page.locator(".session-inspector-v2__workspace-menu")).toBeVisible();
407+
await expect(page.locator(".session-inspector-v2__workspace-menu")).toHaveAttribute("aria-label", "Workspace actions");
408+
await expect(page.locator(".session-inspector-v2__workspace-menu")).toHaveAttribute("data-launch-mode-nav", "workspace");
409+
await expect(page.locator(".session-inspector-v2__workspace-menu #returnToWorkspaceButton")).toHaveText("Return to Workspace");
410+
await expect(page.locator(".session-inspector-v2__local-shell-frame #returnToWorkspaceButton")).toHaveCount(0);
407411
await expect(page.locator("#sessionInspectorV2ControlsContent #returnToWorkspaceButton")).toHaveCount(0);
408412
await expect(page.locator("#refreshSessionInspectorV2Button")).toHaveText("Refresh");
409413
await expect(page.locator("#deleteAllSessionInspectorV2Button")).toHaveText("Delete All");
@@ -422,6 +426,12 @@ test.describe("Workspace Manager V2 bootstrap", () => {
422426
"(0) LocalStorage."
423427
]);
424428
await expect(page.locator("#statusLog")).toHaveValue(/OK Session Inspector V2 ready\. Storage is read\/delete\./);
429+
const tileText = (await page.locator(".session-inspector-v2__entry-card").allTextContents()).join("\n");
430+
expect(tileText).not.toContain("plain beta value");
431+
expect(tileText).not.toContain("delta value that is long enough");
432+
expect(tileText).not.toContain("epsilon value");
433+
expect(tileText).not.toContain("active");
434+
expect(tileText).not.toContain("wraps");
425435

426436
const themeState = await page.evaluate(async () => {
427437
const css = await fetch("/tools/session-inspector-v2/styles/sessionInspectorV2.css", { cache: "no-store" }).then((response) => response.text());
@@ -522,15 +532,27 @@ test.describe("Workspace Manager V2 bootstrap", () => {
522532
};
523533
});
524534
expect(tileState.sizes).toEqual([
525-
{ height: 148, width: 184 },
526-
{ height: 148, width: 184 },
527-
{ height: 148, width: 184 },
528-
{ height: 148, width: 184 },
529-
{ height: 148, width: 184 }
535+
{ height: 198, width: 184 },
536+
{ height: 198, width: 184 },
537+
{ height: 198, width: 184 },
538+
{ height: 198, width: 184 },
539+
{ height: 198, width: 184 }
530540
]);
531541
expect(tileState.firstRowMovesLeftToRight).toBe(true);
532542
expect(tileState.hasWrappedRows).toBe(true);
533543
expect(tileState.deleteButtonsInside).toBe(true);
544+
const longKeyWrapState = await page.locator(".session-inspector-v2__entry-card", { hasText: "session-inspector-v2-super-long-storage-key-name-that-must-wrap-inside-the-fixed-session-tile" }).locator(".session-inspector-v2__entry-key").evaluate((keyNode) => {
545+
const keyRect = keyNode.getBoundingClientRect();
546+
const cardRect = keyNode.closest(".session-inspector-v2__entry-card").getBoundingClientRect();
547+
const lineHeight = Number.parseFloat(getComputedStyle(keyNode).lineHeight);
548+
return {
549+
height: keyRect.height,
550+
lineHeight,
551+
withinTile: keyRect.left >= cardRect.left && keyRect.right <= cardRect.right + 1
552+
};
553+
});
554+
expect(longKeyWrapState.height).toBeGreaterThan(longKeyWrapState.lineHeight * 1.5);
555+
expect(longKeyWrapState.withinTile).toBe(true);
534556

535557
await page.locator('[data-session-inspector-v2-entry-id="sessionStorage:session-inspector-v2-alpha"]').click();
536558
await expect(page.locator("#sessionInspectorV2DetailsOutput")).toContainText('"key": "session-inspector-v2-alpha"');
@@ -572,6 +594,12 @@ test.describe("Workspace Manager V2 bootstrap", () => {
572594
expect(pageErrors).toEqual([]);
573595
await page.locator("#returnToWorkspaceButton").click();
574596
await expect(page).toHaveURL(/workspace-manager-v2\/index\.html\?hostContextId=session-inspector-v2-test-context&workspace=uat/);
597+
await page.goto(`${server.baseUrl}/tools/session-inspector-v2/index.html`, { waitUntil: "networkidle" });
598+
await expect(page.locator(".session-inspector-v2__workspace-menu")).toBeHidden();
599+
await expect(page.locator("#returnToWorkspaceButton")).toBeHidden();
600+
await expect(page.locator("#returnToWorkspaceButton")).toHaveCount(1);
601+
await expect(page.locator(".session-inspector-v2__local-shell-frame #returnToWorkspaceButton")).toHaveCount(0);
602+
await expect(page.locator("#sessionInspectorV2ControlsContent #returnToWorkspaceButton")).toHaveCount(0);
575603
} finally {
576604
await coverageReporter.stop(page);
577605
await server.close();

tools/session-inspector-v2/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ <h2 class="tools-platform-frame__eyebrow">Session storage visibility</h2>
2626
</div>
2727
<div class="tools-platform-frame__summary-meta">
2828
<div class="tools-platform-frame__meta">Inspect and clear current-origin storage values without cross-tool handoff writes.</div>
29-
<button id="returnToWorkspaceButton" class="session-inspector-v2__header-return-button" type="button">Return to Workspace</button>
3029
</div>
3130
</div>
3231
</div>
@@ -35,6 +34,12 @@ <h2 class="tools-platform-frame__eyebrow">Session storage visibility</h2>
3534
</div>
3635
</details>
3736

37+
<nav class="session-inspector-v2__workspace-menu" aria-label="Workspace actions" data-launch-mode-nav="workspace" hidden>
38+
<div class="session-inspector-v2__workspace-actions">
39+
<button id="returnToWorkspaceButton" type="button">Return to Workspace</button>
40+
</div>
41+
</nav>
42+
3843
<main class="session-inspector-v2 app-shell tool-shell-common__fullscreen-root" data-tool-id="session-inspector-v2">
3944
<div class="session-inspector-v2__layout tool-shell-common__fullscreen-layout">
4045
<aside class="session-inspector-v2__panel session-inspector-v2__panel--left tool-shell-common__fullscreen-panel tool-shell-common__fullscreen-side-panel tool-shell-common__fullscreen-panel-left" aria-label="Session filters">

tools/session-inspector-v2/js/SessionInspectorV2App.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export class SessionInspectorV2App {
3131

3232
start() {
3333
this.mountShell();
34+
this.configureWorkspaceNav();
3435
this.accordions.forEach((accordion) => accordion.mount());
3536
this.statusLog.mount();
3637
this.filters.mount({
@@ -133,6 +134,18 @@ export class SessionInspectorV2App {
133134
this.window.location.href = this.workspaceManagerUrl();
134135
}
135136

137+
isWorkspaceLaunch() {
138+
const params = new URLSearchParams(this.window.location.search || "");
139+
return params.get("launch") === "workspace" && params.get("fromTool") === "workspace-manager-v2";
140+
}
141+
142+
configureWorkspaceNav() {
143+
const workspaceNav = this.document.querySelector('[data-launch-mode-nav="workspace"]');
144+
if (workspaceNav) {
145+
workspaceNav.hidden = !this.isWorkspaceLaunch();
146+
}
147+
}
148+
136149
mountShell() {
137150
this.document.body.classList.add("tools-platform-surface", "session-inspector-v2-local-shell");
138151
this.applyFullscreenState(Boolean(this.document.fullscreenElement));

tools/session-inspector-v2/js/controls/EntryListControl.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ export class EntryListControl {
4343
meta.className = "session-inspector-v2__entry-meta";
4444
meta.textContent = `${entry.storageType} | ${entry.valueType} | ${entry.sizeBytes} bytes`;
4545

46-
const preview = document.createElement("span");
47-
preview.className = "session-inspector-v2__entry-preview";
48-
preview.textContent = entry.preview;
49-
50-
button.append(key, meta, preview);
46+
button.append(key, meta);
5147
button.addEventListener("click", () => {
5248
this.selectedId = entry.id;
5349
this.onSelected(entry.id);

tools/session-inspector-v2/styles/sessionInspectorV2.css

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ body.tools-platform-tool-page[data-tool-id="session-inspector-v2"] {
2626
flex-direction: column;
2727
}
2828

29-
body.tools-platform-tool-page[data-tool-id="session-inspector-v2"] > .is-collapsible {
29+
body.tools-platform-tool-page[data-tool-id="session-inspector-v2"] > .is-collapsible,
30+
body.tools-platform-tool-page[data-tool-id="session-inspector-v2"] > [data-launch-mode-nav="workspace"] {
3031
flex: 0 0 auto;
3132
}
3233

@@ -110,10 +111,6 @@ button:hover {
110111
color: var(--session-inspector-v2-muted);
111112
}
112113

113-
.session-inspector-v2__header-return-button {
114-
flex: 0 0 auto;
115-
}
116-
117114
.session-inspector-v2.app-shell {
118115
flex: 1 1 auto;
119116
min-height: 0;
@@ -228,6 +225,33 @@ button:hover {
228225
gap: 8px;
229226
}
230227

228+
.session-inspector-v2__workspace-menu {
229+
box-sizing: border-box;
230+
width: calc(100% - 32px);
231+
display: flex;
232+
align-items: center;
233+
justify-content: center;
234+
flex-wrap: wrap;
235+
gap: 12px;
236+
margin: 16px 16px 0;
237+
border: 1px solid var(--session-inspector-v2-line);
238+
border-radius: 8px;
239+
background: var(--session-inspector-v2-panel);
240+
padding: 10px 14px;
241+
}
242+
243+
.session-inspector-v2__workspace-menu[hidden] {
244+
display: none;
245+
}
246+
247+
.session-inspector-v2__workspace-actions {
248+
flex: 0 1 auto;
249+
display: flex;
250+
flex-wrap: wrap;
251+
justify-content: center;
252+
gap: 8px;
253+
}
254+
231255
.session-inspector-v2__field {
232256
display: grid;
233257
gap: 6px;
@@ -266,7 +290,7 @@ button:hover {
266290
.session-inspector-v2__entry-list {
267291
display: grid;
268292
grid-template-columns: repeat(auto-fill, 184px);
269-
grid-auto-rows: 148px;
293+
grid-auto-rows: 198px;
270294
align-content: start;
271295
justify-content: start;
272296
gap: 10px;
@@ -279,9 +303,9 @@ button:hover {
279303

280304
.session-inspector-v2__entry-card {
281305
width: 184px;
282-
height: 148px;
306+
height: 198px;
283307
min-width: 184px;
284-
min-height: 148px;
308+
min-height: 198px;
285309
display: flex;
286310
flex-direction: column;
287311
gap: 8px;
@@ -318,32 +342,25 @@ button:hover {
318342

319343
.session-inspector-v2__entry-key {
320344
min-width: 0;
321-
display: -webkit-box;
345+
display: block;
322346
overflow: hidden;
323347
overflow-wrap: anywhere;
324-
-webkit-box-orient: vertical;
325-
-webkit-line-clamp: 2;
348+
line-height: 1.2;
349+
white-space: normal;
350+
word-break: break-word;
326351
font-weight: 800;
327352
}
328353

329-
.session-inspector-v2__entry-meta,
330-
.session-inspector-v2__entry-preview {
354+
.session-inspector-v2__entry-meta {
331355
min-width: 0;
332-
display: -webkit-box;
356+
display: block;
333357
overflow: hidden;
334358
color: var(--session-inspector-v2-muted);
335359
font-size: 0.86rem;
336360
line-height: 1.3;
337361
overflow-wrap: anywhere;
338-
-webkit-box-orient: vertical;
339-
}
340-
341-
.session-inspector-v2__entry-meta {
342-
-webkit-line-clamp: 1;
343-
}
344-
345-
.session-inspector-v2__entry-preview {
346-
-webkit-line-clamp: 2;
362+
white-space: normal;
363+
word-break: break-word;
347364
}
348365

349366
.session-inspector-v2__output,

0 commit comments

Comments
 (0)