Skip to content

Build your personal knowledge base with Trilium Notes

style(menu): keep the titles of a row of actions on one line

Elian Doran16cabdd131e0
diff --git a/apps/client/src/menus/tree_context_menu.ts b/apps/client/src/menus/tree_context_menu.ts
index 0e5a697093..9cc6e18282 100644
--- a/apps/client/src/menus/tree_context_menu.ts
+++ b/apps/client/src/menus/tree_context_menu.ts
@@ -151,7 +151,7 @@ export async function buildTreeContextMenuItems(ctx: TreeContextMenuContext): Pr
uiIcon: "bx bx-cut",
enabled: isNotRoot && !isHoisted && parentNotSearch
},
- { title: t("tree-context-menu.copy-clone"), command: "copyNotesToClipboard", keyboardShortcut: "copyNotesToClipboard", uiIcon: "bx bx-copy", enabled: isNotRoot && !isHoisted },
+ { title: t("tree-context-menu.clone"), command: "copyNotesToClipboard", keyboardShortcut: "copyNotesToClipboard", uiIcon: "bx bx-copy", enabled: isNotRoot && !isHoisted },
{
title: t("tree-context-menu.paste-into"),
command: "pasteNotesFromClipboard",
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 4a09c9a587..4d3403175d 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -2525,7 +2525,6 @@
"copy-note-path-to-clipboard": "Copy note path to clipboard",
"protect-subtree": "Protect subtree",
"unprotect-subtree": "Unprotect subtree",
- "copy-clone": "Copy / clone",
"clone-to": "Clone to...",
"cut": "Cut",
"move-to": "Move to...",
@@ -2540,7 +2539,8 @@
"converted-to-attachments_one": "{{count}} note has been converted to attachments.",
"converted-to-attachments_other": "{{count}} notes have been converted to attachments.",
"convert-to-attachment-confirm": "Are you sure you want to convert the selected notes into attachments of their parent notes? This operation only applies to Image notes, other notes will be skipped.",
- "open-in-popup": "Quick edit"
+ "open-in-popup": "Quick edit",
+ "clone": "Clone"
},
"shared_info": {
"shared_publicly": "This note is shared publicly on {{- link}}.",
diff --git a/apps/client/src/widgets/react/Menu.css b/apps/client/src/widgets/react/Menu.css
index 80bc6b57b8..f0e037da47 100644
--- a/apps/client/src/widgets/react/Menu.css
+++ b/apps/client/src/widgets/react/Menu.css
@@ -246,12 +246,12 @@ body.desktop .dropdown-item.dropdown-submenu.submenu-open,
.tn-menu-action {
position: relative;
display: flex;
- flex: 1 1 0;
+ flex: 1 1 auto;
flex-direction: column;
align-items: center;
gap: 2px;
- min-width: 0;
- padding: 4px 2px;
+ min-width: 4.5em;
+ padding: 4px 6px;
border: 0;
border-radius: 6px;
background: transparent;
@@ -309,5 +309,7 @@ body.desktop .dropdown-item.dropdown-submenu.submenu-open,
.tn-menu-action-title {
max-width: 100%;
- text-align: center;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
diff --git a/apps/client/src/widgets/react/Menu.tsx b/apps/client/src/widgets/react/Menu.tsx
index 207ebfba1c..12b6fec37e 100644
--- a/apps/client/src/widgets/react/Menu.tsx
+++ b/apps/client/src/widgets/react/Menu.tsx
@@ -576,7 +576,7 @@ function MenuAction<T>({ item, onSelect }: { item: MenuCommandItem<T>, onSelect:
? { level, element, custom: false, disabled, hasSubmenu: false, inline: true, select }
: undefined);
}}
- id={menu ? id : undefined} type="button" role="menuitem"
+ id={menu ? id : undefined} type="button" role="menuitem" title={textOf(item.title)}
className={clsx("tn-menu-action", menu?.active?.id === id && "tn-menu-active")}
disabled={disabled} tabIndex={menu ? -1 : undefined}
// The keyboard goes on from the action the pointer last pointed at, as from a row.