@@ -3,6 +3,7 @@ import { parseMarkdownToBlocks, exportDiff } from '@plannotator/ui/utils/parser'
33import { Viewer , ViewerHandle } from '@plannotator/ui/components/Viewer' ;
44import { AnnotationPanel } from '@plannotator/ui/components/AnnotationPanel' ;
55import { ExportModal } from '@plannotator/ui/components/ExportModal' ;
6+ import { ConfirmDialog } from '@plannotator/ui/components/ConfirmDialog' ;
67import { Annotation , Block , EditorMode } from '@plannotator/ui/types' ;
78import { ThemeProvider } from '@plannotator/ui/components/ThemeProvider' ;
89import { ModeToggle } from '@plannotator/ui/components/ModeToggle' ;
@@ -300,6 +301,7 @@ const App: React.FC = () => {
300301 const [ blocks , setBlocks ] = useState < Block [ ] > ( [ ] ) ;
301302 const [ showExport , setShowExport ] = useState ( false ) ;
302303 const [ showFeedbackPrompt , setShowFeedbackPrompt ] = useState ( false ) ;
304+ const [ showClaudeCodeWarning , setShowClaudeCodeWarning ] = useState ( false ) ;
303305 const [ isPanelOpen , setIsPanelOpen ] = useState ( true ) ;
304306 const [ editorMode , setEditorMode ] = useState < EditorMode > ( 'selection' ) ;
305307 const [ taterMode , setTaterMode ] = useState ( ( ) => {
@@ -446,7 +448,7 @@ const App: React.FC = () => {
446448 const bearSettings = getBearSettings ( ) ;
447449
448450 // Build request body - include integrations if enabled
449- const body : { obsidian ?: object ; bear ?: object } = { } ;
451+ const body : { obsidian ?: object ; bear ?: object ; feedback ?: string } = { } ;
450452
451453 if ( obsidianSettings . enabled && obsidianSettings . vaultPath ) {
452454 body . obsidian = {
@@ -460,6 +462,11 @@ const App: React.FC = () => {
460462 body . bear = { plan : markdown } ;
461463 }
462464
465+ // Include annotations as feedback if any exist (for OpenCode "approve with notes")
466+ if ( annotations . length > 0 || globalAttachments . length > 0 ) {
467+ body . feedback = diffOutput ;
468+ }
469+
463470 await fetch ( '/api/approve' , {
464471 method : 'POST' ,
465472 headers : { 'Content-Type' : 'application/json' } ,
@@ -575,7 +582,14 @@ const App: React.FC = () => {
575582
576583 < div className = "relative group/approve" >
577584 < button
578- onClick = { handleApprove }
585+ onClick = { ( ) => {
586+ // Show warning for Claude Code users with annotations
587+ if ( origin === 'claude-code' && annotations . length > 0 ) {
588+ setShowClaudeCodeWarning ( true ) ;
589+ } else {
590+ handleApprove ( ) ;
591+ }
592+ } }
579593 disabled = { isSubmitting }
580594 className = { `px-2 py-1 md:px-2.5 rounded-md text-xs font-medium transition-all ${
581595 isSubmitting
@@ -681,31 +695,40 @@ const App: React.FC = () => {
681695 />
682696
683697 { /* Feedback prompt dialog */ }
684- { showFeedbackPrompt && (
685- < div className = "fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm p-4" >
686- < div className = "bg-card border border-border rounded-xl w-full max-w-sm shadow-2xl p-6" >
687- < div className = "flex items-center gap-3 mb-4" >
688- < div className = "w-10 h-10 rounded-full bg-accent/20 flex items-center justify-center" >
689- < svg className = "w-5 h-5 text-accent" fill = "none" viewBox = "0 0 24 24" stroke = "currentColor" strokeWidth = { 2 } >
690- < path strokeLinecap = "round" strokeLinejoin = "round" d = "M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z" />
691- </ svg >
692- </ div >
693- < h3 className = "font-semibold" > Add Annotations First</ h3 >
694- </ div >
695- < p className = "text-sm text-muted-foreground mb-6" >
696- To provide feedback, select text in the plan and add annotations. Claude will use your annotations to revise the plan.
697- </ p >
698- < div className = "flex justify-end" >
699- < button
700- onClick = { ( ) => setShowFeedbackPrompt ( false ) }
701- className = "px-4 py-2 rounded-md text-sm font-medium bg-primary text-primary-foreground hover:opacity-90 transition-opacity"
702- >
703- Got it
704- </ button >
705- </ div >
706- </ div >
707- </ div >
708- ) }
698+ < ConfirmDialog
699+ isOpen = { showFeedbackPrompt }
700+ onClose = { ( ) => setShowFeedbackPrompt ( false ) }
701+ title = "Add Annotations First"
702+ message = "To provide feedback, select text in the plan and add annotations. Claude will use your annotations to revise the plan."
703+ variant = "info"
704+ />
705+
706+ { /* Claude Code annotation warning dialog */ }
707+ < ConfirmDialog
708+ isOpen = { showClaudeCodeWarning }
709+ onClose = { ( ) => setShowClaudeCodeWarning ( false ) }
710+ onConfirm = { ( ) => {
711+ setShowClaudeCodeWarning ( false ) ;
712+ handleApprove ( ) ;
713+ } }
714+ title = "Annotations Won't Be Sent"
715+ message = { < > Claude Code doesn't yet support feedback on approval. Your { annotations . length } annotation{ annotations . length !== 1 ? 's' : '' } will be lost.</ > }
716+ subMessage = {
717+ < >
718+ To send feedback, use < strong > Deny with Feedback</ strong > instead.
719+ < br /> < br />
720+ Want this feature? Upvote these issues:
721+ < br />
722+ < a href = "https://github.com/anthropics/claude-code/issues/16001" target = "_blank" rel = "noopener noreferrer" className = "text-primary hover:underline" > #16001</ a >
723+ { ' · ' }
724+ < a href = "https://github.com/anthropics/claude-code/issues/15755" target = "_blank" rel = "noopener noreferrer" className = "text-primary hover:underline" > #15755</ a >
725+ </ >
726+ }
727+ confirmText = "Approve Anyway"
728+ cancelText = "Cancel"
729+ variant = "warning"
730+ showCancel
731+ />
709732
710733 { /* Completion overlay - shown after approve/deny */ }
711734 { submitted && (
0 commit comments