Skip to content

Commit 394af78

Browse files
fix(gui): let the Combos page scroll past suggested combos (#9101) (#9105)
Co-authored-by: JUN <jun@lidgeai.com>
1 parent 9c3ddc4 commit 394af78

2 files changed

Lines changed: 36 additions & 6 deletions

File tree

‎gui/src/styles-combos-workspace.css‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,21 @@
3030
}
3131

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

42-
.rb-suggest + .combos-workspace-root {
43-
flex: 1 1 0;
44-
min-height: 0;
45-
height: auto;
46+
.combos-workspace-shell-body > .combos-workspace-root {
47+
flex: 0 0 auto;
4648
}
4749

4850
.combos-workspace-rail {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* Combos page: content above the workspace grid must not push the grid's bottom out of reach.
3+
*
4+
* Suggested combos (and their notices) render inside `.combos-workspace-shell-body`, above
5+
* `.combos-workspace-root`. The grid keeps the body's full height, so with anything above it
6+
* the grid ends below the viewport. The body used to clip (`overflow: hidden`), leaving the
7+
* lower detail fields and the Save / Remove bar unreachable (#9101). A sibling rule meant to
8+
* shrink the grid never matched, because the suggestions are wrapped in a fieldset, and would
9+
* have squeezed the grid to nothing once "Show all" expanded the list.
10+
*
11+
* Source-text assertions; the rendered geometry was measured in Chromium while fixing this.
12+
*/
13+
import { expect, test } from "bun:test";
14+
import { effectiveDeclaration, withoutComments } from "./helpers/css-declarations";
15+
16+
const css = withoutComments(
17+
await Bun.file(new URL("../src/styles-combos-workspace.css", import.meta.url)).text(),
18+
);
19+
20+
test("the shell body scrolls, so content above the workspace can scroll out of the way", () => {
21+
expect(effectiveDeclaration(css, ".combos-workspace-shell-body", "overflow-y")).toBe("auto");
22+
expect(() => effectiveDeclaration(css, ".combos-workspace-shell-body", "overflow")).toThrow("property not found");
23+
});
24+
25+
test("the workspace grid keeps its full height instead of shrinking under the suggestions", () => {
26+
expect(effectiveDeclaration(css, ".combos-workspace-shell-body > .combos-workspace-root", "flex")).toBe("0 0 auto");
27+
expect(css).not.toMatch(/\.rb-suggest\s*\+\s*\.combos-workspace-root/);
28+
});

0 commit comments

Comments
 (0)