Skip to content

Commit 0c48e53

Browse files
fix: Diff accordion sticky headers (#583)
* Make diff accordion headers sticky while scrolling Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com> * Fix diff header hover and borders Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent 9aec1ff commit 0c48e53

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • packages/workshop-app/app/components

packages/workshop-app/app/components/diff.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,8 @@ export function DiffImplementation({
430430
<Accordion.Item
431431
key={`${fileValue}:${index}`}
432432
value={fileValue}
433-
className="border-b"
434433
>
435-
<Accordion.Header className="hover:bg-foreground/10 relative flex w-full items-center gap-3 px-4 py-2">
434+
<Accordion.Header className="bg-background/95 hover:bg-background/90 supports-[backdrop-filter]:bg-background/80 supports-[backdrop-filter]:hover:bg-background/70 border-border/70 relative sticky top-0 z-10 flex w-full items-center gap-3 border-b px-4 py-2 backdrop-blur">
436435
<Accordion.Trigger className="group flex min-w-0 flex-1 items-center justify-between gap-3 pr-38 text-left">
437436
<span className="flex min-w-0 items-center gap-2 font-mono text-sm">
438437
<Icon
@@ -468,7 +467,7 @@ export function DiffImplementation({
468467
/>
469468
</div>
470469
</Accordion.Header>
471-
<Accordion.Content className="radix-state-closed:hidden">
470+
<Accordion.Content className="radix-state-closed:hidden border-b">
472471
<FileDiff
473472
fileDiff={fileDiff}
474473
options={fileDiffOptions}

0 commit comments

Comments
 (0)