-
Notifications
You must be signed in to change notification settings - Fork 650
[Feature Proposal] Toggleable File Explorer & Opt-In AI Assistant (via C ABI Plugin) #781
Description
Hello maintainers,
I have been exploring the edit repository and really appreciate the homage to the classic MS-DOS editor combined with the strict lightweight philosophy. I would love to contribute to the project by introducing two modern workflow features that respect the editor's minimal footprint: a toggleable file explorer and an AI assistant.
Because keeping the binary size small is a stated priority in CONTRIBUTING.md, I want to propose an architecture for these features before writing any code.
Feature 1: Toggleable File Explorer (Native UI)
Navigating multi-file projects currently requires leaning heavily on the terminal or file picker. I propose adding a lightweight, toggleable folder tree sidebar.
-
UI Integration: This would be built using the existing immediate mode UI primitives in src/tui.rs and drawn to src/framebuffer.rs.
-
Behavior: It would remain completely hidden by default to preserve the classic layout, toggleable via a specific hotkey or menu bar option.
-
State Management: It would read the local directory structure lazily to ensure it does not impact the editor's extremely fast startup time.
Feature 2: AI Assistant & Live Editing (Plugin Architecture)
Bringing AI-powered live editing and an AI chat tab to the editor would be highly valuable, but introducing an HTTP client and JSON parser directly into the Rust core violates the zero-dependency philosophy.
-
The Plugin Approach: I propose laying the groundwork for the plugin system mentioned in the contributing guidelines. We could expose a simple C ABI that allows external dynamic libraries to read from and write to the text buffer.
-
External Execution: The actual AI logic, network requests, and text parsing would live entirely in a separate, optional C/C++ dynamic library that the user must explicitly load. If the user does not load the plugin, edit retains its sub-megabyte size.
-
Capabilities: The ABI would allow the plugin to either open a dedicated "AI Tab" using the TUI or manipulate text directly in the active src/buffer at the current cursor position.
Proposed Next Steps
I am happy to take the lead on building these features. Would the core team prefer to see these as two separate pull requests?
Specifically, I would like feedback on:
-
Is the team open to adding a persistent, toggleable sidebar layout to tui.rs?
-
Would you accept a PR that introduces the initial FFI/C ABI bindings to support the external AI plugin concept?
Looking forward to your thoughts!