From a4306c98be612efd1a014212825108e77a4a00f1 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 14 Jul 2026 15:58:57 -0700 Subject: [PATCH] remove top/bottom table scroll shadow --- .../hooks/use-table-pane-sync.ts | 32 ----------------- .../item-table-list/item-table-list.tsx | 35 ------------------- 2 files changed, 67 deletions(-) diff --git a/src/renderer/components/item-list/item-table-list/hooks/use-table-pane-sync.ts b/src/renderer/components/item-list/item-table-list/hooks/use-table-pane-sync.ts index b00e75b3c..e623a25c0 100644 --- a/src/renderer/components/item-list/item-table-list/hooks/use-table-pane-sync.ts +++ b/src/renderer/components/item-list/item-table-list/hooks/use-table-pane-sync.ts @@ -30,7 +30,6 @@ const getPaneElements = ({ export const useTablePaneSync = ({ enableDrag, enableDragScroll, - enableHeader, handleRef, onScrollEndRef, pinnedLeftColumnCount, @@ -45,7 +44,6 @@ export const useTablePaneSync = ({ }: { enableDrag: boolean | undefined; enableDragScroll: boolean | undefined; - enableHeader: boolean; handleRef: React.RefObject; onScrollEndRef: React.RefObject< ((offset: number, internalState: ItemListStateActions) => void) | undefined @@ -634,34 +632,4 @@ export const useTablePaneSync = ({ row.removeEventListener('scroll', checkScrollPosition); }; }, [pinnedLeftColumnCount, pinnedRightColumnCount, rowRef, scrollShadowStore]); - - // Handle top shadow visibility based on vertical scroll - useEffect(() => { - const row = rowRef.current?.childNodes[0] as HTMLDivElement; - const pinnedRight = pinnedRightColumnRef.current?.childNodes[0] as HTMLDivElement; - - if (!row || !enableHeader) { - const timeout = setTimeout(() => { - scrollShadowStore.setSnapshot({ showTopShadow: false }); - }, 0); - - return () => clearTimeout(timeout); - } - - const scrollElement = pinnedRightColumnCount > 0 && pinnedRight ? pinnedRight : row; - - const checkScrollPosition = throttle(() => { - const currentScrollTop = scrollElement.scrollTop; - scrollShadowStore.setSnapshot({ showTopShadow: currentScrollTop > 0 }); - }, 50); - - checkScrollPosition(); - - scrollElement.addEventListener('scroll', checkScrollPosition, { passive: true }); - - return () => { - checkScrollPosition.cancel(); - scrollElement.removeEventListener('scroll', checkScrollPosition); - }; - }, [enableHeader, pinnedRightColumnCount, pinnedRightColumnRef, rowRef, scrollShadowStore]); }; diff --git a/src/renderer/components/item-list/item-table-list/item-table-list.tsx b/src/renderer/components/item-list/item-table-list/item-table-list.tsx index 47c6f98be..41087b04a 100644 --- a/src/renderer/components/item-list/item-table-list/item-table-list.tsx +++ b/src/renderer/components/item-list/item-table-list/item-table-list.tsx @@ -126,25 +126,6 @@ export enum TableItemSize { LARGE = 88, } -const ItemTableScrollShadowTop = memo(function ItemTableScrollShadowTop({ - enableHeader, - enableScrollShadow, - scrollShadowStore, -}: { - enableHeader: boolean; - enableScrollShadow: boolean; - scrollShadowStore: TableScrollShadowStore; -}) { - const { showTopShadow } = useSyncExternalStore( - scrollShadowStore.subscribe, - scrollShadowStore.getSnapshot, - ); - if (!enableHeader || !enableScrollShadow || !showTopShadow) return null; - return
; -}); - -ItemTableScrollShadowTop.displayName = 'ItemTableScrollShadowTop'; - const ItemTableScrollShadowLeft = memo(function ItemTableScrollShadowLeft({ enableScrollShadow, pinnedLeftColumnCount, @@ -585,11 +566,6 @@ const VirtualizedTableGrid = ({ />
)} - {!!pinnedLeftColumnCount && (
)} -
)} -