@@ -44,6 +44,7 @@ import {
4444 sortProjectsForSidebar ,
4545 sortScopedProjectsForSidebar ,
4646 shouldCreateNewThreadInCurrentProject ,
47+ shouldNavigateAfterThreadPark ,
4748 THREAD_JUMP_HINT_SHOW_DELAY_MS ,
4849 type SidebarListItem ,
4950 type SidebarListMarker ,
@@ -2500,3 +2501,44 @@ describe("resolveSidebarDropVerb", () => {
25002501 expect ( resolveSidebarDropVerb ( "active" , "snoozed" ) ) . toBeNull ( ) ;
25012502 } ) ;
25022503} ) ;
2504+
2505+ describe ( "navigation after parking a thread" , ( ) => {
2506+ it . each ( [
2507+ [ "settle" , "settled" , null , "thread" , true ] ,
2508+ [ "settle" , "active" , null , "thread" , false ] ,
2509+ [ "settle" , "settled" , null , "other-thread" , false ] ,
2510+ [ "snooze" , null , "2099-01-01T00:00:00.000Z" , "thread" , true ] ,
2511+ [ "snooze" , null , null , "thread" , false ] ,
2512+ [ "snooze" , null , "2026-09-12T09:00:00.000Z" , "thread" , false ] ,
2513+ [ "snooze" , null , "2099-01-01T00:00:00.000Z" , "thread" , false , true ] ,
2514+ [ "snooze" , null , "2099-01-01T00:00:00.000Z" , "other-thread" , false ] ,
2515+ ] as const ) (
2516+ "%s with state %s / %s on %s navigates: %s" ,
2517+ (
2518+ action ,
2519+ settledOverride ,
2520+ snoozedUntil ,
2521+ currentThreadKey ,
2522+ expected ,
2523+ hasPendingApprovals : boolean = false ,
2524+ ) => {
2525+ expect (
2526+ shouldNavigateAfterThreadPark ( {
2527+ threadKey : "thread" ,
2528+ currentThreadKey,
2529+ action,
2530+ now : "2026-09-12T10:00:00.000Z" ,
2531+ thread : {
2532+ settledOverride,
2533+ snoozedUntil,
2534+ snoozedAt : null ,
2535+ session : null ,
2536+ latestTurn : null ,
2537+ hasPendingApprovals,
2538+ hasPendingUserInput : false ,
2539+ } ,
2540+ } ) ,
2541+ ) . toBe ( expected ) ;
2542+ } ,
2543+ ) ;
2544+ } ) ;
0 commit comments