fix(documents): keep the bulk bar clear of the bottom bar on a phone held sideways

The bar dropped to the page edge at md, but the bottom bar follows the
shell and stays on a touch screen held sideways, which left the action
row, Delete included, half under it. Key the drop on shell-desktop and
include the home-indicator inset.
This commit is contained in:
Marc-André Bombeck committed 2026-10-08 22:57:47 +02:00
1 parent ca47077944
commit 78b0cc06e2
2 files changed
+15 -1

No files matched your search

@@ -110,4 +110,15 @@ describe("<DocumentBulkBar>", () => {
// assertion above is about the visit menu and not about an empty render.
expect(html).toContain("Link condition");
});
it("drops to the page edge only when the bottom bar is gone", () => {
// The bar follows the shell, not `md`: a phone held sideways is wider
// than `md` and still shows the bottom bar over a `md:` drop.
const html = render([]);
const cls =
html.match(/data-slot="document-bulk-bar"[^>]*class="([^"]*)"/)?.[1] ??
"";
expect(cls).toContain("shell-desktop:bottom-6");
expect(cls).not.toMatch(/(?<![\w-])md:bottom-/);
});
});
@@ -112,7 +112,10 @@ export function DocumentBulkBar({
role="toolbar"
aria-label={t("documents.bulk.barLabel")}
className={cn(
"bg-card border-border fixed bottom-20 left-1/2 z-40 -translate-x-1/2 md:bottom-6",
// Clear of the bottom bar (and the home indicator) for as long as
// the bar shows, which is the shell's call, not a width's: a phone
// held sideways is wider than `md` and still has the bar.
"bg-card border-border shell-desktop:bottom-6 fixed bottom-[calc(env(safe-area-inset-bottom,0px)+5rem)] left-1/2 z-40 -translate-x-1/2",
// v1.42 — while a day is docked on the right, the bar sits against
// the page's right edge instead of the window's centre, clear of the
// day's footer actions and of an expanded sidebar.