Skip to content

feat: Add ui.startFoldersOpenDepth config option#123

Open
nasxisbest wants to merge 1 commit intodlvhdr:mainfrom
nasxisbest:feat/start-folders-open-depth
Open

feat: Add ui.startFoldersOpenDepth config option#123
nasxisbest wants to merge 1 commit intodlvhdr:mainfrom
nasxisbest:feat/start-folders-open-depth

Conversation

@nasxisbest
Copy link
Copy Markdown

@nasxisbest nasxisbest commented Apr 10, 2026

Summary

Adds ui.startFoldersOpenDepth config option to control how many levels deep folders are expanded when diffnav starts.

  • -1 (default): all folders open, same as current behavior
  • 0: all folders collapsed
  • 1: first level open, everything deeper is collapsed
  • N: N levels open

AI disclosure: Written with Claude Code. I reviewed all changes and understand the code. The closeDirsBelow function recursively walks children-first, then closes any directory node whose depth exceeds maxOpenDepth. Children-first traversal is needed because the charm bubbles tree hides a closed node's children from iteration via lipgloss Offset.

How Did You Test this Change?

  • Unit tests for depth 0 (all collapsed) and depth 1 (first level open, deeper closed)
  • go test ./... passes
  • go build ./... clean

Images/Videos

Allow users to control how many levels of folders are expanded on
start in the file tree sidebar. Defaults to -1 (all open, preserving
current behavior). Set to 0 for all collapsed, or any positive
integer for that many levels of depth.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant