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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user