-
Notifications
You must be signed in to change notification settings - Fork 43
🤖 feat: replace TextFileViewer with editable CodeMirror TextFileEditor #1726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b35ca5f7b2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review Addressed the write script exit behavior so save failures surface properly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d6e78e601
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
src/browser/components/RightSidebar/FileViewer/TextFileEditor.tsx
Outdated
Show resolved
Hide resolved
|
@codex review Normalized line endings for dirty tracking and preserved CRLF on save. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 686267128d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
f84aeb8 to
93ece07
Compare
|
@codex review Addressed the stale line-ending update by guarding before the ref update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93ece0786d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review Lowered the file viewer size cap to avoid executeBash arg limits and stabilized draft persistence/refresh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b959e81a5d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
src/browser/components/RightSidebar/FileViewer/FileViewerTab.tsx
Outdated
Show resolved
Hide resolved
|
@codex review Addressed: removed ignore increments for executeBash and clear stale drafts on load. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74bb962100
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
src/browser/components/RightSidebar/FileViewer/FileViewerTab.tsx
Outdated
Show resolved
Hide resolved
|
@codex review Switched file-modifying tool handling to always surface the reload banner (no auto-refresh), which also avoids the debounce/dirty race. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ae2828d49
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
src/browser/components/RightSidebar/FileViewer/FileViewerTab.tsx
Outdated
Show resolved
Hide resolved
Replace the read-only TextFileViewer with a full CodeMirror 6 editor: - **Editable + save**: Full editing support with Cmd/Ctrl+S save keybind - **Inline diff**: Git diff shown as line decorations (added lines highlighted, removed lines rendered as widgets with old line numbers) - **Theme integration**: Uses CSS variables for consistent light/dark theming - **Dirty state handling**: Shows 'Unsaved' indicator, prompts on external file changes, prevents auto-refresh when dirty - **Save pipeline**: Base64-encoded writes via executeBash for safe handling Language support: JS/TS/JSX/TSX, HTML, CSS, JSON, Markdown, Python, Rust, Go, Java, SQL, XML, YAML, C/C++, PHP. ImageFileViewer unchanged.
8ae2828 to
2b3af2a
Compare
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e8f2ebea7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return () => { | ||
| cancelled = true; | ||
| }; | ||
| }, [api, props.workspaceId, props.relativePath, refreshCounter]); | ||
| }, [api, workspaceId, relativePath, refreshCounter, draftRef, draftHistory, clearDraft]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid refetching on draft history updates
When a user edits a file, useDraftPersistence debounces draft persistence and updates draftHistory every ~300ms. Because draftHistory is in this effect’s dependency list, each draft persistence retriggers the file fetch (executeBash + diff), which then bumps contentVersion and reinitializes the editor state. That can cause unnecessary disk I/O and visible jank (selection/scroll resets) while typing. This only happens during active editing with draft persistence enabled, so it’s a runtime UX/perf regression. Consider removing draftHistory (and draftRef) from the fetch effect dependencies and rely on refs instead so edits don’t trigger refetches.
Useful? React with 👍 / 👎.
Replace the read-only TextFileViewer with a full CodeMirror 6 editor for text files.
Changes
--color-code-bg,--color-foreground,--color-line-number-*, etc.) for consistent light/dark themingLanguage support
JS/TS/JSX/TSX, HTML, CSS, JSON, Markdown, Python, Rust, Go, Java, SQL, XML, YAML, C/C++, PHP.
Not changed
Generated with
mux• Model:anthropic:claude-opus-4-5• Thinking:high• Cost:$10.74