From 3093a9e5d013df3e1de7f7e8341bb4d493e52120 Mon Sep 17 00:00:00 2001 From: suyao Date: Fri, 21 Nov 2025 13:20:25 +0800 Subject: [PATCH] clean comment --- src/renderer/src/components/VirtualList/dynamic.tsx | 7 ------- src/renderer/src/pages/notes/NotesSidebar.tsx | 12 ------------ 2 files changed, 19 deletions(-) diff --git a/src/renderer/src/components/VirtualList/dynamic.tsx b/src/renderer/src/components/VirtualList/dynamic.tsx index 0f5d08c6ee..d1244ecedb 100644 --- a/src/renderer/src/components/VirtualList/dynamic.tsx +++ b/src/renderer/src/components/VirtualList/dynamic.tsx @@ -131,7 +131,6 @@ function DynamicVirtualList(props: DynamicVirtualListProps) { const internalStickyRangeExtractor = useCallback( (range: Range) => { - // VSCode-like sticky behavior: show ancestor chain of current visible items const activeStickies: number[] = [] if (getItemDepth) { @@ -298,14 +297,8 @@ function DynamicVirtualList(props: DynamicVirtualListProps) { position: isItemActiveSticky ? 'sticky' : 'absolute', top: isItemActiveSticky ? stickyOffset : 0, left: 0, - // Critical: Sticky items need higher z-index than non-sticky items - // Ancestors (lower activeStickyIndex) should have HIGHER z-index - // Non-sticky items get z-index 0 to ensure they render below sticky items zIndex: isItemActiveSticky ? 1000 + (100 - activeStickyIndex) : isItemSticky ? 999 : 0, - // CRITICAL: Disable pointer events for items covered by sticky headers - // This prevents hover/click events from bleeding through pointerEvents: isCoveredBySticky ? 'none' : 'auto', - // Add background and shadow for active sticky items ...(isItemActiveSticky && { backgroundColor: 'var(--color-background)' }), diff --git a/src/renderer/src/pages/notes/NotesSidebar.tsx b/src/renderer/src/pages/notes/NotesSidebar.tsx index cf4d2fee86..91c7659580 100644 --- a/src/renderer/src/pages/notes/NotesSidebar.tsx +++ b/src/renderer/src/pages/notes/NotesSidebar.tsx @@ -60,7 +60,6 @@ const NotesSidebar: FC = ({ const { activeNode } = useActiveNode(notesTree) const sortType = useAppSelector(selectSortType) - // --- State --- const [isShowStarred, setIsShowStarred] = useState(false) const [isShowSearch, setIsShowSearch] = useState(false) const [searchKeyword, setSearchKeyword] = useState('') @@ -72,13 +71,9 @@ const NotesSidebar: FC = ({ const trimmedSearchKeyword = useMemo(() => searchKeyword.trim(), [searchKeyword]) const hasSearchKeyword = trimmedSearchKeyword.length > 0 - // --- Hooks --- - - // Editing Hook const { editingNodeId, renamingNodeIds, newlyRenamedNodeIds, inPlaceEdit, handleStartEdit, handleAutoRename } = useNotesEditing({ onRenameNode }) - // Drag and Drop Hook const { draggedNodeId, dragOverNodeId, @@ -90,13 +85,11 @@ const NotesSidebar: FC = ({ handleDragEnd } = useNotesDragAndDrop({ onMoveNode }) - // File Upload Hook const { handleDropFiles, handleSelectFiles, handleSelectFolder } = useNotesFileUpload({ onUploadFiles, setIsDragOverSidebar }) - // Menu Hook const { getMenuItems } = useNotesMenu({ renamingNodeIds, onCreateNote, @@ -110,7 +103,6 @@ const NotesSidebar: FC = ({ activeNode }) - // Search Hook const searchOptions = useMemo( () => ({ debounceMs: 300, @@ -132,14 +124,10 @@ const NotesSidebar: FC = ({ stats: searchStats } = useFullTextSearch(searchOptions) - // --- Effects --- - - // Sync notesTree to ref useEffect(() => { notesTreeRef.current = notesTree }, [notesTree]) - // Trigger Search useEffect(() => { if (!isShowSearch) { reset()