fix focus scroll layering

This commit is contained in:
Thomas Camlong authored and ajnart committed 2026-08-13 19:54:46 +02:00
1 parent 758c300d9e
commit d2a935b6c1
6 files changed
+23 -16

No files matched your search

@@ -35,7 +35,7 @@
.surfaceHostAdvanced {
position: fixed;
inset: 0;
z-index: calc(var(--mantine-z-index-popover) - 1);
z-index: calc(var(--mantine-z-index-modal) - 1);
width: auto;
height: auto;
pointer-events: none;
@@ -201,7 +201,7 @@ export const BoardAdvancedFocusProvider = ({ children }: PropsWithChildren) => {
data-advanced-focus-overlay
backgroundOpacity={0.38}
blur={0}
zIndex="calc(var(--mantine-z-index-popover) - 2)"
zIndex="calc(var(--mantine-z-index-modal) - 2)"
className={`${classes.backdrop} ${active.phase === "closing" ? classes.backdropClosing : ""}`}
aria-hidden
/>
+19 -2
View File
@@ -120,13 +120,30 @@ describe("Board advanced interactions", () => {
probe.dataset.shiftScrollProbe = "true";
probe.style.cssText = "height:80px;overflow-y:auto";
probe.innerHTML = '<div style="height:600px"></div>';
probe.addEventListener("wheel", (event) => event.stopPropagation());
element.append(probe);
});
const scrollProbe = advancedSurface.locator("[data-shift-scroll-probe]");
await page.keyboard.down("Shift");
await scrollProbe.dispatchEvent("wheel", { shiftKey: true, deltaX: 120, deltaY: 0 });
const pixelEventCancelled = await scrollProbe.evaluate(
(element) =>
!element.dispatchEvent(
new WheelEvent("wheel", { bubbles: true, cancelable: true, shiftKey: true, deltaX: 120 }),
),
);
expect(pixelEventCancelled).toBe(true);
await scrollProbe.evaluate((element) => {
element.scrollTop = 0;
});
const lineEventCancelled = await scrollProbe.evaluate(
(element) =>
!element.dispatchEvent(
new WheelEvent("wheel", { bubbles: true, cancelable: true, shiftKey: true, deltaX: 3, deltaMode: 1 }),
),
);
await page.keyboard.up("Shift");
expect(await scrollProbe.evaluate((element) => element.scrollTop)).toBeGreaterThan(0);
expect(lineEventCancelled).toBe(true);
expect(await scrollProbe.evaluate((element) => element.scrollTop)).toBeGreaterThanOrEqual(48);
await page.keyboard.press("Escape");
await expect(advancedSurface).toBeHidden();
await expect(widget).toBeFocused();
@@ -1,7 +1,7 @@
export interface StreamSession {
sessionId: string;
sessionName: string;
user?: {
user: {
userId: string;
username: string;
profilePictureUrl: string | null;
@@ -28,7 +28,7 @@ export const DiskUsage = ({ system, fontSize, progressSize, valueMiw, valueGap =
{formatPercent(system.disk)}
</Text>
<HoverCard
zIndex={getDefaultZIndex("popover") - 3}
zIndex={getDefaultZIndex("modal") - 3}
position="right"
withArrow
shadow="md"
-10
View File
@@ -42,16 +42,6 @@ describe("getWidgetQueryKeys", () => {
});
describe("supportsAdvancedFocus", () => {
const definition = { supportsAdvancedFocus: undefined } as Parameters<typeof supportsAdvancedFocus>[0];
test("defaults to enabled", () => {
expect(supportsAdvancedFocus(definition)).toBe(true);
});
test("allows widgets to opt out", () => {
expect(supportsAdvancedFocus({ ...definition, supportsAdvancedFocus: false })).toBe(false);
});
test.each([appDefinition, beszelSystemGridDefinition, beszelSystemTableDefinition])(
"keeps non-enhanced widgets compact",
(widgetDefinition) => {