Draft
Conversation
Capture and compare editor snapshots before and after AI edits to list raw document changes for improved AI editing feedback.
Show visual blocks marking AI-generated changes in the editor with a sidebar indicator. Includes extension plugin, styling, and editor integration to display real-time diff markers.
Show visual "Deleted" dividers in the editor for block deletions detected in AI edit diffs, enhancing clarity of removed content alongside additions and modifications. Adjust styling and logic to support deletion anchors.
Implement block and inline decorations for AI edit diffs in the editor, including hover effects and deleted text widgets. Add DiffMenu component for rejecting changes. Refactor diff logic to use AiDiffSession for improved tracking and rendering.
Render deleted word widgets differently inside code-like blocks and limit their length for better readability in AI diff indicators.
Split DiffIndicator logic into dedicated modules: extension, decorations, layout, types, and a useDiffIndicatorState hook. Re-export AiDiffIndicatorExtension and plugin keys and move decoration/layout logic out of the main component for better separation of concerns.
|
Important Review skippedDraft detected. 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). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
This PR is still a work in progress. I am currently investigating bugs related to switching notes, toggling raw Markdown mode, and performing multiple consecutive edits. The UI is not finalized and will be refined after the core functionality is stable.
Description
This pull request introduces a visual AI diff indicator system for the editor, enabling users to view and interact with AI-generated changes, including additions, modifications, and deletions. It adds new UI components, editor integrations, and styling to support diff visualization and block-level rejection of changes.
The implementation depends on the newly added
prosemirror-changesetpackage and is being integrated carefully into the existing editing workflow.Why
The goal is to solve the diff and partial restoration features suggested in #37
AI Diff Visualization and Interaction
DiffIndicatorandDiffMenuReact components to visually represent and interact with AI-generated diffs in the editor. This includes block-level markers, deletion dividers, and contextual menus for rejecting changes.AiDiffIndicatorExtensionand diff session state into the editor, with support for updating and rejecting individual diff blocks, as well as ensuring state resets when switching notes.Editor and App Integration
Preview
diff-demo.mp4