Task 4b: Fix PatientBanner scroll condensation
Root cause: sentinel element with `absolute top-0` inside PatientBanner was positioned at viewport top, always triggering the IntersectionObserver's -100px rootMargin threshold — banner was permanently stuck in condensed state. Fix: Restructured PMRInterface layout from document-scroll to flex container with explicit scroll container (`overflow-y-auto` on main). Lifted scroll condensation logic to PMRInterface, passing `isCondensed` prop down to PatientBanner. Replaced IntersectionObserver with scroll event listener on the main element for reliable scroll position detection. Key changes: - PMRInterface: flex h-screen overflow-hidden layout (sidebar + content column) - PatientBanner: accepts isCondensed prop, removed sticky/sentinel/hook - ClinicalSidebar: h-full instead of h-screen sticky (parent handles sizing) - useScrollCondensation: scroll event on container element via callback ref Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -168,7 +168,7 @@ export function ClinicalSidebar({ activeView, onViewChange, isTablet = false }:
|
||||
<aside
|
||||
role="navigation"
|
||||
aria-label="Clinical record navigation"
|
||||
className="hidden md:flex lg:hidden flex-col w-14 h-screen sticky top-0 bg-pmr-sidebar text-white"
|
||||
className="hidden md:flex lg:hidden flex-col w-14 h-full bg-pmr-sidebar text-white"
|
||||
>
|
||||
<div className="p-2 border-b border-white/10">
|
||||
<div className="font-inter font-medium text-[10px] text-white/50 text-center leading-tight">
|
||||
@@ -230,7 +230,7 @@ export function ClinicalSidebar({ activeView, onViewChange, isTablet = false }:
|
||||
<aside
|
||||
role="navigation"
|
||||
aria-label="Clinical record navigation"
|
||||
className="hidden lg:flex flex-col w-[220px] h-screen sticky top-0 bg-pmr-sidebar text-white"
|
||||
className="hidden lg:flex flex-col w-[220px] h-full bg-pmr-sidebar text-white"
|
||||
>
|
||||
<div className="p-4 border-b border-white/10">
|
||||
<div className="font-inter font-medium text-[13px] text-white/50 leading-tight">
|
||||
|
||||
Reference in New Issue
Block a user