Skip to content

Commit 03d75f7

Browse files
committed
Fix Tool Vote fullscreen scrolling behavior - PR_26160_067-admin-tool-vote-template-conversion
1 parent 0512e40 commit 03d75f7

3 files changed

Lines changed: 90 additions & 11 deletions

File tree

assets/theme-v2/css/layout.css

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,34 +283,63 @@ body.tool-focus-mode:has(.tool-workspace--fullscreen-chrome) .footer {
283283
}
284284

285285
body.tool-focus-mode:has(.tool-workspace--fullscreen-chrome) {
286-
display: flex;
287-
flex-direction: column;
288-
min-height: 100vh
286+
--tool-focus-header-reserve: var(--space-78);
287+
--tool-focus-footer-reserve: calc(var(--space-78) + var(--space-78));
288+
min-height: 100vh;
289+
padding-block: var(--tool-focus-header-reserve) var(--tool-focus-footer-reserve)
290+
}
291+
292+
body.tool-focus-mode:has(.tool-workspace--fullscreen-chrome) .site-header {
293+
inset-block-start: var(--space-0);
294+
inset-inline: var(--space-0);
295+
max-height: var(--tool-focus-header-reserve);
296+
overflow: visible;
297+
position: fixed;
298+
z-index: var(--z-index-lg)
299+
}
300+
301+
body.tool-focus-mode:has(.tool-workspace--fullscreen-chrome) .footer {
302+
inset-block-end: var(--space-0);
303+
inset-inline: var(--space-0);
304+
margin-top: var(--space-0);
305+
max-height: var(--tool-focus-footer-reserve);
306+
overflow: auto;
307+
padding-block: var(--space-10);
308+
position: fixed;
309+
z-index: var(--z-index-lg)
289310
}
290311

291312
body.tool-focus-mode:has(.tool-workspace--fullscreen-chrome) main {
292313
display: flex;
293314
flex: 1 1 auto;
294315
flex-direction: column;
295-
min-height: var(--space-0)
316+
height: calc(100vh - var(--tool-focus-header-reserve) - var(--tool-focus-footer-reserve));
317+
min-height: var(--space-0);
318+
overflow: hidden
296319
}
297320

298321
body.tool-focus-mode:has(.tool-workspace--fullscreen-chrome) .section {
299322
display: flex;
300323
flex: 1 1 auto;
301324
min-height: var(--space-0);
325+
overflow: hidden;
302326
padding: var(--space-8) var(--space-0)
303327
}
304328

305329
body.tool-focus-mode:has(.tool-workspace--fullscreen-chrome) .section>.container {
306330
display: flex;
307331
flex: 1 1 auto;
308-
min-height: var(--space-0)
332+
height: 100%;
333+
max-height: 100%;
334+
min-height: var(--space-0);
335+
overflow: hidden
309336
}
310337

311338
body.tool-focus-mode .tool-workspace--fullscreen-chrome {
339+
flex: 1 1 auto;
312340
height: 100%;
313341
max-height: 100%;
342+
min-height: var(--space-0);
314343
width: 100%
315344
}
316345

