From 04b7e0cde9d24e29014cac03594e6e9434a006b1 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 27 Aug 2025 22:54:05 +0300 Subject: [PATCH] feat(react/floating_buttons): port execute note button --- apps/client/src/widgets/FloatingButtons.tsx | 12 ++++++++++++ .../src/widgets/floating_buttons/code_buttons.ts | 7 ------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/apps/client/src/widgets/FloatingButtons.tsx b/apps/client/src/widgets/FloatingButtons.tsx index 0e1bfc4af..5ecae1b15 100644 --- a/apps/client/src/widgets/FloatingButtons.tsx +++ b/apps/client/src/widgets/FloatingButtons.tsx @@ -61,6 +61,10 @@ const FLOATING_BUTTON_DEFINITIONS: FloatingButtonDefinition[] = [ isEnabled: ({ note, noteContext }) => note.type === "text" && noteContext?.viewScope?.viewMode === "default" && !!noteContext.viewScope?.highlightsListTemporarilyHidden + }, + { + component: RunActiveNoteButton, + isEnabled: ({ note }) => note.mime.startsWith("application/javascript") || note.mime === "text/x-sqlite;schema=trilium" } ]; @@ -213,6 +217,14 @@ function ShowHighlightsListWidgetButton({ noteContext }: FloatingButtonContext) /> } +function RunActiveNoteButton() { + return +} + /** * Show button that displays floating button after click on close button */ diff --git a/apps/client/src/widgets/floating_buttons/code_buttons.ts b/apps/client/src/widgets/floating_buttons/code_buttons.ts index 63b0d92bb..712d1d9ee 100644 --- a/apps/client/src/widgets/floating_buttons/code_buttons.ts +++ b/apps/client/src/widgets/floating_buttons/code_buttons.ts @@ -17,10 +17,6 @@ const TPL = /*html*/` } - - @@ -38,7 +34,6 @@ interface SaveSqlConsoleResponse { export default class CodeButtonsWidget extends NoteContextAwareWidget { private $openTriliumApiDocsButton!: JQuery; - private $executeButton!: JQuery; private $saveToNoteButton!: JQuery; isEnabled() { @@ -78,8 +73,6 @@ export default class CodeButtonsWidget extends NoteContextAwareWidget { } async refreshWithNote(note: FNote) { - this.$executeButton.toggle(note.mime.startsWith("application/javascript") || note.mime === "text/x-sqlite;schema=trilium"); - this.$saveToNoteButton.toggle(note.mime === "text/x-sqlite;schema=trilium" && note.isHiddenCompletely()); this.$openTriliumApiDocsButton.toggle(note.mime.startsWith("application/javascript;env="));