@@ -196,6 +196,8 @@ export function openRevertConfirm(threadKey: string, pending: PendingRevert): vo
196196export function RevertConfirmHost ( props : {
197197 readonly threadKey : string ;
198198 readonly checkpoints : OrchestrationV2ThreadProjection [ "checkpoints" ] | undefined ;
199+ // The server refuses file restore outside a thread's own worktree.
200+ readonly isWorktree : boolean ;
199201 readonly onConfirm : ( turnCount : number , messageId : MessageId , restoreFiles : boolean ) => void ;
200202} ) {
201203 const pending = useThreadOverlay ( revertConfirmAtom , props . threadKey ) ;
@@ -218,19 +220,23 @@ export function RevertConfirmHost(props: {
218220 < AlertDialogHeader >
219221 < AlertDialogTitle > Edit from here?</ AlertDialogTitle >
220222 < AlertDialogDescription >
221- Rewind chat to before this message. Your prompt and attachments return to the composer.
222- “Revert files too” also undoes your own edits.
223+ Rewind chat to before this message. Your prompt and attachments return to the composer.{ " " }
224+ { props . isWorktree
225+ ? "“Revert files too” also undoes your own edits."
226+ : "Files stay as they are because this thread shares the project directory." }
223227 </ AlertDialogDescription >
224228 </ AlertDialogHeader >
225229 < AlertDialogFooter >
226230 < AlertDialogClose render = { < Button variant = "outline" /> } > Cancel</ AlertDialogClose >
227- < Button
228- variant = "destructive-outline"
229- disabled = { ! canRestoreFiles }
230- onClick = { ( ) => confirm ( true ) }
231- >
232- Revert files too
233- </ Button >
231+ { props . isWorktree ? (
232+ < Button
233+ variant = "destructive-outline"
234+ disabled = { ! canRestoreFiles }
235+ onClick = { ( ) => confirm ( true ) }
236+ >
237+ Revert files too
238+ </ Button >
239+ ) : null }
234240 < Button onClick = { ( ) => confirm ( false ) } > Revert and keep changes</ Button >
235241 </ AlertDialogFooter >
236242 </ AlertDialogPopup >
0 commit comments