diff --git a/src/app/service/service_worker/client.ts b/src/app/service/service_worker/client.ts index 94f2642d2..3e3fd3575 100644 --- a/src/app/service/service_worker/client.ts +++ b/src/app/service/service_worker/client.ts @@ -2,7 +2,7 @@ import type { Script, ScriptCode, ScriptRunResource, TClientPageLoadInfo } from import { type Resource } from "@App/app/repo/resource"; import { type Subscribe } from "@App/app/repo/subscribe"; import { type Permission } from "@App/app/repo/permission"; -import type { InstallSource, ScriptMenu, ScriptMenuItem, SearchType, TBatchUpdateListAction } from "./types"; +import type { InstallSource, ScriptMenu, ScriptMenuItem, TBatchUpdateListAction } from "./types"; import { Client } from "@Packages/message/client"; import type { MessageSend } from "@Packages/message/types"; import type PermissionVerify from "./permission_verify"; @@ -66,7 +66,7 @@ export class ScriptClient extends Client { return this.doThrow("fetchInfo", uuid); } - getFilterResult(req: { type: SearchType; value: string }): Promise { + getFilterResult(req: { value: string }): Promise { return this.do("getFilterResult", req); } diff --git a/src/app/service/service_worker/script.ts b/src/app/service/service_worker/script.ts index 52dfac5ea..b8ed0ecad 100644 --- a/src/app/service/service_worker/script.ts +++ b/src/app/service/service_worker/script.ts @@ -45,7 +45,6 @@ import { BatchUpdateListActionCode, type TBatchUpdateListAction, UpdateStatusCode, - type SearchType, type TBatchUpdateRecord, } from "./types"; import { getSimilarityScore, ScriptUpdateCheck } from "./script_update_check"; @@ -552,7 +551,7 @@ export class ScriptService { return true; } - async getFilterResult(req: { type: SearchType; value: string }) { + async getFilterResult(req: { value: string }) { const OPTION_CASE_INSENSITIVE = true; const scripts = await this.scriptDAO.all(); const scriptCodes = await Promise.all( diff --git a/src/pages/options/routes/ScriptList/ScriptCard.tsx b/src/pages/options/routes/ScriptList/ScriptCard.tsx index f68d3e909..ddeec35ed 100644 --- a/src/pages/options/routes/ScriptList/ScriptCard.tsx +++ b/src/pages/options/routes/ScriptList/ScriptCard.tsx @@ -1,16 +1,5 @@ -import React, { useMemo, useState } from "react"; -import { - Avatar, - Button, - Card, - Divider, - Input, - Popconfirm, - Space, - Tag, - Tooltip, - Typography, -} from "@arco-design/web-react"; +import React, { useMemo } from "react"; +import { Avatar, Button, Card, Divider, Popconfirm, Space, Tag, Tooltip, Typography } from "@arco-design/web-react"; import { Link, useNavigate } from "react-router-dom"; import { IconClockCircle, IconDragDotVertical } from "@arco-design/web-react/icon"; import { @@ -30,7 +19,7 @@ import { hashColor, ScriptIcons } from "../utils"; import { getCombinedMeta } from "@App/app/service/service_worker/utils"; import { parseTags } from "@App/app/repo/metadata"; import type { ScriptLoading } from "@App/pages/store/features/script"; -import { EnableSwitch, HomeCell, MemoizedAvatar, SourceCell, UpdateTimeCell } from "./components"; +import { EnableSwitch, HomeCell, MemoizedAvatar, ScriptSearchField, SourceCell, UpdateTimeCell } from "./components"; import { useTranslation } from "react-i18next"; import { VscLayoutSidebarLeft, VscLayoutSidebarLeftOff } from "react-icons/vsc"; import { FaThList } from "react-icons/fa"; @@ -39,6 +28,8 @@ import { DndContext, KeyboardSensor, PointerSensor, useSensor, useSensors } from import { rectSortingStrategy, SortableContext, sortableKeyboardCoordinates, useSortable } from "@dnd-kit/sortable"; import { CSS } from "@dnd-kit/utilities"; import { useAppContext } from "@App/pages/store/AppContext"; +import type { SetSearchRequest } from "./hooks"; +import type { SearchType } from "@App/app/service/service_worker/types"; const { Text } = Typography; @@ -337,7 +328,8 @@ interface ScriptCardProps { updateScripts: (uuids: string[], data: Partial