Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Replace the read-only TextFileViewer with a full CodeMirror 6 editor for text files.

Changes

  • Editable + save: Full editing support with Cmd/Ctrl+S save keybind and save button in status bar
  • Inline diff: Git diff shown as line decorations—added lines highlighted green, removed lines rendered as inline widgets showing old line numbers and content
  • Theme integration: Uses CSS variables (--color-code-bg, --color-foreground, --color-line-number-*, etc.) for consistent light/dark theming
  • Dirty state handling: Shows "Unsaved" indicator, prompts on external file changes ("File changed on disk – Reload / Keep editing"), prevents auto-refresh when dirty
  • Save pipeline: Base64-encoded writes via executeBash for safe handling of all text content

Language support

JS/TS/JSX/TSX, HTML, CSS, JSON, Markdown, Python, Rust, Go, Java, SQL, XML, YAML, C/C++, PHP.

Not changed

  • ImageFileViewer remains unchanged
  • Error states (binary/too large) unchanged
  • Storybook stories work without modification

Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high • Cost: $10.74

@github-actions github-actions bot added the enhancement New feature or functionality label Jan 17, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Addressed the write script exit behavior so save failures surface properly.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Normalized line endings for dirty tracking and preserved CRLF on save.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Addressed the stale line-ending update by guarding before the ref update.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Lowered the file viewer size cap to avoid executeBash arg limits and stabilized draft persistence/refresh.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Addressed: removed ignore increments for executeBash and clear stale drafts on load.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Switched file-modifying tool handling to always surface the reload banner (no auto-refresh), which also avoids the debounce/dirty race.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

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.
@ammar-agent
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines 309 to +312
return () => {
cancelled = true;
};
}, [api, props.workspaceId, props.relativePath, refreshCounter]);
}, [api, workspaceId, relativePath, refreshCounter, draftRef, draftHistory, clearDraft]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant