feat(popup_editor): integrate with tree context menu

This commit is contained in:
Elian Doran 2025-07-10 17:26:40 +03:00
parent 88a8311173
commit 1fc860b052
No known key found for this signature in database
3 changed files with 6 additions and 3 deletions

View file

@ -126,7 +126,6 @@ export type CommandMappings = {
openNoteInNewTab: CommandData; openNoteInNewTab: CommandData;
openNoteInNewSplit: CommandData; openNoteInNewSplit: CommandData;
openNoteInNewWindow: CommandData; openNoteInNewWindow: CommandData;
openNoteInPopup: CommandData;
openAboutDialog: CommandData; openAboutDialog: CommandData;
hideFloatingButtons: {}; hideFloatingButtons: {};
hideLeftPane: CommandData; hideLeftPane: CommandData;
@ -142,6 +141,7 @@ export type CommandMappings = {
}; };
openInTab: ContextMenuCommandData; openInTab: ContextMenuCommandData;
openNoteInSplit: ContextMenuCommandData; openNoteInSplit: ContextMenuCommandData;
openNoteInPopup: ContextMenuCommandData;
toggleNoteHoisting: ContextMenuCommandData; toggleNoteHoisting: ContextMenuCommandData;
insertNoteAfter: ContextMenuCommandData; insertNoteAfter: ContextMenuCommandData;
insertChildNote: ContextMenuCommandData; insertChildNote: ContextMenuCommandData;

View file

@ -70,8 +70,8 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree
const items: (MenuItem<TreeCommandNames> | null)[] = [ const items: (MenuItem<TreeCommandNames> | null)[] = [
{ title: `${t("tree-context-menu.open-in-a-new-tab")}`, command: "openInTab", uiIcon: "bx bx-link-external", enabled: noSelectedNotes }, { title: `${t("tree-context-menu.open-in-a-new-tab")}`, command: "openInTab", uiIcon: "bx bx-link-external", enabled: noSelectedNotes },
{ title: t("tree-context-menu.open-in-a-new-split"), command: "openNoteInSplit", uiIcon: "bx bx-dock-right", enabled: noSelectedNotes }, { title: t("tree-context-menu.open-in-a-new-split"), command: "openNoteInSplit", uiIcon: "bx bx-dock-right", enabled: noSelectedNotes },
{ title: t("tree-context-menu.open-in-popup"), command: "openNoteInPopup", uiIcon: "bx bx-edit", enabled: noSelectedNotes },
isHoisted isHoisted
? null ? null
@ -246,6 +246,8 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree
const { ntxId } = subContexts?.[subContexts.length - 1] ?? {}; const { ntxId } = subContexts?.[subContexts.length - 1] ?? {};
this.treeWidget.triggerCommand("openNewNoteSplit", { ntxId, notePath }); this.treeWidget.triggerCommand("openNewNoteSplit", { ntxId, notePath });
} else if (command === "openNoteInPopup") {
appContext.triggerCommand("openInPopup", { noteIdOrPath: notePath })
} else if (command === "convertNoteToAttachment") { } else if (command === "convertNoteToAttachment") {
if (!(await dialogService.confirm(t("tree-context-menu.convert-to-attachment-confirm")))) { if (!(await dialogService.confirm(t("tree-context-menu.convert-to-attachment-confirm")))) {
return; return;

View file

@ -1600,7 +1600,8 @@
"import-into-note": "Import into note", "import-into-note": "Import into note",
"apply-bulk-actions": "Apply bulk actions", "apply-bulk-actions": "Apply bulk actions",
"converted-to-attachments": "{{count}} notes have been converted to attachments.", "converted-to-attachments": "{{count}} notes have been converted to attachments.",
"convert-to-attachment-confirm": "Are you sure you want to convert note selected notes into attachments of their parent notes?" "convert-to-attachment-confirm": "Are you sure you want to convert note selected notes into attachments of their parent notes?",
"open-in-popup": "Quick edit"
}, },
"shared_info": { "shared_info": {
"shared_publicly": "This note is shared publicly on", "shared_publicly": "This note is shared publicly on",