@@ -578,6 +578,47 @@ describe("live UI integration", () => {
578578 }
579579 } ) ;
580580
581+ test ( "clicked add-note drafts can cancel and save with keyboard shortcuts" , async ( ) => {
582+ const fixture = harness . createLongWrapFilePair ( ) ;
583+ const session = await harness . launchHunk ( {
584+ args : [ "diff" , fixture . before , fixture . after , "--mode" , "split" ] ,
585+ cols : 120 ,
586+ rows : 20 ,
587+ } ) ;
588+
589+ try {
590+ await session . waitForText ( / V i e w \s + N a v i g a t e \s + T h e m e \s + A g e n t \s + H e l p / , {
591+ timeout : 15_000 ,
592+ } ) ;
593+
594+ await moveMouse ( session , 8 , 5 ) ;
595+ await session . waitForText ( / \[ \+ \] / , { timeout : 5_000 } ) ;
596+ await session . click ( / \[ \+ \] / ) ;
597+ await session . waitForText ( / D r a f t n o t e / , { timeout : 5_000 } ) ;
598+ await session . type ( "Cancel this shortcut draft." ) ;
599+ await session . press ( "escape" ) ;
600+ const cancelled = await harness . waitForSnapshot (
601+ session ,
602+ ( text ) => ! text . includes ( "Draft note" ) && ! text . includes ( "Cancel this shortcut draft." ) ,
603+ 5_000 ,
604+ ) ;
605+
606+ expect ( cancelled ) . not . toContain ( "Your note" ) ;
607+
608+ await moveMouse ( session , 8 , 5 ) ;
609+ await session . waitForText ( / \[ \+ \] / , { timeout : 5_000 } ) ;
610+ await session . click ( / \[ \+ \] / ) ;
611+ await session . waitForText ( / D r a f t n o t e / , { timeout : 5_000 } ) ;
612+ await session . type ( "Save this shortcut draft." ) ;
613+ await session . press ( [ "ctrl" , "s" ] ) ;
614+ const saved = await session . waitForText ( / Y o u r n o t e / , { timeout : 5_000 } ) ;
615+
616+ expect ( saved ) . toContain ( "Save this shortcut draft." ) ;
617+ } finally {
618+ session . close ( ) ;
619+ }
620+ } ) ;
621+
581622 test ( "clicking diff add-note affordances can cancel and save draft notes" , async ( ) => {
582623 const fixture = harness . createLongWrapFilePair ( ) ;
583624 const session = await harness . launchHunk ( {
0 commit comments