feat(command_palette): enforce title names

This commit is contained in:
Elian Doran
2025-07-28 15:19:05 +03:00
parent 3575a7dc93
commit 7a0ab3c025
8 changed files with 29 additions and 8 deletions

View File

@@ -220,7 +220,7 @@
"go-to-next-note-title": "跳转到下一条笔记",
"new-note-title": "新建笔记",
"search-notes-title": "搜索笔记",
"jump-to-note-title": "跳转到笔记",
"jump-to-note-title": "",
"calendar-title": "日历",
"recent-changes-title": "最近更改",
"bookmarks-title": "书签",

View File

@@ -212,7 +212,7 @@
"go-to-next-note-title": "Zur nächsten Notiz gehen",
"new-note-title": "Neue Notiz",
"search-notes-title": "Notizen durchsuchen",
"jump-to-note-title": "Zur Notiz springen",
"jump-to-note-title": "",
"calendar-title": "Kalender",
"recent-changes-title": "neue Änderungen",
"bookmarks-title": "Lesezeichen",

View File

@@ -108,7 +108,7 @@
"keyboard_action_names": {
"back-in-note-history": "Back in Note History",
"forward-in-note-history": "Forward in Note History",
"jump-to-note": "Jump to Note",
"jump-to-note": "Jump to...",
"command-palette": "Command Palette",
"scroll-to-active-note": "Scroll to Active Note",
"quick-search": "Quick Search",
@@ -327,7 +327,7 @@
"go-to-next-note-title": "Go to Next Note",
"new-note-title": "New Note",
"search-notes-title": "Search Notes",
"jump-to-note-title": "Jump to Note",
"jump-to-note-title": "Jump to...",
"calendar-title": "Calendar",
"recent-changes-title": "Recent Changes",
"bookmarks-title": "Bookmarks",

View File

@@ -229,7 +229,7 @@
"go-to-next-note-title": "Ir a nota siguiente",
"new-note-title": "Nueva nota",
"search-notes-title": "Buscar notas",
"jump-to-note-title": "Saltar a nota",
"jump-to-note-title": "",
"calendar-title": "Calendario",
"recent-changes-title": "Cambios recientes",
"bookmarks-title": "Marcadores",

View File

@@ -216,7 +216,7 @@
"go-to-next-note-title": "Aller à la note suivante",
"new-note-title": "Nouvelle note",
"search-notes-title": "Rechercher des notes",
"jump-to-note-title": "Aller à la note",
"jump-to-note-title": "",
"calendar-title": "Calendrier",
"recent-changes-title": "Modifications récentes",
"bookmarks-title": "Signets",

View File

@@ -209,7 +209,7 @@
"etapi-title": "ETAPI",
"go-to-previous-note-title": "Mergi la notița anterioară",
"images-title": "Imagini",
"jump-to-note-title": "Sari la notiță",
"jump-to-note-title": "",
"launch-bar-title": "Bară de lansare",
"new-note-title": "Notiță nouă",
"note-launcher-title": "Lansator de notițe",

View File

@@ -58,11 +58,26 @@ describe("Hidden Subtree", () => {
.filter((b) => !b.isDeleted);
expect(correctedBranches).toBeDefined();
expect(correctedBranches![0].parentNoteId).toBe("_help_gh7bpGYxajRS");
// Ensure the note is no longer under the incorrect parent
const helpRootChildren = becca.notes["_help"]?.getChildNotes();
const incorrectChild = helpRootChildren?.find(note => note.noteId === "_help_Vc8PjrjAGuOp");
expect(incorrectChild).toBeUndefined();
});
it("enforces renames of launcher notes", () => {
const jumpToNote = becca.getNote("_lbJumpTo");
expect(jumpToNote).toBeDefined();
jumpToNote!.title = "Renamed";
cls.init(() => {
jumpToNote!.save();
hiddenSubtreeService.checkHiddenSubtree(true);
});
const updatedJumpToNote = becca.getNote("_lbJumpTo");
expect(updatedJumpToNote).toBeDefined();
expect(updatedJumpToNote?.title).not.toBe("Renamed");
});
});
});

View File

@@ -383,6 +383,12 @@ function checkHiddenSubtreeRecursively(parentNoteId: string, item: HiddenSubtree
}
}
}
if (item.id.startsWith("_lb") && note.title !== item.title) {
// If the note title is different from the expected title, update it
note.title = item.title;
note.save();
}
}
const attrs = [...(item.attributes || [])];