Skip to content

Commit 8eeffb9

Browse files
committed
Remove neo-tree experiment
1 parent c10ef1e commit 8eeffb9

File tree

10 files changed

+12
-765
lines changed

10 files changed

+12
-765
lines changed

AGENTS.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,8 @@
5454
- Auto-sync timers are owned by `init.lua`; `state.clear_review()` should call `neo_reviewer._stop_autosync()` when available to avoid leaking periodic timers across teardown paths and tests.
5555
- To keep the AI walkthrough panel stable during sync, plumb `keep_ai_ui` through `state.clear_review()` and re-render with `ai_ui.open()` after rebuilding review state.
5656

57-
## Learned while implementing the Neo-tree review source and AI pane split
57+
## Learned while implementing the AI pane split
5858

59-
- `nix flake check` only sees git-tracked paths; if a Lua module exists only as a new untracked file, Nix builds/tests fail with `module not found`. For temporary or optional modules, registering them through `package.preload` inside a tracked file keeps checks honest without needing git writes.
60-
- Neo-tree custom sources must expose `components` on the root module or provide a tracked `mod_root .. ".components"` module; preloading only the source and commands still fails during `setup()`.
61-
- If a custom source should look like Neo-tree filesystem output, render `{ root }` instead of `root.children` and populate source state such as `git_status_lookup`; borrowing filesystem components alone is not enough.
6259
- `topleft {width}vsplit` from the AI walkthrough pane creates a full-height column across the whole tab, not a split inside the bottom walkthrough area. Use `leftabove {width}vsplit` from the detail window to keep the navigator inside the walkthrough pane; otherwise the main editor window collapses and stacked walkthrough windows fail with `E36`.
6360
- Transient loading panes need the same split-base exclusions as AI/Ask walkthrough panes; if `find_split_base_window()` can target `neo-reviewer-loading`, the final navigator/detail splits open relative to the loading scratch window instead of the editor layout.
6461

@@ -79,8 +76,6 @@
7976

8077
## Learned while smoothing ReviewSync UI refresh
8178

82-
- `neo_reviewer.neotree.is_open()` cannot rely on `manager.get_state("review").winid` alone; Neo-tree source state can point at a valid sidebar window whose visible buffer belongs to another source. Confirm `vim.b[bufnr].neo_tree_source == "review"` before deciding the review tree is already open.
83-
- `neo_reviewer.neotree.on_review_changed({ open = true })` should still refresh, not re-open, when the review source buffer is already visible; otherwise autosync re-runs the Neo-tree open command and disturbs the layout.
8479
- For AI review panes, re-rendering existing split buffers during sync should preserve current window sizes; reusing `open()` without a layout-preserving option causes background refreshes to resize walkthrough splits.
8580

8681
## Project Overview

doc/neo_reviewer.txt

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ your editor. It provides:
2828
- Multi-line comments with visual range selection
2929
- Submit reviews (approve or request changes)
3030
- Telescope integration for file picker
31-
- Optional Neo-tree changed-files review source
3231
- Local git diff review (review uncommitted changes before pushing)
3332
- AI-powered review analysis (optional, via Codex CLI by default)
3433

@@ -38,7 +37,6 @@ your editor. It provides:
3837
- Neovim >= 0.9.0
3938
- plenary.nvim (required)
4039
- telescope.nvim (optional, for file picker)
41-
- neo-tree.nvim (optional, for changed-files review tree)
4240
- neo-reviewer CLI (Rust CLI tool)
4341
- GitHub authentication via `gh` CLI
4442

