@@ -23,7 +23,7 @@ type CloudViewProps = {
2323
2424export const CloudView = ( { userInfo, isAuthenticated, cloudApiUrl, onDone } : CloudViewProps ) => {
2525 const { t } = useAppTranslation ( )
26- const { remoteControlEnabled, setRemoteControlEnabled } = useExtensionState ( )
26+ const { remoteControlEnabled, setRemoteControlEnabled, taskSyncEnabled , setTaskSyncEnabled } = useExtensionState ( )
2727 const wasAuthenticatedRef = useRef ( false )
2828
2929 const rooLogoUri = ( window as any ) . IMAGES_BASE_URI + "/roo-logo.svg"
@@ -75,6 +75,17 @@ export const CloudView = ({ userInfo, isAuthenticated, cloudApiUrl, onDone }: Cl
7575 vscode . postMessage ( { type : "remoteControlEnabled" , bool : newValue } )
7676 }
7777
78+ const handleTaskSyncToggle = ( ) => {
79+ const newValue = ! taskSyncEnabled
80+ setTaskSyncEnabled ( newValue )
81+ vscode . postMessage ( { type : "taskSyncEnabled" , bool : newValue } )
82+ // If disabling task sync, also disable remote control
83+ if ( ! newValue && remoteControlEnabled ) {
84+ setRemoteControlEnabled ( false )
85+ vscode . postMessage ( { type : "remoteControlEnabled" , bool : false } )
86+ }
87+ }
88+
7889 return (
7990 < div className = "flex flex-col h-full" >
8091 < div className = "flex justify-between items-center mb-6" >
@@ -121,24 +132,56 @@ export const CloudView = ({ userInfo, isAuthenticated, cloudApiUrl, onDone }: Cl
121132 </ div >
122133 ) }
123134
124- { userInfo ?. extensionBridgeEnabled && (
125- < div className = "border-t border-vscode-widget-border pt-4 mt-4" >
126- < div className = "flex items-center gap-3 mb-2" >
127- < ToggleSwitch
128- checked = { remoteControlEnabled }
129- onChange = { handleRemoteControlToggle }
130- size = "medium"
131- aria-label = { t ( "cloud:remoteControl" ) }
132- data-testid = "remote-control-toggle"
133- />
134- < span className = "font-medium text-vscode-foreground" > { t ( "cloud:remoteControl" ) } </ span >
135- </ div >
136- < div className = "text-vscode-descriptionForeground text-sm mt-1 mb-4 ml-8" >
137- { t ( "cloud:remoteControlDescription" ) }
138- </ div >
139- < hr className = "border-vscode-widget-border mb-4" />
135+ { /* Task Sync Toggle - Always shown when authenticated */ }
136+ < div className = "border-t border-vscode-widget-border pt-4 mt-4" >
137+ < div className = "flex items-center gap-3 mb-2" >
138+ < ToggleSwitch
139+ checked = { taskSyncEnabled }
140+ onChange = { handleTaskSyncToggle }
141+ size = "medium"
142+ aria-label = { t ( "cloud:taskSync" ) }
143+ data-testid = "task-sync-toggle"
144+ />
145+ < span className = "font-medium text-vscode-foreground" > { t ( "cloud:taskSync" ) } </ span >
140146 </ div >
141- ) }
147+ < div className = "text-vscode-descriptionForeground text-sm mt-1 mb-4 ml-8" >
148+ { t ( "cloud:taskSyncDescription" ) }
149+ </ div >
150+
151+ { /* Remote Control Toggle - Only shown when extensionBridgeEnabled is true */ }
152+ { userInfo ?. extensionBridgeEnabled && (
153+ < >
154+ < div className = "flex items-center gap-3 mb-2" >
155+ < ToggleSwitch
156+ checked = { remoteControlEnabled }
157+ onChange = { handleRemoteControlToggle }
158+ size = "medium"
159+ aria-label = { t ( "cloud:remoteControl" ) }
160+ data-testid = "remote-control-toggle"
161+ disabled = { ! taskSyncEnabled }
162+ />
163+ < span className = "font-medium text-vscode-foreground" >
164+ { t ( "cloud:remoteControl" ) }
165+ </ span >
166+ </ div >
167+ < div className = "text-vscode-descriptionForeground text-sm mt-1 mb-4 ml-8" >
168+ { t ( "cloud:remoteControlDescription" ) }
169+ { ! taskSyncEnabled && (
170+ < div className = "text-vscode-errorForeground mt-2" >
171+ { t ( "cloud:remoteControlRequiresTaskSync" ) }
172+ </ div >
173+ ) }
174+ </ div >
175+ </ >
176+ ) }
177+
178+ { /* Info text about usage metrics */ }
179+ < div className = "text-vscode-descriptionForeground text-sm mt-4 mb-4 ml-8 italic" >
180+ { t ( "cloud:usageMetricsAlwaysReported" ) }
181+ </ div >
182+
183+ < hr className = "border-vscode-widget-border mb-4" />
184+ </ div >
142185
143186 < div className = "flex flex-col gap-2 mt-4" >
144187 < VSCodeButton appearance = "secondary" onClick = { handleVisitCloudWebsite } className = "w-full" >
0 commit comments