Skip to content

feat(tree): move reusable tree rendering into rust - #357

Merged
fcoury merged 1 commit into
mainfrom
fcoury/native-tree
Sep 4, 2026
Merged

fcoury merged 1 commit into
mainfrom
fcoury/native-tree

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Broad Neo-tree searches can exhaust Husk's instruction budget while constructing matching rows and their ancestors, quarantining the plugin and closing the tree. Searching needle across 80 deeply nested files reproduces the failure even though the result set is capped at 48 matches.

Route browsing and search through the existing Rust TreePanelModel, preserving icons, Git and clipboard decorations, Unicode match highlights, selection, and viewport rendering. Remove the duplicate Husk tree/status renderer and expose UpdateTreePanel, TreePanelSpec, and TreePanelChildren in host API 0.18 so other plugins can supply custom node IDs and styled rows. Filesystem actions and path helpers remain in Husk; the general instruction-budget policy and search-index cap remain separate work.

Also prevent Vim repeat counts from consuming digits in active panel searches: typing needle-079.rs previously produced needle-0.rs.

How to Test

  1. Run cargo test --lib neotree_search_virtualizes_deep_results_without_husk_rendering. The deep fixture should produce 385 native rows with highlighted matches, preserve the first result selection, and cancel successfully without exhausting Husk's budget.
  2. Run cargo test --lib custom_tree and cargo test --lib plugins_can_publish_a_native_tree_without_neotree. Custom trees should retain their row order, styles, selection, and panel actions; invalid parents, duplicate IDs, and reserved IDs should be rejected.
  3. Create needle-079.rs in a scratch workspace and launch it with cargo run --bin red -- --root <workspace>. Open :NeoTree, press /, and type the filename one character at a time. Every digit should remain in the query, and Enter should open the matching file. Repeat and press Escape to restore browsing. Check that D searches directories and f keeps a filter until Ctrl-X clears it. The numeric-input regression is also covered by cargo test --lib panel_search_accepts_digits_without_starting_a_vim_repeat_count.

Validated on the code committed as 97bc40df: 2,491 library tests passed (3 ignored), Clippy passed with --all-targets --all-features -- -D warnings, and build/format checks passed. Seven terminal captures were byte-identical to the baseline across browsing, exact search, cancellation, directory search, persistent filtering, clearing the filter, and opening a result. The broad-search and typed-prefix terminal checks also passed.

@fcoury

fcoury commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-04T02:02:26.116082Z 97bc40d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 97bc40df41

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fcoury
fcoury merged commit e6ccc99 into main Sep 4, 2026
14 checks passed
@fcoury
fcoury deleted the fcoury/native-tree branch September 4, 2026 02:05
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