wagoodman/dive · warning
unable to propagate tree on cursorLeft: %w
Error message
unable to propagate tree on cursorLeft: %w
What it means
CursorLeft walks the model tree parent-first to recompute the index of the current node's parent (jump-to-parent navigation) and wraps any traversal error. As in other spots, the visitor closure returns nil unconditionally, so this wrap is defensive and essentially unreachable unless the traversal itself fails on structurally invalid tree state.
Source
Thrown at cmd/dive/cli/internal/ui/v1/viewmodel/filetree.go:202
if strings.Compare(parentPath, curNode.Path()) == 0 {
newIndex = dfsCounter
}
dfsCounter++
return nil
}
evaluator = func(curNode *filetree.FileNode) bool {
regexMatch := true
if filterRegex != nil {
match := filterRegex.Find([]byte(curNode.Path()))
regexMatch = match != nil
}
return !curNode.Parent.Data.ViewInfo.Collapsed && !curNode.Data.ViewInfo.Hidden && regexMatch
}
err := vm.ModelTree.VisitDepthParentFirst(visitor, evaluator)
if err != nil {
return fmt.Errorf("unable to propagate tree on cursorLeft: %w", err)
}
vm.TreeIndex = newIndex
moveIndex := oldIndex - newIndex
if newIndex < vm.bufferIndexLowerBound {
vm.bufferIndexLowerBound = vm.TreeIndex
}
if vm.bufferIndex > moveIndex {
vm.bufferIndex -= moveIndex
} else {
vm.bufferIndex = 0
}
return nil
}
// CursorRight descends into directory expanding it if neededView on GitHub (pinned to d6c691947f)
Solutions
- In stock dive, report upstream with the wrapped error chain
- In forks, avoid mutating ModelTree inside visitor closures or concurrently with key handling
- Reproduce with filtering disabled (no regex evaluator path) to isolate the cause
- Re-analyze the image to rebuild clean trees
Defensive patterns
Strategy: try-catch
Try / catch
if err := vm.CursorLeft(filterRegex); err != nil {
// navigation is non-critical: log and keep prior cursor state
log.WithFields("error", err).Debug("cursorLeft failed")
} Prevention
- Never mutate the tree inside navigation visitors
- Guard against nil nodes when reading Parent links
When it happens
Trigger: vm.ModelTree.VisitDepthParentFirst returning an error during a left-arrow press; the closure only records an index and never errors, so this needs an invalid tree (broken links/nil nodes) or fork-modified traversal.
Common situations: Not observed with stock dive; conceivable in forks that mutate the tree during navigation or under concurrent tree access from filter-edit listeners.
Related errors
- unable to propagate layer tree: %w
- unable to propagate vm model tree: %w
- unable to move the cursor, empty line
- controller unable to switch to next pane: %w
- controller unable to switch to previous pane: %w
AI-assisted analysis of wagoodman/dive@d6c691947f (2026-08-15).
Data as JSON: /api/errors/e628799baac0f11e.
Report an issue: GitHub.