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
improvements
zadam5fc9f5f3f9ac
diff --git a/db/migrations/0204__migrate_bookmarks_to_clones.js b/db/migrations/0204__migrate_bookmarks_to_clones.jsindex db8f74cedd..8f78066cb9 100644--- a/db/migrations/0204__migrate_bookmarks_to_clones.js+++ b/db/migrations/0204__migrate_bookmarks_to_clones.js@@ -8,7 +8,7 @@ module.exports = () => {beccaLoader.load();for (const attr of becca.findAttributes('label','bookmarked')) {- cloningService.toggleNoteInParent(true, attr.noteId, 'lb_bookmarks');+ cloningService.toggleNoteInParent(true, attr.noteId, 'lbBookmarks');attr.markAsDeleted("0204__migrate_bookmarks_to_clones");}diff --git a/db/migrations/0206__rename_noteIds.sql b/db/migrations/0206__rename_noteIds.sqlindex 1fb34dc024..8ef48d4edb 100644--- a/db/migrations/0206__rename_noteIds.sql+++ b/db/migrations/0206__rename_noteIds.sql@@ -6,6 +6,10 @@ UPDATE branches SET branchId = 'globalNoteMap' WHERE branchId = 'globalnotemap';UPDATE branches SET branchId = 'bulkAction' WHERE branchId = 'bulkaction';UPDATE branches SET branchId = 'sqlConsole' WHERE branchId = 'sqlconsole';+UPDATE branches SET noteId = 'globalNoteMap' WHERE noteId = 'globalnotemap';+UPDATE branches SET noteId = 'bulkAction' WHERE noteId = 'bulkaction';+UPDATE branches SET noteId = 'sqlConsole' WHERE noteId = 'sqlconsole';+UPDATE branches SET parentNoteId = 'globalNoteMap' WHERE parentNoteId = 'globalnotemap';UPDATE branches SET parentNoteId = 'bulkAction' WHERE parentNoteId = 'bulkaction';UPDATE branches SET parentNoteId = 'sqlConsole' WHERE parentNoteId = 'sqlconsole';@@ -13,3 +17,11 @@ UPDATE branches SET parentNoteId = 'sqlConsole' WHERE parentNoteId = 'sqlconsoleUPDATE attributes SET noteId = 'globalNoteMap' WHERE noteId = 'globalnotemap';UPDATE attributes SET noteId = 'bulkAction' WHERE noteId = 'bulkaction';UPDATE attributes SET noteId = 'sqlConsole' WHERE noteId = 'sqlconsole';++UPDATE attributes SET value = 'globalNoteMap' WHERE type = 'relation' AND value = 'globalnotemap';+UPDATE attributes SET value = 'bulkAction' WHERE type = 'relation' AND value = 'bulkaction';+UPDATE attributes SET value = 'sqlConsole' WHERE type = 'relation' AND value = 'sqlconsole';++UPDATE entity_changes SET entityId = 'globalNoteMap' WHERE entityId = 'globalnotemap';+UPDATE entity_changes SET entityId = 'bulkAction' WHERE entityId = 'bulkaction';+UPDATE entity_changes SET entityId = 'sqlConsole' WHERE entityId = 'sqlconsole';diff --git a/src/becca/entities/branch.js b/src/becca/entities/branch.jsindex 610f95e70e..691a46e39c 100644--- a/src/becca/entities/branch.js+++ b/src/becca/entities/branch.js@@ -129,7 +129,7 @@ class Branch extends AbstractEntity {* @returns {boolean}*/get isWeak() {- return ['share', 'lb_bookmarks'].includes(this.parentNoteId);+ return ['share', 'lbBookmarks'].includes(this.parentNoteId);}/**diff --git a/src/becca/entities/note.js b/src/becca/entities/note.jsindex 94a212f2b2..75e4c30f7c 100644--- a/src/becca/entities/note.js+++ b/src/becca/entities/note.js@@ -1328,6 +1328,10 @@ class Note extends AbstractEntity {}}+ isLaunchBarConfig() {+ return this.type === 'launcher' || ['lbRoot', 'lbAvailableShortcuts', 'lbVisibleShortcuts'];+ }+get isDeleted() {return !(this.noteId in this.becca.notes) || this.isBeingDeleted;}diff --git a/src/public/app/components/root_command_executor.js b/src/public/app/components/root_command_executor.jsindex 6eca67a08b..3fb219c3c6 100644--- a/src/public/app/components/root_command_executor.js+++ b/src/public/app/components/root_command_executor.js@@ -73,7 +73,7 @@ export default class RootCommandExecutor extends Component {}async showLaunchBarSubtreeCommand() {- await appContext.tabManager.openContextWithNote('lb_root', true, null, 'lb_root');+ await appContext.tabManager.openContextWithNote('lbRoot', true, null, 'lbRoot');}async showShareSubtreeCommand() {diff --git a/src/public/app/entities/note_short.js b/src/public/app/entities/note_short.jsindex 656e2b8b6d..e6db36e2a8 100644--- a/src/public/app/entities/note_short.js+++ b/src/public/app/entities/note_short.js@@ -828,7 +828,7 @@ class NoteShort {}isLaunchBarConfig() {- return this.type === 'launcher' || this.noteId.startsWith("lb_");+ return this.type === 'launcher' || ['lbRoot', 'lbAvailableShortcuts', 'lbVisibleShortcuts'];}}diff --git a/src/public/app/menus/launcher_context_menu.js b/src/public/app/menus/launcher_context_menu.jsindex 4635f8f23c..14d4f023fc 100644--- a/src/public/app/menus/launcher_context_menu.js+++ b/src/public/app/menus/launcher_context_menu.js@@ -27,13 +27,13 @@ export default class LauncherContextMenu {const note = await froca.getNote(this.node.data.noteId);const parentNoteId = this.node.getParent().data.noteId;- const isVisibleRoot = note.noteId === 'lb_visiblelaunchers';- const isAvailableRoot = note.noteId === 'lb_availablelaunchers';- const isVisibleItem = parentNoteId === 'lb_visiblelaunchers';- const isAvailableItem = parentNoteId === 'lb_availablelaunchers';+ const isVisibleRoot = note.noteId === 'lbVisibleLaunchers';+ const isAvailableRoot = note.noteId === 'lbAvailableLaunchers';+ const isVisibleItem = parentNoteId === 'lbVisibleLaunchers';+ const isAvailableItem = parentNoteId === 'lbAvailableLaunchers';const isItem = isVisibleItem || isAvailableItem;- const canBeDeleted = !note.noteId.startsWith("lb_");- const canBeReset = note.noteId.startsWith("lb_");+ const canBeDeleted = !note.isLaunchBarConfig();+ const canBeReset = note.isLaunchBarConfig();return [(isVisibleRoot || isAvailableRoot) ? { title: 'Add a note launcher', command: 'addNoteLauncher', uiIcon: "bx bx-plus" } : null,diff --git a/src/public/app/services/branches.js b/src/public/app/services/branches.jsindex 0df8e454c8..86a9bce5f4 100644--- a/src/public/app/services/branches.js+++ b/src/public/app/services/branches.js@@ -10,7 +10,7 @@ async function moveBeforeBranch(branchIdsToMove, beforeBranchId) {branchIdsToMove = filterRootNote(branchIdsToMove);branchIdsToMove = filterSearchBranches(branchIdsToMove);- if (['root', 'lb_root', 'lb_availablelaunchers', 'lb_visiblelaunchers'].includes(beforeBranchId)) {+ if (['root', 'lbRoot', 'lbAvailableLaunchers', 'lbVisibleLaunchers'].includes(beforeBranchId)) {toastService.showError('Cannot move notes here.');return;}@@ -34,9 +34,9 @@ async function moveAfterBranch(branchIdsToMove, afterBranchId) {const forbiddenNoteIds = ['root',hoistedNoteService.getHoistedNoteId(),- 'lb_root',- 'lb_availablelaunchers',- 'lb_visiblelaunchers'+ 'lbRoot',+ 'lbAvailableLaunchers',+ 'lbVisibleLaunchers'];if (forbiddenNoteIds.includes(afterNote.noteId)) {@@ -57,7 +57,7 @@ async function moveAfterBranch(branchIdsToMove, afterBranchId) {}async function moveToParentNote(branchIdsToMove, newParentBranchId) {- if (newParentBranchId === 'lb_root') {+ if (newParentBranchId === 'lbRoot') {toastService.showError('Cannot move notes here.');return;}diff --git a/src/public/app/widgets/bookmark_buttons.js b/src/public/app/widgets/bookmark_buttons.jsindex 2beaaf9ad2..5d561d1340 100644--- a/src/public/app/widgets/bookmark_buttons.js+++ b/src/public/app/widgets/bookmark_buttons.js@@ -15,7 +15,7 @@ export default class BookmarkButtons extends FlexContainer {this.children = [];this.noteIds = [];- const bookmarkParentNote = await froca.getNote('lb_bookmarks');+ const bookmarkParentNote = await froca.getNote('lbBookmarks');for (const note of await bookmarkParentNote.getChildNotes()) {this.noteIds.push(note.noteId);@@ -37,7 +37,7 @@ export default class BookmarkButtons extends FlexContainer {}entitiesReloadedEvent({loadResults}) {- if (loadResults.getBranches().find(branch => branch.parentNoteId === 'lb_bookmarks')) {+ if (loadResults.getBranches().find(branch => branch.parentNoteId === 'lbBookmarks')) {this.refresh();}diff --git a/src/public/app/widgets/bookmark_switch.js b/src/public/app/widgets/bookmark_switch.jsindex 14407acf2e..8755b0504a 100644--- a/src/public/app/widgets/bookmark_switch.js+++ b/src/public/app/widgets/bookmark_switch.js@@ -20,7 +20,7 @@ export default class BookmarkSwitchWidget extends SwitchWidget {}async toggle(state) {- const resp = await server.put(`notes/${this.noteId}/toggle-in-parent/lb_bookmarks/` + !!state);+ const resp = await server.put(`notes/${this.noteId}/toggle-in-parent/lbBookmarks/` + !!state);if (!resp.success) {toastService.showError(resp.message);@@ -28,7 +28,7 @@ export default class BookmarkSwitchWidget extends SwitchWidget {}refreshWithNote(note) {- const isBookmarked = !!note.getParentBranches().find(b => b.parentNoteId === 'lb_bookmarks');+ const isBookmarked = !!note.getParentBranches().find(b => b.parentNoteId === 'lbBookmarks');this.$switchOn.toggle(!isBookmarked);this.$switchOff.toggle(isBookmarked);diff --git a/src/public/app/widgets/buttons/history/history_back.js b/src/public/app/widgets/buttons/history/history_back.jsindex 77ceff03ba..b549599e05 100644--- a/src/public/app/widgets/buttons/history/history_back.js+++ b/src/public/app/widgets/buttons/history/history_back.js@@ -8,7 +8,7 @@ export default class BackInHistoryButtonWidget extends AbstractHistoryNavigation.title("Go to previous note.").command("backInNoteHistory").titlePlacement("right")- .buttonNoteIdProvider(() => 'lb_backinhistory')+ .buttonNoteIdProvider(() => 'lbBackInHistory').onContextMenu(e => this.showContextMenu(e));}}diff --git a/src/public/app/widgets/buttons/history/history_forward.js b/src/public/app/widgets/buttons/history/history_forward.jsindex 7b824e6fd6..5c8a3ad62e 100644--- a/src/public/app/widgets/buttons/history/history_forward.js+++ b/src/public/app/widgets/buttons/history/history_forward.js@@ -8,7 +8,7 @@ export default class ForwardInHistoryButtonWidget extends AbstractHistoryNavigat.title("Go to next note.").command("forwardInNoteHistory").titlePlacement("right")- .buttonNoteIdProvider(() => 'lb_forwardinhistory')+ .buttonNoteIdProvider(() => 'lbForwardInHistory').onContextMenu(e => this.showContextMenu(e));}}diff --git a/src/public/app/widgets/buttons/note_actions.js b/src/public/app/widgets/buttons/note_actions.jsindex c5f7835978..6b1c15b51b 100644--- a/src/public/app/widgets/buttons/note_actions.js+++ b/src/public/app/widgets/buttons/note_actions.js@@ -38,7 +38,7 @@ const TPL = `export default class NoteActionsWidget extends NoteContextAwareWidget {isEnabled() {- return !this.note?.isLaunchBarConfig();+ return this.note?.type !== 'launcher';}doRender() {diff --git a/src/public/app/widgets/containers/launcher_container.js b/src/public/app/widgets/containers/launcher_container.jsindex d71c3958fb..9e27e08fb1 100644--- a/src/public/app/widgets/containers/launcher_container.js+++ b/src/public/app/widgets/containers/launcher_container.js@@ -17,7 +17,7 @@ export default class LauncherContainer extends FlexContainer {async load() {this.children = [];- const visibleLaunchersRoot = await froca.getNote('lb_visiblelaunchers', true);+ const visibleLaunchersRoot = await froca.getNote('lbVisibleLaunchers', true);if (!visibleLaunchersRoot) {console.log("Visible launchers root note doesn't exist.");@@ -61,7 +61,7 @@ export default class LauncherContainer extends FlexContainer {}entitiesReloadedEvent({loadResults}) {- if (loadResults.getBranches().find(branch => branch.parentNoteId.startsWith("lb_"))) {+ if (loadResults.getBranches().find(branch => froca.getNoteFromCache(branch.parentNoteId)?.isLaunchBarConfig())) {// changes in note placement requires reload of all launchers, all other changes are handled by individual// launchersthis.load();diff --git a/src/public/app/widgets/note_detail.js b/src/public/app/widgets/note_detail.jsindex 1a802ff87a..590bbb21b6 100644--- a/src/public/app/widgets/note_detail.js+++ b/src/public/app/widgets/note_detail.js@@ -58,7 +58,7 @@ const typeWidgetClasses = {'canvas': CanvasTypeWidget,'protectedSession': ProtectedSessionTypeWidget,'book': BookTypeWidget,- 'note-map': NoteMapTypeWidget,+ 'noteMap': NoteMapTypeWidget,'webView': WebViewTypeWidget,'doc': DocTypeWidget,'contentWidget': ContentWidgetTypeWidgetdiff --git a/src/public/app/widgets/note_title.js b/src/public/app/widgets/note_title.jsindex ce33def915..97b20c7594 100644--- a/src/public/app/widgets/note_title.js+++ b/src/public/app/widgets/note_title.js@@ -73,7 +73,7 @@ export default class NoteTitleWidget extends NoteContextAwareWidget {this.$noteTitle.val(note.title);this.$noteTitle.prop("readonly", (note.isProtected && !protectedSessionHolder.isProtectedSessionAvailable())- || ["lb_root", "lb_availablelaunchers", "lb_visiblelaunchers"].includes(note.noteId));+ || ["lbRoot", "lbAvailableLaunchers", "lbVisibleLaunchers"].includes(note.noteId));this.setProtectedStatus(note);}diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.jsindex 5f92793b56..b27d58e904 100644--- a/src/public/app/widgets/note_tree.js+++ b/src/public/app/widgets/note_tree.js@@ -398,7 +398,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {autoExpandMS: 600,preventLazyParents: false,dragStart: (node, data) => {- if (['root', 'hidden', 'lb_root', 'lb_availablelaunchers', 'lb_visiblelaunchers'].includes(node.data.noteId)) {+ if (['root', 'hidden', 'lbRoot', 'lbAvailableLaunchers', 'lbVisibleLaunchers'].includes(node.data.noteId)) {return false;}@@ -426,7 +426,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {dragEnter: (node, data) => {if (node.data.noteType === 'search') {return false;- } else if (node.data.noteId === 'lb_root') {+ } else if (node.data.noteId === 'lbRoot') {return false;} else if (node.data.noteType === 'launcher') {return ['before', 'after'];@@ -604,7 +604,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {this.$tree.on('contextmenu', '.fancytree-node', e => {const node = $.ui.fancytree.getNode(e);- if (hoistedNoteService.getHoistedNoteId() === 'lb_root') {+ if (hoistedNoteService.getHoistedNoteId() === 'lbRoot') {import("../menus/launcher_context_menu.js").then(({LauncherContextMenu: ShortcutContextMenu}) => {const shortcutContextMenu = new LauncherContextMenu(this, node);shortcutContextMenu.show(e);@@ -744,7 +744,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {.map(noteId => froca.notes[noteId]).filter(note => !!note).filter(note =>- !['share', 'lb_bookmarks'].includes(note.noteId)+ !['share', 'lbBookmarks'].includes(note.noteId)&& note.type !== 'search');if (realClones.length > 1) {@@ -1554,11 +1554,11 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {}moveShortcutToVisibleCommand({node, selectedOrActiveBranchIds}) {- branchService.moveToParentNote(selectedOrActiveBranchIds, 'lb_visiblelaunchers');+ branchService.moveToParentNote(selectedOrActiveBranchIds, 'lbVisibleLaunchers');}moveShortcutToAvailableCommand({node, selectedOrActiveBranchIds}) {- branchService.moveToParentNote(selectedOrActiveBranchIds, 'lb_availablelaunchers');+ branchService.moveToParentNote(selectedOrActiveBranchIds, 'lbAvailableLaunchers');}addNoteLauncherCommand({node}) {diff --git a/src/public/app/widgets/ribbon_widgets/owned_attribute_list.js b/src/public/app/widgets/ribbon_widgets/owned_attribute_list.jsindex db989e0ba6..836d39a988 100644--- a/src/public/app/widgets/ribbon_widgets/owned_attribute_list.js+++ b/src/public/app/widgets/ribbon_widgets/owned_attribute_list.js@@ -47,7 +47,7 @@ export default class OwnedAttributeListWidget extends NoteContextAwareWidget {getTitle() {return {- show: true,//!this.note.isLaunchBarConfig(),+ show: !this.note.isLaunchBarConfig(),title: "Owned attributes",icon: "bx bx-list-check"};diff --git a/src/services/handlers.js b/src/services/handlers.jsindex f336070972..618a13e6b3 100644--- a/src/services/handlers.js+++ b/src/services/handlers.js@@ -162,8 +162,6 @@ eventService.subscribe(eventService.ENTITY_CHANGED, ({ entityName, entity }) =>});});-const debouncedCreateMissingSpecialNotes = debounce(() => specialNotesService.createMissingSpecialNotes(), 300);-eventService.subscribe(eventService.ENTITY_DELETED, ({ entityName, entity }) => {processInverseRelations(entityName, entity, (definition, note, targetNote) => {// if one inverse attribute is deleted then the other should be deleted as well@@ -179,13 +177,6 @@ eventService.subscribe(eventService.ENTITY_DELETED, ({ entityName, entity }) =>if (entityName === 'branches') {runAttachedRelations(entity.getNote(), 'runOnBranchDeletion', entity);}-- if (entityName === 'notes') {- if (entity.noteId.startsWith("lb_")) {- // if user deletes shortcuts, restore them immediately- debouncedCreateMissingSpecialNotes();- }- }});module.exports = {diff --git a/src/services/notes.js b/src/services/notes.jsindex 176556d331..d5111b82c0 100644--- a/src/services/notes.js+++ b/src/services/notes.js@@ -114,11 +114,11 @@ function getAndValidateParent(params) {throw new Error(`Launchers should not have child notes.`);}- if (!params.ignoreForbiddenParents && ['lb_root'].includes(parentNote.noteId)) {+ if (!params.ignoreForbiddenParents && ['lbRoot'].includes(parentNote.noteId)) {throw new Error(`Creating child notes into '${parentNote.noteId}' is not allowed.`);}- if (['lb_availablelaunchers', 'lb_visiblelaunchers'].includes(parentNote.noteId) && params.type !== 'launcher') {+ if (['lbAvailableLaunchers', 'lbVisibleLaunchers'].includes(parentNote.noteId) && params.type !== 'launcher') {throw new Error(`Creating child notes into '${parentNote.noteId}' is only possible for type 'launcher'.`);}diff --git a/src/services/special_notes.js b/src/services/special_notes.jsindex 5b5efc5594..edcf6a0446 100644--- a/src/services/special_notes.js+++ b/src/services/special_notes.js@@ -4,6 +4,7 @@ const becca = require("../becca/becca");const noteService = require("./notes");const cls = require("./cls");const dateUtils = require("./date_utils");+const log = require("./log.js");const LBTPL_ROOT = "lbtpl_root";const LBTPL_BASE = "lbtpl_base";@@ -253,12 +254,12 @@ function getBulkActionNote() {}function getLaunchBarRoot() {- let note = becca.getNote('lb_root');+ let note = becca.getNote('lbRoot');if (!note) {note = noteService.createNewNote({- branchId: 'lb_root',- noteId: 'lb_root',+ branchId: 'lbRoot',+ noteId: 'lbRoot',title: 'Launch bar',type: 'doc',content: '',@@ -273,12 +274,12 @@ function getLaunchBarRoot() {}function getLaunchBarAvailableLaunchersRoot() {- let note = becca.getNote('lb_availablelaunchers');+ let note = becca.getNote('lbAvailableLaunchers');if (!note) {note = noteService.createNewNote({- branchId: 'lb_availablelaunchers',- noteId: 'lb_availablelaunchers',+ branchId: 'lbAvailableLaunchers',+ noteId: 'lbAvailableLaunchers',title: 'Available launchers',type: 'doc',content: '',@@ -290,7 +291,7 @@ function getLaunchBarAvailableLaunchersRoot() {note.addLabel("docName", "launchbar_intro");}- const branch = becca.getBranch('lb_availablelaunchers');+ const branch = becca.getBranch('lbAvailableLaunchers');if (!branch.isExpanded) {branch.isExpanded = true;branch.save();@@ -300,12 +301,12 @@ function getLaunchBarAvailableLaunchersRoot() {}function getLaunchBarVisibleLaunchersRoot() {- let note = becca.getNote('lb_visiblelaunchers');+ let note = becca.getNote('lbVisibleLaunchers');if (!note) {note = noteService.createNewNote({- branchId: 'lb_visiblelaunchers',- noteId: 'lb_visiblelaunchers',+ branchId: 'lbVisibleLaunchers',+ noteId: 'lbVisibleLaunchers',title: 'Visible launchers',type: 'doc',content: '',@@ -317,7 +318,7 @@ function getLaunchBarVisibleLaunchersRoot() {note.addLabel("docName", "launchbar_intro");}- const branch = becca.getBranch('lb_visiblelaunchers');+ const branch = becca.getBranch('lbVisibleLaunchers');if (!branch.isExpanded) {branch.isExpanded = true;branch.save();@@ -328,21 +329,21 @@ function getLaunchBarVisibleLaunchersRoot() {const launchers = [// visible launchers:- { id: 'lb_newnote', command: 'createNoteIntoInbox', title: 'New note', icon: 'bx bx-file-blank', isVisible: true },- { id: 'lb_search', command: 'searchNotes', title: 'Search notes', icon: 'bx bx-search', isVisible: true },- { id: 'lb_jumpto', command: 'jumpToNote', title: 'Jump to note', icon: 'bx bx-send', isVisible: true },- { id: 'lb_notemap', targetNoteId: 'globalNotemap', title: 'Note map', icon: 'bx bx-map-alt', isVisible: true },- { id: 'lb_calendar', builtinWidget: 'calendar', title: 'Calendar', icon: 'bx bx-calendar', isVisible: true },- { id: 'lb_spacer1', builtinWidget: 'spacer', title: 'Spacer', isVisible: true, baseSize: "50", growthFactor: "0" },- { id: 'lb_bookmarks', builtinWidget: 'bookmarks', title: 'Bookmarks', icon: 'bx bx-bookmark', isVisible: true },- { id: 'lb_spacer2', builtinWidget: 'spacer', title: 'Spacer', isVisible: true, baseSize: "0", growthFactor: "1" },- { id: 'lb_protectedsession', builtinWidget: 'protectedSession', title: 'Protected session', icon: 'bx bx bx-shield-quarter', isVisible: true },- { id: 'lb_syncstatus', builtinWidget: 'syncStatus', title: 'Sync status', icon: 'bx bx-wifi', isVisible: true },+ { id: 'lbNewNote', command: 'createNoteIntoInbox', title: 'New note', icon: 'bx bx-file-blank', isVisible: true },+ { id: 'lbSearch', command: 'searchNotes', title: 'Search notes', icon: 'bx bx-search', isVisible: true },+ { id: 'lbJumpTo', command: 'jumpToNote', title: 'Jump to note', icon: 'bx bx-send', isVisible: true },+ { id: 'lbNoteMap', targetNoteId: 'globalNotemap', title: 'Note map', icon: 'bx bx-map-alt', isVisible: true },+ { id: 'lbCalendar', builtinWidget: 'calendar', title: 'Calendar', icon: 'bx bx-calendar', isVisible: true },+ { id: 'lbSpacer1', builtinWidget: 'spacer', title: 'Spacer', isVisible: true, baseSize: "50", growthFactor: "0" },+ { id: 'lbBookmarks', builtinWidget: 'bookmarks', title: 'Bookmarks', icon: 'bx bx-bookmark', isVisible: true },+ { id: 'lbSpacer2', builtinWidget: 'spacer', title: 'Spacer', isVisible: true, baseSize: "0", growthFactor: "1" },+ { id: 'lbProtectedSession', builtinWidget: 'protectedSession', title: 'Protected session', icon: 'bx bx bx-shield-quarter', isVisible: true },+ { id: 'lbSyncStatus', builtinWidget: 'syncStatus', title: 'Sync status', icon: 'bx bx-wifi', isVisible: true },// available launchers:- { id: 'lb_recentchanges', command: 'showRecentChanges', title: 'Recent changes', icon: 'bx bx-history', isVisible: false },- { id: 'lb_backinhistory', builtinWidget: 'backInHistoryButton', title: 'Back in history', icon: 'bx bxs-left-arrow-square', isVisible: false },- { id: 'lb_forwardinhistory', builtinWidget: 'forwardInHistoryButton', title: 'Forward in history', icon: 'bx bxs-right-arrow-square', isVisible: false },+ { id: 'lbRecentChanges', command: 'showRecentChanges', title: 'Recent changes', icon: 'bx bx-history', isVisible: false },+ { id: 'lbBackInHistory', builtinWidget: 'backInHistoryButton', title: 'Back in history', icon: 'bx bxs-left-arrow-square', isVisible: false },+ { id: 'lbForwardInHistory', builtinWidget: 'forwardInHistoryButton', title: 'Forward in history', icon: 'bx bxs-right-arrow-square', isVisible: false },];function createLaunchers() {@@ -628,11 +629,11 @@ function createMissingSpecialNotes() {}function resetLauncher(noteId) {- if (noteId.startsWith('lb_')) {- const note = becca.getNote(noteId);+ const note = becca.getNote(noteId);+ if (note.isLauncherConfig()) {if (note) {- if (noteId === 'lb_root') {+ if (noteId === 'lbRoot') {// deleting hoisted notes are not allowed, so we just reset the childrenfor (const childNote of note.getChildNotes()) {childNote.deleteNote();diff --git a/src/services/tree.js b/src/services/tree.jsindex 60c14f4178..a6e1ec4d3d 100644--- a/src/services/tree.js+++ b/src/services/tree.js@@ -30,7 +30,7 @@ function getNotes(noteIds) {}function validateParentChild(parentNoteId, childNoteId, branchId = null) {- if (['root', 'hidden', 'share', 'lb_root', 'lb_availablelaunchers', 'lb_visiblelaunchers'].includes(childNoteId)) {+ if (['root', 'hidden', 'share', 'lbRoot', 'lbAvailableLaunchers', 'lbVisibleLaunchers'].includes(childNoteId)) {return { success: false, message: `Cannot change this note's location.`};}@@ -58,7 +58,7 @@ function validateParentChild(parentNoteId, childNoteId, branchId = null) {};}- if (parentNoteId !== 'lb_bookmarks' && becca.getNote(parentNoteId).type === 'launcher') {+ if (parentNoteId !== 'lbBookmarks' && becca.getNote(parentNoteId).type === 'launcher') {return {success: false,message: 'Launcher note cannot have any children.'