Android / Build, or is the channel already serving this? (push) Successful in 3s
Android / Kotlin + Rust (APK) (push) Skipped
CI & Build / Build now, or wait for Android? (push) Successful in 4s
CI & Build / TypeScript typecheck (push) Successful in 11s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Python tests (push) Successful in 16s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 3s
CI & Build / integration (push) Successful in 41s
CI & Build / Build & push image (push) Successful in 58s
Desktop (Tauri) / Clippy, tests and rustfmt (push) Successful in 3m30s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 3m43s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 4m23s
Desktop (Tauri) / Update manifest (push) Successful in 4s
The palette's note list loaded once per session behind a `loaded` flag, and the `reload()` that would have cleared it had no caller. So a note written after the first open couldn't be found by name until the page reloaded (#5165, audit B4). The list is now fetched again on every open, and the last list stays visible meanwhile. The input takes focus before the fetch, and a failed fetch keeps the old list instead of breaking the palette. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
1023 B
TypeScript
30 lines
1023 B
TypeScript
import { defineStore } from "pinia";
|
|
import { ref } from "vue";
|
|
import { repo } from "../adapters";
|
|
|
|
export interface TitleEntry {
|
|
id: string;
|
|
title: string;
|
|
}
|
|
|
|
// Owner's {id, name} index of every non-trashed note.
|
|
//
|
|
// Outlived [[wiki-links]] (note 2897), which is what it was originally built for,
|
|
// 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[]>([]);
|
|
|
|
async function refresh(): Promise<void> {
|
|
items.value = await repo.notes.titles();
|
|
}
|
|
|
|
return { items, refresh };
|
|
});
|