@@ -615,6 +615,7 @@ export default function ChatView(props: ChatViewProps) {
615615 ( store ) => store . setStickyModelSelection ,
616616 ) ;
617617 const timestampFormat = settings . timestampFormat ;
618+ const autoOpenPlanSidebar = settings . autoOpenPlanSidebar ;
618619 const navigate = useNavigate ( ) ;
619620 const rawSearch = useSearch ( {
620621 strict : false ,
@@ -2009,6 +2010,7 @@ export default function ChatView(props: ChatViewProps) {
20092010 planSidebarOpenOnNextThreadRef . current = false ;
20102011 setPlanSidebarOpen ( true ) ;
20112012 } else {
2013+ planSidebarOpenOnNextThreadRef . current = false ;
20122014 setPlanSidebarOpen ( false ) ;
20132015 }
20142016 planSidebarDismissedForTurnRef . current = null ;
@@ -2017,14 +2019,21 @@ export default function ChatView(props: ChatViewProps) {
20172019 // Auto-open the plan sidebar when plan/todo steps arrive for the current turn.
20182020 // Don't auto-open for plans carried over from a previous turn (the user can open manually).
20192021 useEffect ( ( ) => {
2022+ if ( ! autoOpenPlanSidebar ) return ;
20202023 if ( ! activePlan ) return ;
20212024 if ( planSidebarOpen ) return ;
20222025 const latestTurnId = activeLatestTurn ?. turnId ?? null ;
20232026 if ( latestTurnId && activePlan . turnId !== latestTurnId ) return ;
20242027 const turnKey = activePlan . turnId ?? sidebarProposedPlan ?. turnId ?? "__dismissed__" ;
20252028 if ( planSidebarDismissedForTurnRef . current === turnKey ) return ;
20262029 setPlanSidebarOpen ( true ) ;
2027- } , [ activePlan , activeLatestTurn ?. turnId , planSidebarOpen , sidebarProposedPlan ?. turnId ] ) ;
2030+ } , [
2031+ activePlan ,
2032+ activeLatestTurn ?. turnId ,
2033+ autoOpenPlanSidebar ,
2034+ planSidebarOpen ,
2035+ sidebarProposedPlan ?. turnId ,
2036+ ] ) ;
20282037
20292038 useEffect ( ( ) => {
20302039 setIsRevertingCheckpoint ( false ) ;
@@ -2949,7 +2958,7 @@ export default function ChatView(props: ChatViewProps) {
29492958 // Optimistically open the plan sidebar when implementing (not refining).
29502959 // "default" mode here means the agent is executing the plan, which produces
29512960 // step-tracking activities that the sidebar will display.
2952- if ( nextInteractionMode === "default" ) {
2961+ if ( nextInteractionMode === "default" && autoOpenPlanSidebar ) {
29532962 planSidebarDismissedForTurnRef . current = null ;
29542963 setPlanSidebarOpen ( true ) ;
29552964 }
@@ -2978,6 +2987,7 @@ export default function ChatView(props: ChatViewProps) {
29782987 runtimeMode ,
29792988 setComposerDraftInteractionMode ,
29802989 setThreadError ,
2990+ autoOpenPlanSidebar ,
29812991 environmentId ,
29822992 ] ,
29832993 ) ;
@@ -3070,8 +3080,8 @@ export default function ChatView(props: ChatViewProps) {
30703080 return waitForStartedServerThread ( scopeThreadRef ( activeThread . environmentId , nextThreadId ) ) ;
30713081 } )
30723082 . then ( ( ) => {
3073- // Signal that the plan sidebar should open on the new thread.
3074- planSidebarOpenOnNextThreadRef . current = true ;
3083+ // Signal that the plan sidebar should open on the new thread when enabled .
3084+ planSidebarOpenOnNextThreadRef . current = autoOpenPlanSidebar ;
30753085 return navigate ( {
30763086 to : "/$environmentId/$threadId" ,
30773087 params : {
@@ -3112,6 +3122,7 @@ export default function ChatView(props: ChatViewProps) {
31123122 navigate ,
31133123 resetLocalDispatch ,
31143124 runtimeMode ,
3125+ autoOpenPlanSidebar ,
31153126 environmentId ,
31163127 ] ) ;
31173128
0 commit comments