Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions gui/src/styles-combos-workspace.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,21 @@
}

/* Revalidation shell: keeps the workspace body stable while aria-busy and an
sr-only status span announce in-flight refreshes to assistive tech. */
sr-only status span announce in-flight refreshes to assistive tech.
Suggested combos and their notices render above the workspace grid, which keeps
the body's full height. The body scrolls, so whatever sits above the grid scrolls
out of the way and the grid's lower part (the Save / Remove bar) stays reachable. */
.combos-workspace-shell-body {
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
overflow-x: hidden;
overflow-y: auto;
display: flex;
flex-direction: column;
}

.rb-suggest + .combos-workspace-root {
flex: 1 1 0;
min-height: 0;
height: auto;
.combos-workspace-shell-body > .combos-workspace-root {
flex: 0 0 auto;
}

.combos-workspace-rail {
Expand Down
28 changes: 28 additions & 0 deletions gui/tests/combos-workspace-scroll.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Combos page: content above the workspace grid must not push the grid's bottom out of reach.
*
* Suggested combos (and their notices) render inside `.combos-workspace-shell-body`, above
* `.combos-workspace-root`. The grid keeps the body's full height, so with anything above it
* the grid ends below the viewport. The body used to clip (`overflow: hidden`), leaving the
* lower detail fields and the Save / Remove bar unreachable (#9101). A sibling rule meant to
* shrink the grid never matched, because the suggestions are wrapped in a fieldset, and would
* have squeezed the grid to nothing once "Show all" expanded the list.
*
* Source-text assertions; the rendered geometry was measured in Chromium while fixing this.
*/
import { expect, test } from "bun:test";
import { effectiveDeclaration, withoutComments } from "./helpers/css-declarations";

const css = withoutComments(
await Bun.file(new URL("../src/styles-combos-workspace.css", import.meta.url)).text(),
);

test("the shell body scrolls, so content above the workspace can scroll out of the way", () => {
expect(effectiveDeclaration(css, ".combos-workspace-shell-body", "overflow-y")).toBe("auto");
expect(() => effectiveDeclaration(css, ".combos-workspace-shell-body", "overflow")).toThrow("property not found");
});

test("the workspace grid keeps its full height instead of shrinking under the suggestions", () => {
expect(effectiveDeclaration(css, ".combos-workspace-shell-body > .combos-workspace-root", "flex")).toBe("0 0 auto");
expect(css).not.toMatch(/\.rb-suggest\s*\+\s*\.combos-workspace-root/);
});
Loading