From a6fade88c40a76cd688a41ac30298e65f25a55be Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 23 Nov 2026 02:48:55 +0900 Subject: [PATCH] Remove unused FavoriteShortcuts component --- knip.jsonc | 1 - src/chat/components/FavoriteShortcuts.tsx | 96 ----------------------- 2 files changed, 97 deletions(-) delete mode 100644 src/chat/components/FavoriteShortcuts.tsx diff --git a/knip.jsonc b/knip.jsonc index 9b24f0888..c3b989f69 100644 --- a/knip.jsonc +++ b/knip.jsonc @@ -18,7 +18,6 @@ "vite": { "config": [] }, // Existing findings at adoption. Delete entries as the corresponding code is cleaned up. "ignoreFiles": [ - "src/chat/components/FavoriteShortcuts.tsx", "src/chat/components/marketing-welcome.css", "src/chat/components/ui/Switch.tsx", "src/chat/components/ui/TextInput.tsx", diff --git a/src/chat/components/FavoriteShortcuts.tsx b/src/chat/components/FavoriteShortcuts.tsx deleted file mode 100644 index c4c7b2a79..000000000 --- a/src/chat/components/FavoriteShortcuts.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import { useCallback } from 'react' -import { DragDropProvider } from '@dnd-kit/react' -import { useSortable, isSortable } from '@dnd-kit/react/sortable' -import { PointerSensor, PointerActivationConstraints } from '@dnd-kit/dom' -import type { HomeSection } from '../core/home-navigation' -import { homeResources } from './home-resources' -import { IconButton } from './IconButton' - -function Shortcut({ - id, - index, - onOpen, - active = false, -}: { - active?: boolean - id: HomeSection - index: number - onOpen: (id: HomeSection) => void -}) { - const { ref, handleRef, isDragging } = useSortable({ - id, - index, - group: 'favorite-pages', - }) - const attachButton = useCallback( - (node: HTMLButtonElement | null) => { - ref(node) - handleRef(node) - }, - [ref, handleRef], - ) - const Icon = homeResources[id].icon - return ( - onOpen(id)} - > - - - ) -} -export function FavoriteShortcuts({ - favorites, - activeId, - onMove, - onOpen, -}: { - activeId?: string - favorites: HomeSection[] - onMove: (id: HomeSection, index: number) => void - onOpen: (id: HomeSection) => void -}) { - return ( - [ - ...defaults.filter((sensor) => sensor !== PointerSensor), - PointerSensor.configure({ - activationConstraints: (event) => - event.pointerType === 'touch' - ? [ - new PointerActivationConstraints.Delay({ - value: 180, - tolerance: 5, - }), - ] - : [new PointerActivationConstraints.Distance({ value: 5 })], - }), - ]} - onDragEnd={(event) => { - const source = event.operation.source - if ( - !event.canceled && - isSortable(source) && - source.index !== source.initialIndex - ) { - onMove(source.id as HomeSection, source.index) - } - }} - > - {favorites.map((id, index) => ( - - ))} - - ) -}