feat: Add code suggestions, inline editing, and refactor DiffViewer#198
Conversation
569e3c9 to
0a743c2
Compare
- GitHub-style suggestion blocks with syntax-highlighted diff view - Inline annotation editing via toolbar (edit button on inline comments) - Expandable two-pane code modal for writing suggestions - Inline markdown rendering (bold, italic, code) in review comments - Original code extraction from unified diff patches - Decompose DiffViewer (615→200 lines) into focused components: FileHeader, InlineAnnotation, SuggestionBlock, SuggestionDiff, SuggestionModal, AnnotationToolbar, HighlightedCode - Extract hooks: useAnnotationToolbar, useTabIndent - Extract utils: detectLanguage, formatLineRange, patchParser, renderInlineMarkdown - Fix suggestedCode trim stripping meaningful indentation - Fix stale closure in useTabIndent consumers
0a743c2 to
8a6e9a6
Compare
|
Excited for this, taking a look soon |
Code reviewFound 2 issues:
plannotator/packages/review-editor/App.tsx Lines 285 to 295 in 8a6e9a6 Callsite that passes plannotator/packages/review-editor/hooks/useAnnotationToolbar.ts Lines 140 to 147 in 8a6e9a6
plannotator/packages/review-editor/components/AnnotationToolbar.tsx Lines 74 to 82 in 8a6e9a6 Existing guard in plan-editor for reference: plannotator/packages/ui/components/AnnotationToolbar.tsx Lines 141 to 143 in 8a6e9a6 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
|
^ AI generated that. I am reviewing |
backnotprop
left a comment
There was a problem hiding this comment.
@flex-yj-kim Two suggested fixes below — one bug where editing an annotation silently wipes sibling fields, and one missing IME guard that the plan-editor already has.
|
I can address these soon today as well, plan to release later tonight |
- Conditionally spread only defined fields in handleEditAnnotation to prevent undefined values from wiping sibling fields - Add !e.nativeEvent.isComposing guard to Cmd/Ctrl+Enter handlers in comment and suggested-code textareas for CJK input support
|
Thanks for the review! I've been using your plannotator heavily in my daily workflow and it's been exactly what I needed for developing with Claude. Thank you for building such a great tool, and for taking the time to look at this PR. |
|
@flex-yj-kim Great work! Do you have socials? I can tag you in next release |




Summary
bold,italic,`code`) in review commentsChanges
New Components
AnnotationToolbar— Floating comment input form with suggested code supportSuggestionBlock/SuggestionDiff— Suggestion display with git-style inline diffSuggestionModal— Two-pane code editor modal (original + suggestion side-by-side)InlineAnnotation— Annotation comment rendered inside the diff viewFileHeader— Sticky file header with stats and viewed toggleHighlightedCode— Shared highlight.js code elementNew Hooks & Utils
useAnnotationToolbar— Toolbar state, form, edit mode, submission logicuseTabIndent— Tab-key indentation for code textareaspatchParser— Extract original lines from unified diff patchesdetectLanguage/formatLineRange/renderInlineMarkdownBug Fixes
suggestedCode.trim()stripping meaningful indentation on submituseTabIndentconsumersNote
UI styling is based on my own judgment to keep things consistent. If there are preferred styles or design conventions, happy to adjust — feedback is very welcome.