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
feat(mobile/split): add an option to create new split
Elian Doranfd99246c491b
diff --git a/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx b/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsxindex 255ac8c99e..4f03b201c6 100644--- a/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx+++ b/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx@@ -1,5 +1,5 @@import { useContext } from "preact/hooks";-import appContext from "../../components/app_context";+import appContext, { CommandMappings } from "../../components/app_context";import contextMenu from "../../menus/context_menu";import branches from "../../services/branches";import { t } from "../../services/i18n";@@ -7,6 +7,7 @@ import note_create from "../../services/note_create";import tree from "../../services/tree";import ActionButton from "../react/ActionButton";import { ParentComponent } from "../react/react_utils";+import BasicWidget from "../basic_widget";export default function MobileDetailMenu() {const parentComponent = useContext(ParentComponent);@@ -18,14 +19,16 @@ export default function MobileDetailMenu() {onClick={(e) => {const note = appContext.tabManager.getActiveContextNote();- contextMenu.show<"insertChildNote" | "delete" | "showRevisions">({+ contextMenu.show<keyof CommandMappings>({x: e.pageX,y: e.pageY,items: [{ title: t("mobile_detail_menu.insert_child_note"), command: "insertChildNote", uiIcon: "bx bx-plus", enabled: note?.type !== "search" },{ title: t("mobile_detail_menu.delete_this_note"), command: "delete", uiIcon: "bx bx-trash", enabled: note?.noteId !== "root" },{ kind: "separator" },- { title: t("mobile_detail_menu.note_revisions"), command: "showRevisions", uiIcon: "bx bx-history" }+ { title: t("mobile_detail_menu.note_revisions"), command: "showRevisions", uiIcon: "bx bx-history" },+ { kind: "separator" },+ { title: t("create_pane_button.create_new_split"), command: "openNewNoteSplit", uiIcon: "bx bx-dock-right" }],selectMenuItemHandler: async ({ command }) => {if (command === "insertChildNote") {@@ -46,7 +49,8 @@ export default function MobileDetailMenu() {parentComponent.triggerCommand("setActiveScreen", { screen: "tree" });}} else if (command && parentComponent) {- parentComponent.triggerCommand(command);+ const ntxId = (parentComponent as BasicWidget).getClosestNtxId();+ parentComponent.triggerCommand(command, { ntxId });}},forcePositionOnMobile: true