@@ -14,14 +14,10 @@ import { EditCutoffBarrier } from "./Messages/ChatBarrier/EditCutoffBarrier";
1414import { StreamingBarrier } from "./Messages/ChatBarrier/StreamingBarrier" ;
1515import { RetryBarrier } from "./Messages/ChatBarrier/RetryBarrier" ;
1616import { PinnedTodoList } from "./PinnedTodoList" ;
17- import {
18- getAutoRetryKey ,
19- VIM_ENABLED_KEY ,
20- RIGHT_SIDEBAR_TAB_KEY ,
21- } from "@/common/constants/storage" ;
17+ import { getAutoRetryKey , VIM_ENABLED_KEY } from "@/common/constants/storage" ;
2218import { WORKSPACE_DEFAULTS } from "@/constants/workspaceDefaults" ;
2319import { ChatInput , type ChatInputAPI } from "./ChatInput/index" ;
24- import { RightSidebar , type TabType } from "./RightSidebar" ;
20+ import { RightSidebar } from "./RightSidebar" ;
2521import { useResizableSidebar } from "@/browser/hooks/useResizableSidebar" ;
2622import {
2723 shouldShowInterruptedBarrier ,
@@ -38,7 +34,7 @@ import { formatKeybind, KEYBINDS } from "@/browser/utils/ui/keybinds";
3834import { useAutoScroll } from "@/browser/hooks/useAutoScroll" ;
3935import { useOpenTerminal } from "@/browser/hooks/useOpenTerminal" ;
4036import { useOpenInEditor } from "@/browser/hooks/useOpenInEditor" ;
41- import { readPersistedState , usePersistedState } from "@/browser/hooks/usePersistedState" ;
37+ import { usePersistedState } from "@/browser/hooks/usePersistedState" ;
4238import { useThinking } from "@/browser/contexts/ThinkingContext" ;
4339import {
4440 useWorkspaceState ,
@@ -95,28 +91,17 @@ const AIViewInner: React.FC<AIViewProps> = ({
9591 const { api } = useAPI ( ) ;
9692 const chatAreaRef = useRef < HTMLDivElement > ( null ) ;
9793
98- // Track active tab to conditionally enable resize functionality
99- // Initialize from persisted value to avoid layout flash; RightSidebar owns the state
100- // and notifies us of changes via onTabChange callback
101- const [ activeTab , setActiveTab ] = useState < TabType > ( ( ) =>
102- readPersistedState < TabType > ( RIGHT_SIDEBAR_TAB_KEY , "costs" )
103- ) ;
104-
105- const isReviewTabActive = activeTab === "review" ;
106-
107- // Resizable sidebar for Review tab only
108- // Hook encapsulates all drag logic, persistence, and constraints
109- // Returns width to apply to RightSidebar and startResize for handle's onMouseDown
94+ // Resizable RightSidebar width (used for both Review + Costs to avoid tab-switch jank)
11095 const {
11196 width : sidebarWidth ,
11297 isResizing,
11398 startResize,
11499 } = useResizableSidebar ( {
115- enabled : isReviewTabActive , // Only active on Review tab
116- defaultWidth : 600 , // Initial width or fallback
117- minWidth : 300 , // Can't shrink smaller
118- maxWidth : 1200 , // Can't grow larger
119- storageKey : "review-sidebar-width" , // Persists across sessions
100+ enabled : true ,
101+ defaultWidth : 300 ,
102+ minWidth : 300 ,
103+ maxWidth : 1200 ,
104+ storageKey : "review-sidebar-width" ,
120105 } ) ;
121106
122107 const workspaceState = useWorkspaceState ( workspaceId ) ;
@@ -775,12 +760,11 @@ const AIViewInner: React.FC<AIViewProps> = ({
775760 workspaceId = { workspaceId }
776761 workspacePath = { namedWorkspacePath }
777762 chatAreaRef = { chatAreaRef }
778- onTabChange = { setActiveTab } // Notifies us when tab changes
779- width = { isReviewTabActive ? sidebarWidth : undefined } // Custom width only on Review tab
780- onStartResize = { isReviewTabActive ? startResize : undefined } // Pass resize handler when Review active
781- isResizing = { isResizing } // Pass resizing state
782- onReviewNote = { handleReviewNote } // Pass review note handler to append to chat
783- isCreating = { status === "creating" } // Workspace still being set up
763+ width = { sidebarWidth }
764+ onStartResize = { startResize }
765+ isResizing = { isResizing }
766+ onReviewNote = { handleReviewNote }
767+ isCreating = { status === "creating" }
784768 />
785769
786770 < PopoverError
0 commit comments