Skip to content

Commit 31680dd

Browse files
authored
🤖 fix: remove extra diff padding (#621)
## Summary - only reserve bottom padding/controls when the diff actually overflows so the file edit diff viewer no longer ends with a large black void - reuse the overflow flag for both padding and expand affordance visibility ## Testing - make typecheck _Generated with `mux`_
1 parent 95ec5e0 commit 31680dd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/shared/DiffRenderer.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,16 @@ export const DiffContainer: React.FC<
107107
};
108108
}, [resolvedMaxHeight, clampContent]);
109109

110+
const showOverflowControls = clampContent && isOverflowing;
111+
110112
return (
111113
<div className={cn("relative m-0 rounded bg-code-bg py-1.5 [&_*]:text-[inherit]", className)}>
112114
<div
113115
ref={contentRef}
114116
className={cn(
115117
"grid overflow-x-auto",
116-
clampContent ? "pb-6 overflow-y-hidden" : "overflow-y-visible"
118+
clampContent ? "overflow-y-hidden" : "overflow-y-visible",
119+
showOverflowControls && "pb-6"
117120
)}
118121
style={{
119122
fontSize: fontSize ?? "12px",
@@ -125,7 +128,7 @@ export const DiffContainer: React.FC<
125128
{children}
126129
</div>
127130

128-
{clampContent && isOverflowing && (
131+
{showOverflowControls && (
129132
<>
130133
<div className="via-[color-mix(in srgb, var(--color-code-bg) 80%, transparent)] pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-[var(--color-code-bg)] to-transparent" />
131134
<div className="absolute inset-x-0 bottom-0 flex justify-center pb-1.5">

0 commit comments

Comments
 (0)