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
more actions triggering new tab should respect current hoisting
zadam4d00404f5586
diff --git a/src/public/app/components/root_command_executor.js b/src/public/app/components/root_command_executor.jsindex 8f7d202d4a..08db59e62d 100644--- a/src/public/app/components/root_command_executor.js+++ b/src/public/app/components/root_command_executor.js@@ -18,7 +18,7 @@ export default class RootCommandExecutor extends Component {async showSQLConsoleCommand() {const sqlConsoleNote = await dateNoteService.createSqlConsole();- const noteContext = await appContext.tabManager.openContextWithNote(sqlConsoleNote.noteId, { activate: true });+ const noteContext = await appContext.tabManager.openTabWithNoteWithHoisting(sqlConsoleNote.noteId, { activate: true });appContext.triggerEvent('focusOnDetail', {ntxId: noteContext.ntxId});}@@ -29,12 +29,8 @@ export default class RootCommandExecutor extends Component {// force immediate searchawait froca.loadSearchNote(searchNote.noteId);- const activeNoteContext = appContext.tabManager.getActiveContext();- const hoistedNoteId = activeNoteContext?.hoistedNoteId || 'root';-- const noteContext = await appContext.tabManager.openContextWithNote(searchNote.noteId, {- activate: true,- hoistedNoteId+ const noteContext = await appContext.tabManager.openTabWithNoteWithHoisting(searchNote.noteId, {+ activate: true});appContext.triggerCommand('focusOnSearchDefinition', {ntxId: noteContext.ntxId});@@ -83,7 +79,7 @@ export default class RootCommandExecutor extends Component {}async showBackendLogCommand() {- await appContext.tabManager.openContextWithNote('_backendLog', { activate: true });+ await appContext.tabManager.openTabWithNoteWithHoisting('_backendLog', { activate: true });}async showLaunchBarSubtreeCommand() {@@ -124,7 +120,7 @@ export default class RootCommandExecutor extends Component {const notePath = appContext.tabManager.getActiveContextNotePath();if (notePath) {- await appContext.tabManager.openContextWithNote(notePath, {+ await appContext.tabManager.openTabWithNoteWithHoisting(notePath, {activate: true,viewScope: {viewMode: 'source'@@ -137,7 +133,7 @@ export default class RootCommandExecutor extends Component {const notePath = appContext.tabManager.getActiveContextNotePath();if (notePath) {- await appContext.tabManager.openContextWithNote(notePath, {+ await appContext.tabManager.openTabWithNoteWithHoisting(notePath, {activate: true,viewScope: {viewMode: 'attachments'@@ -150,7 +146,7 @@ export default class RootCommandExecutor extends Component {const notePath = appContext.tabManager.getActiveContextNotePath();if (notePath) {- await appContext.tabManager.openContextWithNote(notePath, {+ await appContext.tabManager.openTabWithNoteWithHoisting(notePath, {activate: true,viewScope: {viewMode: 'attachments'diff --git a/src/public/app/services/frontend_script_api.js b/src/public/app/services/frontend_script_api.jsindex ba9aed4878..9c5a7b18f5 100644--- a/src/public/app/services/frontend_script_api.js+++ b/src/public/app/services/frontend_script_api.js@@ -79,7 +79,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $containthis.openTabWithNote = async (notePath, activate) => {await ws.waitForMaxKnownEntityChangeId();- await appContext.tabManager.openContextWithNote(notePath, { activate });+ await appContext.tabManager.openTabWithNoteWithHoisting(notePath, { activate });if (activate) {await appContext.triggerEvent('focusAndSelectTitle');