feat(FN-1545): fix mobile More sheet safe-area padding

- Fix More sheet content padding on iOS devices with notched screens
- Add CSS regression tests for safe-area-inset-* rules in mobile nav bar
- Ensure consistent padding for content area across different device safe areas
This commit is contained in:
gsxdsm
2026-04-11 11:00:52 -07:00
parent 84ae3e0163
commit 03d72f06b1
2 changed files with 22 additions and 1 deletions

View File

@@ -93,4 +93,23 @@ describe("mobile-nav-bar.css", () => {
expect(mobileMediaBlock).toContain(".project-content--with-mobile-nav");
expect(cssContent).toContain(".project-content--with-footer.project-content--with-mobile-nav");
});
it("mobile-more-sheet uses additive safe-area padding (not max) to prevent Settings clipping", () => {
// FN-1545: The mobile More sheet bottom padding must ADD safe-area inset to the
// base padding, not use max() which could collapse spacing on devices with large insets.
// This ensures the Settings item at the bottom is fully reachable on real mobile viewports.
const block = extractRuleBlock(cssContent, ".mobile-more-sheet");
// Must contain calc() with + operator for additive safe-area handling
expect(block).toMatch(/padding-bottom:\s*calc\([^)]+\s*\+\s*env\(safe-area-inset-bottom/);
// Must NOT use max() which would replace rather than add
expect(block).not.toContain("max(16px, env(safe-area-inset-bottom");
});
it("mobile-more-sheet has scrollable content to reach Settings on short viewports", () => {
const block = extractRuleBlock(cssContent, ".mobile-more-sheet");
// Must be scrollable so users can scroll to the last item (Settings)
expect(block).toContain("overflow-y: auto");
// Must have max-height to constrain but allow scrolling
expect(block).toMatch(/max-height:\s*\d+vh/);
});
});

View File

@@ -25993,7 +25993,9 @@ html .column.drag-over * {
border-top-left-radius: var(--radius-lg, 12px);
border-top-right-radius: var(--radius-lg, 12px);
padding: 16px 0;
padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
/* Additive safe-area: base padding + device safe-area inset ensures last item
(Settings) is reachable on real mobile viewports including iOS home indicator. */
padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
max-height: 70vh;
overflow-y: auto;
-webkit-overflow-scrolling: touch;