Skip to content

feat: show hidden folders in the folder tree on demand - #83

Merged
backnotprop merged 3 commits into
mainfrom
feat/tree-hidden-folders
Sep 21, 2026
Merged

backnotprop merged 3 commits into
mainfrom
feat/tree-hidden-folders

Conversation

@backnotprop

Copy link
Copy Markdown
Contributor

Closes plannotator/herdr-annotate#53 — a plan in .agents/drafts/ could not be opened from annotate.open, because the folder tree skipped every dot-prefixed entry.

What changed

. in tree focus shows or hides dot-prefixed entries for the session, with a status line saying which (hidden entries shown / hidden entries hidden). . was free: tree focus only bound j/k, Enter/l/Right and Esc, and no global key uses it.

The default view is unchanged. Hidden entries stay off at open, first_file_shallow (which picks the file the folder opens on) still ignores them, and the existing tree fixture test pins the default listing row for row.

No new walking on the default path. The tree was already lazy — one directory level at open, a directory's children when it is expanded — so a hidden directory is read only once it is both shown and expanded. Toggling relists the root and re-expands the directories that were already open; nothing else is touched.

Denylist

One documented SKIPPED_DIRS const in tree.rs, never listed and never read, hidden entries on or off:

.cache · .direnv · .git · .hg · .jj · .svn · .venv · __pycache__ · build · dist · node_modules · out · target · vendor · venv

The version-control and cache names are new; the rest were already skipped. A repo's .git is the one that would otherwise stall the pane, and the tree never creates a row for it, so there is no path by which it can be read.

Data behaviour is unchanged

Showing or hiding is a view concern. review_files() takes the annotated documents from the records on disk (Store::annotated_documents, restricted to the folder root) and merely adds the listed rows that have notes, so notes recorded for a file inside a hidden folder are already part of the review: E, the review counts and Finish review include them whether or not the folder is listed.

Tests

  • . shows .agents, expands down to .agents/drafts/draft.md and opens it; hiding again restores the default view and leaves the file open.
  • No SKIPPED_DIRS name appears when hidden entries are shown, including across a hide/show relist; .git/config.md never reaches the tree.
  • Hidden entries relist with expanded directories preserved.
  • The existing lazy-listing test pins the default view, with .agents/ and .git/ added to its fixture.

cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace are clean.

Dot-prefixed entries stay out of the tree unless the view asks for them, and a
hidden directory is read only once it is both shown and expanded, so the default
path still touches nothing extra. Version-control, dependency and build
directories join one documented denylist that is never listed or read either way.

refs plannotator/herdr-annotate#53
`.` in tree focus shows or hides dot-prefixed entries for the session and says
which in the status line, keeping the cursor on its row. Showing is a view
choice: review files come from the records on disk, so notes inside a hidden
folder are counted and sent whether or not the folder is listed.

refs plannotator/herdr-annotate#53
@backnotprop
backnotprop added this pull request to the merge queue Sep 21, 2026
Merged via the queue into main with commit 2173ff8 Sep 21, 2026
2 checks passed
@backnotprop
backnotprop deleted the feat/tree-hidden-folders branch September 21, 2026 20:35
@backnotprop backnotprop mentioned this pull request Sep 21, 2026
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.

annotate.open file tree doesn't show hidden folders

1 participant