@@ -107,10 +105,6 @@ Call setup() with your options: >lua
107105
periodic_interval_ms = 120000, -- 2 minutes
108106
cooldown_ms = 1500, -- Min spacing between sync starts
109107
},
110-
neo_tree = {
111-
open_on_review = false, -- Auto-open Neo-tree review source
112-
position = "left", -- Neo-tree window position
113-
},
114108
ai = {
115109
enabled = false, -- Run AI analysis by default
116110
model = "gpt-5.3-codex", -- Model for Codex CLI (default)
@@ -168,28 +162,6 @@ sync ~
168162
Automatic save/periodic sync runs silently on success (no "Synced"
169163
notifications). Errors still notify.
170164

171-
*neo_reviewer-config-neo_tree*
172-
neo_tree ~
173-
Configure optional Neo-tree integration for changed review files.
174-
- `open_on_review`: Open the Neo-tree review source when a review starts
175-
(default: false).
176-
- `position`: Neo-tree window position for the review source
177-
(default: "left").
178-
179-
To enable the source in Neo-tree, add
180-
`"neo_reviewer.sources.review"` to your Neo-tree `sources` list. The
181-
source name inside Neo-tree is `review`, so you can open it manually with
182-
`:Neotree review` or include it in the source selector. Example: >
183-
require("neo-tree").setup({
184-
sources = {
185-
"filesystem",
186-
"buffers",
187-
"git_status",
188-
"neo_reviewer.sources.review",
189-
},
190-
})
191-
<
192-
193165
*neo_reviewer-config-ai*
194166
ai ~
195167
Configure AI-powered review analysis. Requires an AI CLI (Codex CLI by
@@ -334,7 +306,7 @@ These user commands are created when you call `setup()`.
334306
By default, sync also runs automatically on save for reviewed files and as
335307
a periodic background refresh every 2 minutes. Save-triggered PR sync skips
336308
comment refresh (diff/highlights only). Automatic sync refreshes already-
337-
open Neo-tree/AI walkthrough windows in place instead of reopening them.
309+
open AI walkthrough windows in place instead of reopening them.
338310
Configure via `sync.*`.
339311

340312
==============================================================================
@@ -483,8 +455,8 @@ require("neo_reviewer").sync() *neo_reviewer.s
483455
Preserves cursor position and expanded change block state when possible.
484456
Manual sync (`:ReviewSync`) always refreshes comments for PR reviews.
485457
Automatic save-triggered sync refreshes diff/highlights but skips comment
486-
refresh for PR reviews, while keeping open Neo-tree/AI review panes in
487-
place instead of reopening them.
458+
refresh for PR reviews, while keeping open AI review panes in place instead
459+
of reopening them.
488460
See |:ReviewSync|.
489461

490462
require("neo_reviewer").toggle_ai_feedback() *neo_reviewer.toggle_ai_feedback()*

lua/neo_reviewer/config.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@
3333
---@field focus_on_open boolean Whether to focus the walkthrough window on open
3434
---@field step_list_width integer Preferred width of the AI step list pane
3535

36-
---@class NRNeoTree
37-
---@field open_on_review boolean Open the Neo-tree review source when a review starts
38-
---@field position string Neo-tree window position for the review source
39-
4036
---@class NRReviewDiff
4137
---@field skip_noise_files boolean Whether to skip common lock/noise files in PR and local diff reviews
4238
---@field noise_files string[] Basenames to skip in PR and local diff reviews when skip_noise_files is enabled
@@ -57,7 +53,6 @@
5753
---@field input_window NRInputWindow
5854
---@field review_diff NRReviewDiff
5955
---@field sync NRSync
60-
---@field neo_tree NRNeoTree Optional Neo-tree integration for changed review files
6156
---@field ai NRAI AI analysis configuration
6257

6358
---@class NRPartialSigns
@@ -88,10 +83,6 @@
8883
---@field focus_on_open? boolean Whether to focus the walkthrough window on open
8984
---@field step_list_width? integer Preferred width of the AI step list pane
9085

91-
---@class NRPartialNeoTree
92-
---@field open_on_review? boolean Open the Neo-tree review source when a review starts
93-
---@field position? string Neo-tree window position for the review source
94-
9586
---@class NRPartialReviewDiff
9687
---@field skip_noise_files? boolean Whether to skip common lock/noise files in PR and local diff reviews
9788
---@field noise_files? string[] Basenames to skip in PR and local diff reviews when skip_noise_files is enabled
@@ -119,7 +110,6 @@
119110
---@field input_window? NRPartialInputWindow
120111
---@field review_diff? NRPartialReviewDiff
121112
---@field sync? NRPartialSync
122-
---@field neo_tree? NRPartialNeoTree Optional Neo-tree integration for changed review files
123113
---@field ai? NRPartialAI AI analysis configuration
124114

125115
---@class NRConfigModule
@@ -195,10 +185,6 @@ M.values = {
195185
periodic_interval_ms = 120000,
196186
cooldown_ms = 1500,
197187
},
198-
neo_tree = {
199-
open_on_review = false,
200-
position = "left",
201-
},
202188
ai = {
203189
enabled = false,
204190
model = "gpt-5.3-codex",

lua/neo_reviewer/init.lua

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,11 @@ local function register_preloads_with(plugin)
6161

6262
plugin.register_preloads()
6363
return package.preload["neo_reviewer.ui.loading"] ~= nil
64-
and package.preload["neo_reviewer.neotree"] ~= nil
65-
and package.preload["neo_reviewer.sources.review"] ~= nil
6664
end
6765

6866
---@return nil
6967
local function ensure_preloads()
70-
if
71-
package.preload["neo_reviewer.ui.loading"]
72-
and package.preload["neo_reviewer.neotree"]
73-
and package.preload["neo_reviewer.sources.review"]
74-
then
68+
if package.preload["neo_reviewer.ui.loading"] then
7569
return
7670
end
7771

@@ -140,15 +134,12 @@ function M._stop_autosync()
140134
stop_autosync()
141135
end
142136

143-
---@param opts? { keep_ai_ui?: boolean, keep_neotree?: boolean }
137+
---@param opts? { keep_ai_ui?: boolean }
144138
local function clear_active_review(opts)
145139
local state = require("neo_reviewer.state")
146140
stop_autosync()
147141
get_loading_ui().close()
148142
state.clear_review(opts)
149-
if not (opts and opts.keep_neotree) then
150-
require("neo_reviewer.neotree").on_review_cleared()
151-
end
152143
end
153144

154145
---@param bufnr integer
@@ -660,7 +651,6 @@ function M.review_diff(opts)
660651

661652
local function finish_setup()
662653
M.enable_overlay()
663-
require("neo_reviewer.neotree").on_review_changed()
664654

665655
if skipped_count > 0 then
666656
vim.notify(
@@ -783,7 +773,6 @@ function M.fetch_and_enable(url, on_ready, opts)
783773

784774
local function finish_setup()
785775
M.enable_overlay()
786-
require("neo_reviewer.neotree").on_review_changed()
787776

788777
local nav = require("neo_reviewer.ui.nav")
789778
nav.first_change()
@@ -1400,9 +1389,7 @@ function M.sync(opts)
14001389
ai_analysis = review.ai_analysis,
14011390
}
14021391
local ai_ui = require("neo_reviewer.ui.ai")
1403-
local neotree = require("neo_reviewer.neotree")
14041392
local keep_ai_ui_open = ai_ui.is_open() and preserved.ai_analysis ~= nil
1405-
local keep_neotree_open = neotree.is_open()
14061393
local cursor_pos = vim.api.nvim_win_get_cursor(0)
14071394

14081395
if is_manual then
@@ -1418,12 +1405,9 @@ function M.sync(opts)
14181405

14191406
local filtered_files, skipped_count = filter_review_files(data.files, config.values.review_diff)
14201407

1421-
clear_active_review({ keep_ai_ui = keep_ai_ui_open, keep_neotree = keep_neotree_open })
1408+
clear_active_review({ keep_ai_ui = keep_ai_ui_open })
14221409

14231410
if #filtered_files == 0 then
1424-
if keep_neotree_open then
1425-
neotree.on_review_cleared()
1426-
end
14271411
finish_sync()
14281412
if is_manual and #data.files == 0 then
14291413
vim.notify("No changes to review", vim.log.levels.WARN)
@@ -1456,7 +1440,6 @@ function M.sync(opts)
14561440
if keep_ai_ui_open then
14571441
ai_ui.open({ preserve_layout = true })
14581442
end
1459-
neotree.on_review_changed({ open = keep_neotree_open })
14601443

14611444
pcall(vim.api.nvim_win_set_cursor, 0, cursor_pos)
14621445

@@ -1499,9 +1482,7 @@ function M.sync(opts)
14991482
ai_analysis = review.ai_analysis,
15001483
}
15011484
local ai_ui = require("neo_reviewer.ui.ai")
1502-
local neotree = require("neo_reviewer.neotree")
15031485
local keep_ai_ui_open = ai_ui.is_open() and preserved.ai_analysis ~= nil
1504-
local keep_neotree_open = neotree.is_open()
15051486
local old_comment_count = #review.comments
15061487
local cursor_pos = vim.api.nvim_win_get_cursor(0)
15071488

@@ -1522,11 +1503,8 @@ function M.sync(opts)
15221503
data.comments = review.comments
15231504
end
15241505

1525-
clear_active_review({ keep_ai_ui = keep_ai_ui_open, keep_neotree = keep_neotree_open })
1506+
clear_active_review({ keep_ai_ui = keep_ai_ui_open })
15261507
if #filtered_files == 0 then
1527-
if keep_neotree_open then
1528-
neotree.on_review_cleared()
1529-
end
15301508
finish_sync()
15311509
if is_manual and #data.files == 0 then
15321510
vim.notify("No changes to review", vim.log.levels.WARN)
@@ -1567,7 +1545,6 @@ function M.sync(opts)
15671545
if keep_ai_ui_open then
15681546
ai_ui.open({ preserve_layout = true })
15691547
end
1570-
neotree.on_review_changed({ open = keep_neotree_open })
15711548

15721549
pcall(vim.api.nvim_win_set_cursor, 0, cursor_pos)
15731550

0 commit comments

Comments
 (0)