Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
refactor(client): remove the floating edit button
Elian Doran3cad20072025
diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.cssindex 12ec8e97e8..600501c238 100644--- a/apps/client/src/stylesheets/style.css+++ b/apps/client/src/stylesheets/style.css@@ -2412,7 +2412,7 @@ body.zen .note-badges > *:not(.read-only-badge),body.zen .note-actions-bar,body.zen .inline-title,body.zen .promoted-attributes-widget,-body.zen .floating-buttons-children > *:not(.bx-edit-alt),+body.zen .floating-buttons-children > *,body.zen .action-button,body.zen .tooltip.content-hint, /* content-area hints (task states, collapsible summaries, drag handles) */body.zen .note-split:not(.type-book) .note-list-widget {diff --git a/apps/client/src/stylesheets/theme-next/shell.css b/apps/client/src/stylesheets/theme-next/shell.cssindex d57fd96707..a300666c07 100644--- a/apps/client/src/stylesheets/theme-next/shell.css+++ b/apps/client/src/stylesheets/theme-next/shell.css@@ -1664,27 +1664,6 @@ div.floating-buttons-children .close-floating-buttons:has(.close-floating-buttongap: 0;}-/* The highlight animation */--@keyframes floating-button-highlight {- from {- background: var(--floating-button-background);- color: var(--floating-button-color);- } to {- background: var(--floating-button-hover-background);- color: var(--floating-button-hover-color);- }-}--.floating-buttons .bx-tada {- /* The class is applied for 1700ms */- animation: floating-button-highlight 425ms ease-in-out alternate infinite;-}--.floating-buttons .bx-tada::before {- font-size: var(--floating-button-icon-size);-}-/* Button groups */:root .floating-buttons .btn-group {--button-group-active-button-background-color: var(--low-profile-button-active-background-color);diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex 4f8bd97f6f..35bdb64ef1 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -1081,9 +1081,6 @@"create_pane_button": {"create_new_split": "Create new split"},- "edit_button": {- "edit_this_note": "Edit this note"- },"options": {"title": "Options","back": "Back to all options",diff --git a/apps/client/src/widgets/FloatingButtonsDefinitions.tsx b/apps/client/src/widgets/FloatingButtonsDefinitions.tsxindex c8d5a1370c..2b21ba9fe0 100644--- a/apps/client/src/widgets/FloatingButtonsDefinitions.tsx+++ b/apps/client/src/widgets/FloatingButtonsDefinitions.tsx@@ -19,7 +19,7 @@ import toast from "../services/toast";import tree from "../services/tree";import { createImageSrcUrl, isElectron, openInAppHelpFromUrl } from "../services/utils";import ActionButton, { ActionButtonProps } from "./react/ActionButton";-import { useIsNoteReadOnly, useTriliumEvent, useWindowSize } from "./react/hooks";+import { useTriliumEvent, useWindowSize } from "./react/hooks";import NoItems from "./react/NoItems";import NoteLink from "./react/NoteLink";import RawHtml from "./react/RawHtml";@@ -43,7 +43,6 @@ function FloatingButton({ className, ...props }: ActionButtonProps) {export type FloatingButtonsList = ((context: FloatingButtonContext) => false | VNode)[];export const DESKTOP_FLOATING_BUTTONS: FloatingButtonsList = [- EditButton,RunActiveNoteButton,OpenTriliumApiDocsButton,OpenElectronApiDocsButton,@@ -62,29 +61,6 @@ export const POPUP_HIDDEN_FLOATING_BUTTONS: FloatingButtonsList = [InAppHelpButton];-function EditButton({ note, noteContext }: FloatingButtonContext) {- const [animationClass, setAnimationClass] = useState("");- const {isReadOnly, enableEditing} = useIsNoteReadOnly(note, noteContext);-- const isReadOnlyInfoBarDismissed = false; // TODO-- useEffect(() => {- if (isReadOnly) {- setAnimationClass("bx-tada bx-lg");- setTimeout(() => {- setAnimationClass("");- }, 1700);- }- }, [ isReadOnly ]);-- return !!isReadOnly && isReadOnlyInfoBarDismissed && <FloatingButton- text={t("edit_button.edit_this_note")}- icon="bx bx-pencil"- className={animationClass}- onClick={() => enableEditing()}- />;-}-function RunActiveNoteButton({ note }: FloatingButtonContext) {const isEnabled = (note.mime.startsWith("application/javascript") || note.mime === "text/x-sqlite;schema=trilium");return isEnabled && <FloatingButton