@@ -238,7 +238,7 @@ describe('EditorInputManager - single-thread comment highlight clicks', () => {
238238 expect ( viewportHost . setPointerCapture ) . toHaveBeenCalled ( ) ;
239239 } ) ;
240240
241- it ( 'activates a tracked-change decoration when it owns the clicked visual surface ' , ( ) => {
241+ it ( 'lets direct clicks on a tracked-change decoration fall through to generic caret placement ' , ( ) => {
242242 mockEditor . state . comments$ . activeThreadId = 'comment-2' ;
243243
244244 const trackedChange = document . createElement ( 'span' ) ;
@@ -248,12 +248,32 @@ describe('EditorInputManager - single-thread comment highlight clicks', () => {
248248
249249 dispatchPointerDown ( trackedChange ) ;
250250
251- expect ( mockEditor . commands . setCursorById ) . toHaveBeenCalledWith ( 'change-1' , {
252- activeCommentId : 'change-1' ,
253- } ) ;
254- expect ( resolvePointerPositionHit ) . not . toHaveBeenCalled ( ) ;
255- expect ( mockEditor . state . tr . setSelection ) . not . toHaveBeenCalled ( ) ;
256- expect ( viewportHost . setPointerCapture ) . not . toHaveBeenCalled ( ) ;
251+ expect ( mockEditor . commands . setCursorById ) . not . toHaveBeenCalled ( ) ;
252+ expect ( resolvePointerPositionHit ) . toHaveBeenCalled ( ) ;
253+ expect ( TextSelection . create as unknown as Mock ) . toHaveBeenCalled ( ) ;
254+ expect ( mockEditor . state . tr . setSelection ) . toHaveBeenCalled ( ) ;
255+ expect ( viewportHost . setPointerCapture ) . toHaveBeenCalled ( ) ;
256+ } ) ;
257+
258+ it ( 'lets repeat direct clicks on the active tracked-change decoration reposition caret' , ( ) => {
259+ mockEditor . state . comments$ . activeThreadId = 'change-1' ;
260+
261+ const trackedChange = document . createElement ( 'span' ) ;
262+ trackedChange . className = 'track-delete-dec highlighted' ;
263+ trackedChange . setAttribute ( 'data-track-change-id' , 'change-1' ) ;
264+ viewportHost . appendChild ( trackedChange ) ;
265+
266+ dispatchPointerDown ( trackedChange ) ;
267+
268+ expect ( mockEditor . emit ) . not . toHaveBeenCalledWith (
269+ 'commentsUpdate' ,
270+ expect . objectContaining ( { activeCommentId : 'change-1' } ) ,
271+ ) ;
272+ expect ( mockEditor . commands . setCursorById ) . not . toHaveBeenCalled ( ) ;
273+ expect ( resolvePointerPositionHit ) . toHaveBeenCalled ( ) ;
274+ expect ( TextSelection . create as unknown as Mock ) . toHaveBeenCalled ( ) ;
275+ expect ( mockEditor . state . tr . setSelection ) . toHaveBeenCalled ( ) ;
276+ expect ( viewportHost . setPointerCapture ) . toHaveBeenCalled ( ) ;
257277 } ) ;
258278
259279 it ( 'activates a nearby single-thread highlight when a split-run gap receives the pointer event' , ( ) => {
0 commit comments