From c9ecde700587f9f758eb25756fb543e50d5926bd Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Sat, 4 Jul 2026 16:05:18 +0800 Subject: [PATCH] fix(ui): fit mode home pages to phone viewports without scrolling Shrink mobile-only spacing so each mode home (answer, documents, differentials, prescribing, services, forms) fits a phone screen with no scrollbar unless content genuinely exceeds it. No content changes; all sm+/desktop styles are preserved exactly. Favourites and Tools hubs are intentionally untouched. - ModeHomeHero: compact prop (template-only) tightens icon/title/gaps on phones; Favourites' direct hero usage keeps the default treatment - ModeHomeTemplate: tighter mobile gaps, action-card min-height/padding, pills spacing, and footer padding (sm: restores originals) - ModeHomeMain: stop re-adding the 9rem composer reserve the standalone shell already provides (short homes scrolled by the duplication) - ClinicalDashboard: compactMobileModeHome drops the pb-32 mobile bottom padding on home states only; centred section leans toward the composer on tall phones to satisfy the vertical-weighting guard - Standalone shell #main-content: max-sm:flex-1 fills under the real header height, removing a constant 9px phantom scrollbar --- src/components/ClinicalDashboard.tsx | 25 ++++++-- .../global-mockup-search-shell.tsx | 5 +- src/components/mode-home-template.tsx | 58 ++++++++++++++----- 3 files changed, 67 insertions(+), 21 deletions(-) diff --git a/src/components/ClinicalDashboard.tsx b/src/components/ClinicalDashboard.tsx index 49ba42517..70b605421 100644 --- a/src/components/ClinicalDashboard.tsx +++ b/src/components/ClinicalDashboard.tsx @@ -5373,6 +5373,12 @@ export function ClinicalDashboard({ // stay top-aligned so their lists start in a stable position. const centeredModeHome = showDesktopHomeComposer && activeModeResultKind !== "tools" && activeModeResultKind !== "favourites"; + // Short mode homes (centred homes plus the services/forms registry homes) + // drop the large mobile bottom padding so phones don't get a scrollbar for + // content that already fits. Result views keep the full clearance. + const compactMobileModeHome = + centeredModeHome || + ((searchMode === "services" || searchMode === "forms") && !modeSearchSubmitted && !query.trim() && !loading); const renderDegradedNotice = () => ( ) to avoid a needless scrollbar. + // sm+/lg values stay identical to the result-view treatment. searchMode === "answer" - ? "pb-32 sm:pb-36 lg:pb-40" + ? compactMobileModeHome + ? "pb-4 sm:pb-36 lg:pb-40" + : "pb-32 sm:pb-36 lg:pb-40" : hasMobileBottomSearch - ? "pb-32 sm:pb-10 lg:pb-12" + ? compactMobileModeHome + ? "pb-4 sm:pb-10 lg:pb-12" + : "pb-32 sm:pb-10 lg:pb-12" : "pb-8 sm:pb-10 lg:pb-12", )} > @@ -5598,9 +5612,12 @@ export function ClinicalDashboard({
- -