feat(react/floating_buttons): port execute note button

This commit is contained in:
Elian Doran
2025-08-27 22:54:05 +03:00
parent 401260d3ca
commit 04b7e0cde9
2 changed files with 12 additions and 7 deletions

View File

@@ -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 <ActionButton
icon="bx bx-play"
text={t("code_buttons.execute_button_title")}
triggerCommand="runActiveNote"
/>
}
/**
* Show button that displays floating button after click on close button
*/