fix(onboarding): keep the tour card above the home indicator

On a phone the tour falls back to a card at the bottom edge, 8 px above
it, so in the installed app its Next and Skip row sat inside the home
indicator strip. The card now adds the bottom safe area, as the bottom
bar and the sheets do.
This commit is contained in:
Marc-André Bombeck committed 2026-11-11 21:49:56 +01:00
1 parent 54c12473eb
commit 8352b1eef2
2 files changed
+9 -1

No files matched your search

@@ -139,6 +139,14 @@ describe("the shell owns the safe area", () => {
expect(grid).toMatch(/\boverscroll-contain\b/);
});
it("the onboarding tour's bottom card clears the home indicator", () => {
const tour = code(read("src/components/onboarding/tour.tsx"));
const card = tour.match(/"[^"]*absolute inset-x-2 [^"]*"/)?.[0] ?? "";
expect(card).toMatch(
/\bbottom-\[calc\(env\(safe-area-inset-bottom,0px\)\+0\.5rem\)\]/,
);
});
it("the sheet primitives name their side for those rules", () => {
expect(read("src/components/ui/sheet.tsx")).toMatch(
/data-sheet-side=\{side\}/,
+1 -1
View File
@@ -706,7 +706,7 @@ export function OnboardingTour({
// centred above the bottom edge on wide ones (`mx-auto` +
// `max-w`). Used on EVERY viewport when no anchored
// placement keeps the footer buttons inside the viewport.
"bg-card border-border pointer-events-auto absolute inset-x-2 bottom-2 mx-auto max-h-[70vh] max-w-[22rem] overflow-x-hidden overflow-y-auto rounded-xl border p-4 shadow-2xl md:p-6"
"bg-card border-border pointer-events-auto absolute inset-x-2 bottom-[calc(env(safe-area-inset-bottom,0px)+0.5rem)] mx-auto max-h-[70vh] max-w-[22rem] overflow-x-hidden overflow-y-auto rounded-xl border p-4 shadow-2xl md:p-6"
: "bg-card border-border pointer-events-auto absolute max-w-[22rem] overflow-x-hidden overflow-y-auto rounded-xl border p-4 shadow-2xl md:p-6"
}
style={