feat(tui): add link picker and navigation history
CI / test (pull_request) Successful in 2m18s

Press [ in detail view to open link picker showing all [[links]]
in the current entry. Enter follows a link, resolving by title
then body substring. Navigation history stack enables esc to pop
back through followed links before returning to list.

Adds Store.ResolveLink() for non-transactional link resolution
from the TUI layer.
This commit is contained in:
2026-05-21 14:03:09 -04:00
parent 8426c2fbc1
commit 2684eb1d24
6 changed files with 201 additions and 0 deletions
+14
View File
@@ -59,6 +59,10 @@ type backlinksLoadedMsg struct {
backlinks []db.Backlink
}
type linkFollowedMsg struct {
entity *db.Entity
}
type tagsLoadedMsg struct {
tags []db.TagCount
}
@@ -208,6 +212,16 @@ func loadBacklinks(store *db.Store, entityID string) tea.Cmd {
}
}
func followLink(store *db.Store, linkText string) tea.Cmd {
return func() tea.Msg {
entity, err := store.ResolveLink(context.Background(), linkText)
if err != nil {
return errMsg{err}
}
return linkFollowedMsg{entity}
}
}
func loadRailTags(store *db.Store) tea.Cmd {
return func() tea.Msg {
tags, err := store.ListTags(context.Background(), false)