M3 wiki-links: [[links]] + backlinks
- Migration 0009: note_links (source_id, target_norm). Parse [[...]] from body on
create/update and rewrite the source's links. GET /api/notes/titles (owner
{id,title} index for client-side resolution); GET /api/notes/<id>/backlinks.
- Frontend: titles store; LinkedText renders [[Title]] styled on cards; editor
shows Links (outgoing, resolve/create-on-click) + Linked-from (backlinks),
clicking navigates the editor to the target note (board + search).
- notes store: fetchOne, createTitled. DB-free link-parser tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FRgehjoz7Yv8LkUfADxACm
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
import { computed, ref, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { api } from "../api/client";
|
||||
import type { Note } from "../stores/notes";
|
||||
import { useNotesStore, type Note } from "../stores/notes";
|
||||
import NoteCard from "../components/NoteCard.vue";
|
||||
import NoteEditor from "../components/NoteEditor.vue";
|
||||
|
||||
const route = useRoute();
|
||||
const notes = useNotesStore();
|
||||
|
||||
const results = ref<Note[]>([]);
|
||||
const loading = ref(false);
|
||||
@@ -38,6 +39,15 @@ async function closeEditor() {
|
||||
editing.value = null;
|
||||
await run(); // reflect any edits made from a result
|
||||
}
|
||||
async function onNavigate(id: string) {
|
||||
const found = results.value.find((n) => n.id === id);
|
||||
if (found) {
|
||||
editing.value = found;
|
||||
return;
|
||||
}
|
||||
const fetched = await notes.fetchOne(id);
|
||||
if (fetched) editing.value = fetched;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -62,6 +72,6 @@ async function closeEditor() {
|
||||
</div>
|
||||
|
||||
<template v-if="editing">
|
||||
<NoteEditor :note="editing" @close="closeEditor" />
|
||||
<NoteEditor :note="editing" @close="closeEditor" @navigate="onNavigate" />
|
||||
</template>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user