AGPL-3.0-only, a source link in the app, and everything on dev since #5 #6

Merged
bvandeusen merged 214 commits from dev into main 2026-10-21 21:40:00 -04:00
2 changed files with 11 additions and 11 deletions
Showing only changes of commit af0389ed13 - Show all commits
+4 -1
View File
@@ -87,9 +87,12 @@ function onKeydown(e: KeyboardEvent) {
}
onMounted(async () => {
await titles.load();
// Focus first: typing a command must not wait on the note list.
await nextTick();
input.value?.focus();
// A failed refresh keeps the last list rather than breaking the palette; the
// commands work either way.
titles.refresh().catch(() => {});
});
</script>
+7 -10
View File
@@ -13,20 +13,17 @@ export interface TitleEntry {
// because the command palette lists it so someone can jump straight to a note by
// name. That is recall, which is what this app is for; `resolve()` went with the
// links.
//
// Fetched again every time the palette opens. It used to load once per session
// behind a `loaded` flag, with nothing ever clearing it, so a note written after
// the first open could not be found by name until a page reload (#5165). The last
// list stays in place meanwhile, so the palette never opens empty.
export const useTitlesStore = defineStore("titles", () => {
const items = ref<TitleEntry[]>([]);
const loaded = ref(false);
async function load(): Promise<void> {
if (loaded.value) return;
async function refresh(): Promise<void> {
items.value = await repo.notes.titles();
loaded.value = true;
}
async function reload(): Promise<void> {
loaded.value = false;
await load();
}
return { items, loaded, load, reload };
return { items, refresh };
});