From 68cba8d3b26dc44920cc8a0bfcfffb19d23a44cc Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 24 Aug 2025 18:09:33 +0300 Subject: [PATCH] chore(react/ribbon): port debug --- .../widgets/ribbon/SearchDefinitionTab.tsx | 17 +++++++++-- .../src/widgets/search_options/debug.ts | 30 ------------------- 2 files changed, 14 insertions(+), 33 deletions(-) delete mode 100644 apps/client/src/widgets/search_options/debug.ts diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx index 9ced53a6d..89f62be73 100644 --- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx +++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx @@ -97,7 +97,8 @@ const SEARCH_OPTIONS: SearchOption[] = [ attributeType: "label", icon: "bx bx-bug", label: t("search_definition.debug"), - tooltip: t("search_definition.debug_description") + tooltip: t("search_definition.debug_description"), + component: DebugOption } ]; @@ -412,9 +413,19 @@ function AncestorOption({ note, ...restProps}: SearchOptionProps) { function FastSearchOption({ ...restProps }: SearchOptionProps) { return +} + +function DebugOption({ ...restProps }: SearchOptionProps) { + return +

{t("debug.debug_info")}

+ {t("debug.access_info")} + } + {...restProps} + /> } \ No newline at end of file diff --git a/apps/client/src/widgets/search_options/debug.ts b/apps/client/src/widgets/search_options/debug.ts deleted file mode 100644 index bdcf585e4..000000000 --- a/apps/client/src/widgets/search_options/debug.ts +++ /dev/null @@ -1,30 +0,0 @@ -import AbstractSearchOption from "./abstract_search_option.js"; -import { t } from "../../services/i18n.js"; - -const TPL = /*html*/` - - - - ${t("debug.debug")} - - - - - -`; - -export default class Debug extends AbstractSearchOption { - static async create(noteId: string) { - await AbstractSearchOption.setAttribute(noteId, "label", "debug"); - } - - doRender() { - return $(TPL); - } -}