Skip to content

feat: add opt-in compact folders to the file tree - #698

Merged
agavra merged 2 commits into
agavra:mainfrom
Jonathanm10:feat/compact-folders
Sep 11, 2026
Merged

agavra merged 2 commits into
agavra:mainfrom
Jonathanm10:feat/compact-folders

Conversation

@Jonathanm10

Copy link
Copy Markdown
Contributor

Deep package hierarchies consume file-tree rows and push filenames far to the right. This adds compact_folders = true to join single-child directory chains into one row, with existing behavior preserved by default.

For a review containing app/src/main/kotlin/EditorScreen.kt:

Before                         With compact_folders = true
app/                           app/src/main/kotlin/
  src/                           EditorScreen.kt
    main/
      kotlin/
        EditorScreen.kt

Chains stop at directories containing direct review files or multiple child directories, using the active filtered file set. Each joined row expands or collapses as one unit. Full-path search, file identity, and diff navigation are preserved. Compact rows scroll by terminal columns, including wide and combining Unicode characters.

Addresses the compact-folder portion of #476. Flat mode, label ellipses, sidebar resizing, and runtime mode switching are outside this PR.

Validation

  • cargo test: 1,618 passed, 4 ignored.
  • cargo build, cargo check, and cargo fmt --check: passed.
  • Dogfooded with cargo run -- -w against this diff. A live Kotlin fixture verified compact rendering, Enter collapse/reopen, and full-path search from a collapsed tree.
  • Strict cargo clippy --all-targets -- -D warnings reports a pre-existing clippy::useless_format in src/forge/bitbucket/bkt.rs:1155, also present in base commit 58eb8e1. With that lint suppressed, all-target Clippy passes. That file is unchanged.

Related work

#370 proposes optional arrow navigation and scrolling changes; #556 changes file-tree scrolling and adds flat mode/resizing. Neither implements compact chains, but both touch related tree behavior and rendering.

@agavra agavra left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed leniently for blockers. The branch is updated with current main, the README feature bullet was removed, and the merged tree passes formatting, Clippy, and the full test suite.

@agavra
agavra merged commit a33d39a into agavra:main Sep 11, 2026
5 checks passed
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.

2 participants