diff --git a/frontend/src/views/BoardView.vue b/frontend/src/views/BoardView.vue index ed0e23f..54a7981 100644 --- a/frontend/src/views/BoardView.vue +++ b/frontend/src/views/BoardView.vue @@ -14,6 +14,7 @@ const router = useRouter(); const editing = ref(null); const quickAdd = ref | null>(null); +const loadError = ref(""); // The global `c` shortcut bumps composeTick; reopen the composer when we're // already on the board (a fresh navigation autofocuses it via the prop). @@ -118,7 +119,12 @@ const emptyState = computed(() => { }); async function reload() { - await notes.load(currentView.value, currentLabel.value); + loadError.value = ""; + try { + await notes.load(currentView.value, currentLabel.value); + } catch (e) { + loadError.value = (e as { error?: string }).error ?? "Couldn't load your notes."; + } } onMounted(() => { @@ -169,6 +175,18 @@ async function onDrop(target: Note) {
Loading…
+
+

Couldn't load your notes

+

{{ loadError }}

+ +
+

{{ emptyState.title }}

{{ emptyState.subtitle }}

diff --git a/frontend/src/views/GraphView.vue b/frontend/src/views/GraphView.vue index cf4ce55..06711af 100644 --- a/frontend/src/views/GraphView.vue +++ b/frontend/src/views/GraphView.vue @@ -26,6 +26,7 @@ const notes = useNotesStore(); const allNodes = ref([]); const edges = ref([]); const loading = ref(true); +const error = ref(""); const editing = ref(null); const showAll = ref(false); @@ -73,6 +74,7 @@ function fill(color: string): string { async function loadGraph() { loading.value = true; + error.value = ""; try { const res = await api.get<{ nodes: { id: string; title: string; color: string }[]; edges: GEdge[] }>( "/api/graph", @@ -93,6 +95,10 @@ async function loadGraph() { }; }); edges.value = res.edges; + } catch (e) { + error.value = (e as { error?: string }).error ?? "Couldn't load the graph."; + allNodes.value = []; + edges.value = []; } finally { loading.value = false; } @@ -289,6 +295,18 @@ onBeforeUnmount(() => {
Loading graph…
+
+

Couldn't load the graph

+

{{ error }}

+ +
+

No notes yet

diff --git a/frontend/src/views/RemindersView.vue b/frontend/src/views/RemindersView.vue index 873d720..40b2b6e 100644 --- a/frontend/src/views/RemindersView.vue +++ b/frontend/src/views/RemindersView.vue @@ -8,13 +8,18 @@ import NoteEditor from "../components/NoteEditor.vue"; const notes = useNotesStore(); const items = ref([]); const loading = ref(true); +const error = ref(""); const editing = ref(null); async function load() { loading.value = true; + error.value = ""; try { const res = await api.get<{ notes: Note[] }>("/api/notes/reminders"); items.value = res.notes; + } catch (e) { + error.value = (e as { error?: string }).error ?? "Couldn't load reminders."; + items.value = []; } finally { loading.value = false; } @@ -41,6 +46,18 @@ onMounted(load);

Loading…
+
+

Couldn't load reminders

+

{{ error }}

+ +
+

No reminders

Set a reminder on a note (in its editor) to see it here.

diff --git a/frontend/src/views/SearchView.vue b/frontend/src/views/SearchView.vue index 328aa2b..188bbb8 100644 --- a/frontend/src/views/SearchView.vue +++ b/frontend/src/views/SearchView.vue @@ -11,6 +11,7 @@ const notes = useNotesStore(); const results = ref([]); const loading = ref(false); +const error = ref(""); const editing = ref(null); const query = computed(() => (typeof route.query.q === "string" ? route.query.q : "")); @@ -22,9 +23,13 @@ async function run() { return; } loading.value = true; + error.value = ""; try { const res = await api.get<{ notes: Note[] }>(`/api/notes/search?q=${encodeURIComponent(q)}`); results.value = res.notes; + } catch (e) { + error.value = (e as { error?: string }).error ?? "Search failed."; + results.value = []; } finally { loading.value = false; } @@ -61,6 +66,18 @@ async function onNavigate(id: string) {
Searching…
+
+

Couldn't search

+

{{ error }}

+ +
+

No matches

Nothing found for "{{ query }}".