fix: Sticky file headers sit below review header using CSS variable
Sets --review-header-h on the card wrapper from measured header height. FileCard reads it for sticky top offset so file headers dock just below the review header instead of overlapping it.
This commit is contained in:
@@ -82,7 +82,8 @@ export function FileCard({
|
||||
<div className="rounded-lg border border-border overflow-hidden">
|
||||
{/* File header — sticky so it stays visible when scrolling */}
|
||||
<button
|
||||
className={`sticky top-0 z-10 flex w-full items-center gap-2 px-3 py-2 bg-muted hover:bg-muted/90 text-left text-sm font-mono transition-colors ${leftBorderClass[file.changeType]}`}
|
||||
className={`sticky z-10 flex w-full items-center gap-2 px-3 py-2 bg-muted hover:bg-muted/90 text-left text-sm font-mono transition-colors ${leftBorderClass[file.changeType]}`}
|
||||
style={{ top: 'var(--review-header-h, 0px)' }}
|
||||
onClick={() => setExpanded(!expanded)}
|
||||
>
|
||||
{expanded ? (
|
||||
|
||||
@@ -323,7 +323,10 @@ export function ReviewTab({ initiativeId }: ReviewTabProps) {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="rounded-lg border border-border bg-card">
|
||||
<div
|
||||
className="rounded-lg border border-border bg-card"
|
||||
style={{ '--review-header-h': `${headerHeight}px` } as React.CSSProperties}
|
||||
>
|
||||
{/* Header: phase selector + toolbar */}
|
||||
<ReviewHeader
|
||||
ref={headerRef}
|
||||
|
||||
Reference in New Issue
Block a user