Skip to content

Add --no-tree to start with the file tree pane hidden - #308

Merged
umputun merged 1 commit into
masterfrom
feat/no-tree-flag
Aug 5, 2026
Merged

umputun merged 1 commit into
masterfrom
feat/no-tree-flag

Conversation

@umputun

@umputun umputun commented Aug 5, 2026

Copy link
Copy Markdown
Owner

the file tree pane could only be toggled at runtime with t, so there was no way to open revdiff with it already hidden. From discussion #305.

What changed

--no-tree on the options struct, following the --no-mouse shape, so no-tree in the config file and REVDIFF_NO_TREE come with it. main.go passes it into ModelConfig.NoTree and NewModel sets layout.treeHidden from it.

The layout math is untouched: handleResize and the file-load switch already branch on treeHidden, so the flag reuses those paths rather than adding a second way to compute pane widths. t still toggles the pane back on, and a single markdown file's TOC follows the same flag, matching what t does today.

The one piece that is not just wiring is initial focus. Starting with the tree hidden moves focus to the diff pane, the same thing toggleTreePane does when it hides the pane; without it the cursor keys would drive a pane that is not on screen.

Tests

Flag, env var and config-file parsing, plus four model cases: default, hidden, full-width geometry after a resize, and the toggle round-trip.

Related to #305

the pane could only be toggled at runtime with t, so there was no way to open
revdiff without it. The flag follows the existing toggle pattern, so the ini key
and REVDIFF_NO_TREE env var come with it.

hiding the tree also moves initial focus to the diff pane, mirroring what the t
toggle does. Leaving focus on the tree would point the cursor keys at a pane
that is not on screen.

Related to #305
Copilot AI lite review requested due to automatic review settings August 5, 2026 01:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a startup-time way to hide the file tree pane in revdiff, wiring a new --no-tree CLI/config/env option through the composition root into the Bubble Tea model’s initial layout state (including initial focus), with accompanying tests and user/plugin documentation updates.

Changes:

  • Add --no-tree (REVDIFF_NO_TREE, no-tree in config) and wire it into ui.ModelConfig.NoTree.
  • Initialize layout.treeHidden from config and adjust initial focus to the diff pane when the tree is hidden.
  • Add parsing tests and model layout/resize/toggle tests; document the new flag in README/site/plugin reference docs.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
app/config.go Adds NoTree option with CLI/INI/env wiring (--no-tree, REVDIFF_NO_TREE).
app/config_test.go Tests flag/env/config parsing for NoTree.
app/main.go Passes opts.NoTree into ui.ModelConfig.NoTree.
app/ui/model.go Adds ModelConfig.NoTree; initializes layout.treeHidden and sets initial focus to diff when hidden.
app/ui/model_test.go Adds coverage for initial hidden-tree behavior, resize geometry, and toggle round-trip.
README.md Documents --no-tree in the options table.
site/docs.html Documents --no-tree in the website options table.
.claude-plugin/skills/revdiff/references/config.md Documents --no-tree for the Claude plugin reference.
plugins/codex/skills/revdiff/references/config.md Documents --no-tree for the Codex skill reference.
plugins/pi/skills/revdiff/SKILL.md Adds --no-tree to pi skill examples and recommended commands.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

| `--no-confirm-discard` | `REVDIFF_NO_CONFIRM_DISCARD` | Skip confirmation when discarding annotations with Q | `false` |
| `--no-confirm-reload` | `REVDIFF_NO_CONFIRM_RELOAD` | Skip confirmation when dropping annotations on reload with R | `false` |
| `--no-mouse` | `REVDIFF_NO_MOUSE` | Disable mouse support (scroll wheel, click) | `false` |
| `--no-tree` | `REVDIFF_NO_TREE` | Hide the file tree pane | `false` |
@umputun
umputun merged commit 92c716f into master Aug 5, 2026
6 checks passed
@umputun
umputun deleted the feat/no-tree-flag branch August 5, 2026 01:08
p4elkin pushed a commit to p4elkin/revdiff that referenced this pull request Aug 5, 2026
Upstream independently shipped --no-tree (PR umputun#308, related to umputun#305)
while this fork was building the same flag. Resolved by dropping our
duplicate implementation in favor of theirs:

- app/config.go, app/main.go, app/ui/model.go: removed our NoTree
  field/wiring, kept upstream's (which also moves initial focus to the
  diff pane when the tree starts hidden — a behavior ours was missing)
- app/config_test.go, app/ui/model_test.go: removed our now-redundant
  inline assertions and TestModel_NoTreeFromConfig; upstream's
  TestParseArgs_NoTree/TestNewModel_NoTree already cover it, more
  thoroughly
- README.md, site/docs.html, both config.md references: removed our
  duplicate --no-tree row, kept upstream's
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