Add file tree sidebar and code editor panel#601
Add file tree sidebar and code editor panel#601Shehryar wants to merge 6 commits intomanaflow-ai:mainfrom
Conversation
Adds a file tree browser to the sidebar that can be toggled with the tab list via persistent header buttons or Cmd+Shift+E. The file tree scans the active workspace directory, supports expand/collapse, hidden file toggle, refresh, and opens files in $EDITOR via the terminal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a "Sidebar File Tree" setting (Settings > App) with two modes: - Toggle (default): tabs and file tree are mutually exclusive (Cmd+Shift+E) - Split: tabs on top, file tree on bottom with a draggable horizontal divider Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Opens files from the file tree sidebar as in-app editor tabs instead of sending $EDITOR to the terminal. Plain text editing with monospaced NSTextView, Cmd+S save, dirty state tracking, and close confirmation for unsaved changes. Deduplicates tabs by file path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wire up Neon + CodeEditLanguages for incremental, viewport-aware syntax highlighting across 41 languages. Uses Dracula color spec, async highlighting setup with per-language caching, and plain-text paste override for the rich text view. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Swap out the custom NSTextView/Neon/CodeEditLanguages code editor for STTextView (TextKit 2) with Plugin-Neon syntax highlighting and Plugin-TextFormation for bracket pairing and smart indentation. - STTextView handles line numbers, current line highlight, scroll natively - Plugin-Neon provides Tree-sitter syntax highlighting (20 languages, Dracula theme) - Plugin-TextFormation provides auto-close brackets/quotes, skip-over, delete-matching, newline-between-pairs, and pattern-based indentation - Removes unused CodeEditorTextEditing.swift and LineNumberRulerView.swift - Adds editor-tab-width config key (default 4, clamped 1-16) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…on persistence - Add triggerFlash() to CodeEditorPanel (required by updated Panel protocol) - Add .codeEditor cases to session snapshot/restore switches - Update vendor/bonsplit submodule to match upstream Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@Shehryar is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db85d157dd
ℹ️ 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".
| Task { | ||
| let nodes = await scanDirectory(path) | ||
| self.rootNodes = nodes |
There was a problem hiding this comment.
Guard async directory scans against out-of-order completion
loadDirectory launches an untracked async scan and always assigns its result to rootNodes, so if users switch workspaces/directories quickly, an older scan can finish after a newer one and overwrite the tree with stale entries (while rootPath now points elsewhere). This causes the sidebar to show files from the wrong directory and can open the wrong file when clicked; add cancellation or verify the scanned path still matches the current root before publishing.
Useful? React with 👍 / 👎.
| Button("Toggle File Tree") { | ||
| if sidebarContentModeState.mode == .fileTree { | ||
| sidebarContentModeState.mode = .tabs | ||
| } else { | ||
| sidebarContentModeState.mode = .fileTree | ||
| if !sidebarState.isVisible { | ||
| sidebarState.toggle() |
There was a problem hiding this comment.
Route file-tree menu action through active window context
This menu command mutates the app-level sidebarContentModeState/sidebarState directly, unlike the adjacent "Toggle Sidebar" action that first targets the active main window via AppDelegate. In multi-window use, invoking "Toggle File Tree" from a non-primary window will toggle the primary window's state instead of the focused window, producing inconsistent behavior between menu action and per-window shortcut handling.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db85d157dd
ℹ️ 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".
| Task { | ||
| let nodes = await scanDirectory(path) | ||
| self.rootNodes = nodes |
There was a problem hiding this comment.
Guard async directory loads against stale results
loadDirectory starts a new Task and always assigns its scan result to rootNodes, but there is no generation/cancellation check against the latest rootPath. If the user switches tabs/workspaces quickly (or triggers another load before the first scan finishes), an older task can complete last and overwrite the tree with the wrong directory contents.
Useful? React with 👍 / 👎.
| let _ = self.findAndUpdate(in: ¤t, id: nodeId) { n in | ||
| n.children = children | ||
| } |
There was a problem hiding this comment.
Reapply expanded state when lazy-loading refreshed children
refresh() collects expanded IDs recursively, but in restoreExpandedState the async lazy-load path only does n.children = children and never reapplies expandedIds to the newly loaded subtree. This means nested folders that were expanded before refresh are collapsed afterward, despite the method claiming to preserve expanded state.
Useful? React with 👍 / 👎.
| Button("Toggle File Tree") { | ||
| if sidebarContentModeState.mode == .fileTree { | ||
| sidebarContentModeState.mode = .tabs | ||
| } else { | ||
| sidebarContentModeState.mode = .fileTree |
There was a problem hiding this comment.
Route Toggle File Tree menu action to active window
This command mutates the app-level sidebarContentModeState/sidebarState captured by cmuxApp, while additional windows get their own SidebarContentModeState in AppDelegate.createMainWindow. In multi-window use, invoking Toggle File Tree from a non-primary window can toggle the wrong window���s sidebar state.
Useful? React with 👍 / 👎.
Port file tree sidebar from PR manaflow-ai#601 (credit @Shehryar) and add cmd-click to inject file paths into the active terminal pane. - File tree sidebar toggled with Cmd+Shift+E - Toggle or split layout with workspace tabs - Cmd-click any file/folder to insert its shell-escaped path into terminal - Regular click expands/collapses dirs, selects files - Right-click context menu (copy path, reveal in Finder, open, insert path) - Lazy directory loading, hidden files toggle, manual refresh Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Port file tree sidebar concept from PR manaflow-ai#601 (credit @Shehryar) and add cmd-click to inject file paths into the active terminal pane. - File tree sidebar toggled with Cmd+E or titlebar folder button - Cmd-click any file/folder to insert shell-escaped path into terminal - Regular click to select files, expand/collapse folders - Right-click context menu (Copy Path, Reveal in Finder, Open in Default App) - FSEvents file watching for automatic tree refresh - Hidden files shown by default - Lazy directory loading with preserved expand state on refresh Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Details
File tree sidebar:
Split sidebar layout:
Code editor panel:
Test plan
🤖 Generated with Claude Code