fix: details load once the cursor rests, and moving on cancels them
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
879b961ac5
commit
cd35a8acf4
2 files changed
+27
-9
No files matched your search
@@ -56,6 +56,7 @@ const (
|
||||
slotDescribe // extra metadata for the selected object
|
||||
slotCopy // fetch a value straight to the clipboard
|
||||
slotVersions // count the selected object's versions
|
||||
slotDetails // a vault's, scope's or file's details
|
||||
slotCount
|
||||
)
|
||||
|
||||
@@ -591,7 +592,14 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
m.groups[msg.provider] = groupsState{names: msg.names, err: msg.err}
|
||||
|
||||
case detailsMsg:
|
||||
m.details[msg.key] = detailsState{attrs: msg.attrs, err: msg.err}
|
||||
if msg.req == m.reqID[slotDetails] {
|
||||
m.done(slotDetails)
|
||||
}
|
||||
if errors.Is(msg.err, context.Canceled) || errors.Is(msg.err, context.DeadlineExceeded) {
|
||||
delete(m.details, msg.key) // tried again when shown again
|
||||
} else {
|
||||
m.details[msg.key] = detailsState{attrs: msg.attrs, err: msg.err}
|
||||
}
|
||||
|
||||
case crawlMsg:
|
||||
cmds = append(cmds, m.handleCrawl(msg))
|
||||
|
||||
Reference in new issue
Block a user