@@ -330,7 +359,8 @@ body.tool-focus-mode .tool-workspace--table-scroll-focus .tool-center-panel {
330359
body.tool-focus-mode .tool-workspace--table-scroll-focus .tool-table-scroll-region {
331360
flex: 1 1 auto;
332361
min-height: var(--space-0);
333-
overflow: auto
362+
overflow: auto;
363+
overscroll-behavior: contain
334364
}
335365

336366
.account-panel {

docs_build/dev/reports/admin-tool-vote-template-conversion-report.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
| --- | --- | --- |
1313
| Convert Admin > Tool Votes from standalone page into Tool Template V2-based admin tool. | `admin/tool-votes.html` now uses `container--tool-wide`, `tool-workspace tool-workspace--wide`, left/right `tool-column` panels, `tool-center-panel`, and `tool-display-mode.js`. | PASS |
1414
| Preserve Admin placement and left-column Admin navigation. | Left Admin Tools accordion keeps Tool Votes, Environments, Users, Game Migration, and Platform Settings with Tool Votes active. | PASS |
15-
| Fullscreen keeps header and footer visible. | Reusable `tool-workspace--fullscreen-chrome` rules in `assets/theme-v2/css/layout.css`; Playwright asserts `header.site-header` and `footer.footer` visible in focus mode. | PASS |
16-
| In fullscreen, only the data/table area should scroll. | Reusable `tool-workspace--table-scroll-focus` plus `tool-table-scroll-region`; Playwright asserts side/center panels are hidden overflow and table region owns `overflow-y:auto`. | PASS |
15+
| Fullscreen keeps header visible and fixed at top. | Reusable `tool-workspace--fullscreen-chrome` rules in `assets/theme-v2/css/layout.css`; Playwright asserts `header.site-header` is visible, `position: fixed`, and top-aligned at `0`. | PASS |
16+
| Fullscreen keeps footer visible and fixed at bottom. | Playwright asserts `footer.footer` is visible, `position: fixed`, bottom-aligned inside the viewport, and has its own `overflow-y:auto` when content needs a footer scrollbar. | PASS |
17+
| Fullscreen does not scroll the entire page. | Playwright asserts `document.body` keeps `overflow-y:hidden` and page scroll position does not change during table scroll testing. | PASS |
18+
| In fullscreen, only the data/table area should scroll vertically. | Reusable `tool-workspace--table-scroll-focus` plus `tool-table-scroll-region`; Playwright injects additional table rows, scrolls the table region, and verifies side/center panels remain hidden overflow. | PASS |
19+
| Preserve horizontal scrolling for wide Tool Vote tables. | Playwright verifies the table wrapper is horizontally scrollable and `scrollLeft` moves for the wide table. | PASS |
20+
| Verify Tool Vote table remains usable with large tool counts. | Playwright clones 90 extra rows in the test DOM, verifies vertical scrolling is owned by `data-toolbox-votes-scroll-region`, and keeps the body locked. | PASS |
1721
| Remove old page-specific table width controls. | Removed Expand Table Width, Standard table width, and old `data-toolbox-votes-expanded` CSS. Static search found no active page/script/CSS matches. | PASS |
1822
| Remove old selected metadata controls. | Removed Selected Order, Selected Group, Selected Path, Group field, Path field, Status field, and Update Metadata from HTML/JS. Static search found no active page/script/CSS matches. | PASS |
1923
| Keep table rows, votes, ordering, sorting, and tool links. | `admin/tool-votes.js` preserves row rendering, vote columns, drag/drop ordering, sort buttons, and tool link cells; Playwright verified row links, sorting, and drag/drop reorder. | PASS |
@@ -28,9 +32,7 @@
2832
Targeted Admin Tool Vote validation only:
2933
- `node --check admin/tool-votes.js`
3034
- `node --check tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs`
31-
- `node --check tests/playwright/tools/ToolboxRoutePages.spec.mjs`
3235
- `npx playwright test tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs --grep "Tool Votes"`
33-
- `npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --grep "toolbox status kickers"`
3436
- `git diff --check`
3537
- Static `rg` checks for removed controls and inline script/style/event handlers
3638

@@ -40,4 +42,4 @@ Full samples validation was skipped as requested. No samples, shared sample load
4042

4143
## Manual Test Notes
4244

43-
The targeted Playwright lane verified the converted Tool Template V2 structure, Admin navigation, fullscreen chrome/table-scroll behavior, removed controls, editable State, sorting, ordering, and tool links. It also verified State edits flow into Toolbox Build Path through the existing DB-backed metadata source.
45+
The targeted Playwright lane verified the converted Tool Template V2 structure, Admin navigation, fixed fullscreen header/footer, footer scrollbar access, locked page scrolling, independent vertical table scrolling with large row counts, horizontal table scrolling, and removed controls. Earlier PR_26160_067 validation also verified editable State, sorting, ordering, tool links, and State edits flowing into Toolbox Build Path through the existing DB-backed metadata source.

tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,68 @@ test("Tool Votes side menu includes Admin platform wireframes", async ({ page })
139139
const center = workspace.querySelector("[data-toolbox-votes-panel]");
140140
const right = workspace.querySelector(".tool-column:last-of-type");
141141
const scrollRegion = workspace.querySelector("[data-toolbox-votes-scroll-region]");
142+
const header = document.querySelector("header.site-header");
143+
const footer = document.querySelector("footer.footer");
144+
const bodyScrollBefore = document.scrollingElement?.scrollTop || 0;
145+
const tableBody = scrollRegion?.querySelector("tbody");
146+
const sourceRow = tableBody?.querySelector("tr");
147+
if (tableBody && sourceRow) {
148+
for (let index = 0; index < 90; index += 1) {
149+
const clone = sourceRow.cloneNode(true);
150+
clone.dataset.toolboxVotesLargeCountRow = String(index + 1);
151+
tableBody.append(clone);
152+
}
153+
}
154+
if (scrollRegion) {
155+
scrollRegion.scrollTop = scrollRegion.scrollHeight;
156+
scrollRegion.scrollLeft = scrollRegion.scrollWidth;
157+
}
158+
if (footer) {
159+
footer.scrollTop = footer.scrollHeight;
160+
}
161+
const headerBox = header?.getBoundingClientRect();
162+
const footerBox = footer?.getBoundingClientRect();
142163
return {
143164
bodyOverflowY: getComputedStyle(document.body).overflowY,
165+
bodyScrollAfter: document.scrollingElement?.scrollTop || 0,
166+
bodyScrollBefore,
144167
centerOverflowY: center ? getComputedStyle(center).overflowY : "",
168+
footerBottom: footerBox ? Math.round(footerBox.bottom) : 0,
169+
footerOverflowY: footer ? getComputedStyle(footer).overflowY : "",
170+
footerPosition: footer ? getComputedStyle(footer).position : "",
171+
footerScrollable: footer ? footer.scrollHeight > footer.clientHeight : false,
172+
footerScrollTop: footer ? footer.scrollTop : 0,
173+
headerPosition: header ? getComputedStyle(header).position : "",
174+
headerTop: headerBox ? Math.round(headerBox.top) : 0,
175+
horizontalScrollLeft: scrollRegion ? scrollRegion.scrollLeft : 0,
176+
horizontalScrollable: scrollRegion ? scrollRegion.scrollWidth > scrollRegion.clientWidth : false,
145177
leftOverflowY: left ? getComputedStyle(left).overflowY : "",
146178
rightOverflowY: right ? getComputedStyle(right).overflowY : "",
147179
scrollRegionHeight: scrollRegion ? scrollRegion.clientHeight : 0,
180+
scrollRegionScrollTop: scrollRegion ? scrollRegion.scrollTop : 0,
181+
scrollRegionVerticalScrollable: scrollRegion ? scrollRegion.scrollHeight > scrollRegion.clientHeight : false,
148182
scrollRegionOverflowY: scrollRegion ? getComputedStyle(scrollRegion).overflowY : "",
183+
viewportHeight: window.innerHeight,
149184
};
150185
});
151186
expect(fullscreenMetrics.bodyOverflowY).toBe("hidden");
187+
expect(fullscreenMetrics.bodyScrollAfter).toBe(fullscreenMetrics.bodyScrollBefore);
188+
expect(fullscreenMetrics.headerPosition).toBe("fixed");
189+
expect(fullscreenMetrics.headerTop).toBe(0);
190+
expect(fullscreenMetrics.footerPosition).toBe("fixed");
191+
expect(fullscreenMetrics.footerBottom).toBeLessThanOrEqual(fullscreenMetrics.viewportHeight);
192+
expect(fullscreenMetrics.footerOverflowY).toBe("auto");
193+
expect(fullscreenMetrics.footerScrollable).toBe(true);
194+
expect(fullscreenMetrics.footerScrollTop).toBeGreaterThan(0);
152195
expect(fullscreenMetrics.leftOverflowY).toBe("hidden");
153196
expect(fullscreenMetrics.centerOverflowY).toBe("hidden");
154197
expect(fullscreenMetrics.rightOverflowY).toBe("hidden");
155198
expect(fullscreenMetrics.scrollRegionOverflowY).toBe("auto");
156199
expect(fullscreenMetrics.scrollRegionHeight).toBeGreaterThan(0);
200+
expect(fullscreenMetrics.scrollRegionVerticalScrollable).toBe(true);
201+
expect(fullscreenMetrics.scrollRegionScrollTop).toBeGreaterThan(0);
202+
expect(fullscreenMetrics.horizontalScrollable).toBe(true);
203+
expect(fullscreenMetrics.horizontalScrollLeft).toBeGreaterThan(0);
157204

158205
await expectNoPageFailures(failures);
159206
} finally {

0 commit comments

Comments
 (0)