feat(db): add wiki-link extraction, resolution, and backlinks
CI / test (pull_request) Successful in 2m27s
CI / test (pull_request) Successful in 2m27s
[[wiki-links]] in entry bodies are extracted at save time, resolved to entity IDs (title match first, body substring fallback), and stored in entity_links junction table. Backlinks surface in TUI detail view showing entries that link to the current entry. Schema migration v5 adds entity_links with CASCADE/SET NULL semantics. Links sync on Create, Update, and Absorb.
This commit is contained in:
@@ -55,6 +55,10 @@ type stepsPersistedMsg struct{}
|
||||
|
||||
type templateCopiedMsg struct{}
|
||||
|
||||
type backlinksLoadedMsg struct {
|
||||
backlinks []db.Backlink
|
||||
}
|
||||
|
||||
type tagsLoadedMsg struct {
|
||||
tags []db.TagCount
|
||||
}
|
||||
@@ -194,6 +198,16 @@ func loadTags(store *db.Store) tea.Cmd {
|
||||
}
|
||||
}
|
||||
|
||||
func loadBacklinks(store *db.Store, entityID string) tea.Cmd {
|
||||
return func() tea.Msg {
|
||||
backlinks, err := store.LoadBacklinks(context.Background(), entityID)
|
||||
if err != nil {
|
||||
return errMsg{err}
|
||||
}
|
||||
return backlinksLoadedMsg{backlinks}
|
||||
}
|
||||
}
|
||||
|
||||
func loadRailTags(store *db.Store) tea.Cmd {
|
||||
return func() tea.Msg {
|
||||
tags, err := store.ListTags(context.Background(), false)
|
||||
|
||||
Reference in New Issue
Block a user