Revert "Fix sticky header flicker while analytics tables scroll underneath."

This reverts commit fd8f7b51e8.
This commit is contained in:
Developing-Gamer
2026-07-14 11:14:28 -07:00
parent d39799aea9
commit 180e561bc1
2 changed files with 22 additions and 15 deletions
@@ -731,6 +731,13 @@ export default function SidebarLayout(props: { children?: React.ReactNode }) {
WebkitMaskImage: 'linear-gradient(to bottom, black 50%, transparent 100%)',
}}
/>
{/* Opaque underlay for dark mode. Table/page content scrolls under this sticky
header; without a solid base, the translucent fill + backdrop-filter composite
a bright seam along the bottom edge whenever rows pass behind it. */}
<div
aria-hidden
className="pointer-events-none absolute inset-0 hidden rounded-2xl bg-background dark:block"
/>
<div className="relative flex h-14 items-center justify-between px-5 dark:bg-foreground/5 dark:px-4 dark:border dark:border-foreground/5 dark:backdrop-blur-2xl dark:shadow-sm dark:rounded-2xl">
{/* Left section: Logo + Menu + Project Switcher */}
<div className="flex grow-1 items-center gap-2">
+15 -15
View File
@@ -1005,20 +1005,21 @@ export function CmdKSearch({
// Trigger button component that can be placed in the header
export function CmdKTrigger() {
const mouseCursorRef = useRef<HTMLDivElement>(null);
const mouseCursorParentRef = useRef<HTMLDivElement>(null);
const modifierKeyLabel = getShortcutModifierKeyLabel();
useEffect(() => {
const handleMouseMove = (e: MouseEvent) => {
if (mouseCursorRef.current && mouseCursorParentRef.current) {
const rect = mouseCursorParentRef.current.getBoundingClientRect();
mouseCursorRef.current.style.left = `${e.clientX - rect.left}px`;
mouseCursorRef.current.style.top = `${e.clientY - rect.top}px`;
mouseCursorRef.current.style.display = "block";
}
};
document.addEventListener("mousemove", handleMouseMove);
return () => document.removeEventListener("mousemove", handleMouseMove);
const handleMouseMove = useCallback((event: React.MouseEvent<HTMLButtonElement>) => {
const cursor = mouseCursorRef.current;
if (cursor == null) {
return;
}
// Keep this glow local to the trigger. A document-level mousemove listener used to
// reposition a blurred layer under the translucent header on every cursor move across
// the page, continuously recompositing the sticky header while table rows scrolled
// behind it and making the header's bottom edge flicker.
const rect = event.currentTarget.getBoundingClientRect();
cursor.style.left = `${event.clientX - rect.left}px`;
cursor.style.top = `${event.clientY - rect.top}px`;
}, []);
return (
@@ -1026,6 +1027,7 @@ export function CmdKTrigger() {
<button
data-walkthrough-nav="cmdk-trigger"
onClick={() => window.dispatchEvent(new CustomEvent("spotlight-toggle"))}
onMouseMove={handleMouseMove}
className={cn(
"group relative flex items-center gap-3 h-9 px-4 min-w-[240px]",
"rounded-[12px]",
@@ -1035,10 +1037,9 @@ export function CmdKTrigger() {
)}
>
<div
ref={mouseCursorParentRef}
className={cn(
"absolute inset-[2px] overflow-hidden rounded-[10px] -z-20",
"group-hover:opacity-100 transition-opacity duration-300 group-hover:transition-none",
"opacity-0 group-hover:opacity-100 transition-opacity duration-300 group-hover:transition-none",
)}
>
<div
@@ -1049,7 +1050,6 @@ export function CmdKTrigger() {
"rounded-full",
"pointer-events-none",
"-translate-x-1/2 -translate-y-1/2",
"hidden",
)}
/>
</div>