| ... | ... | @@ -4293,10 +4293,21 @@ export default function ChatView(props: ChatViewProps) { |
| 4293 | 4293 | supportsPullRequests, |
| 4294 | 4294 | threadDetailLoading, |
| 4295 | 4295 | ]); |
| 4296 | const closePreviewPanel = useCallback(() => { |
| 4297 | if (activeThreadRef) { |
| 4298 | if (activeRightPanelSurface?.kind === "preview" && activeRightPanelSurface.resourceId) { |
| 4299 | usePreviewMiniPlayerStore |
| 4300 | .getState() |
| 4301 | .open(activeThreadRef, activeRightPanelSurface.resourceId); |
| 4302 | } |
| 4303 | setMaximizedRightPanelThreadKey(null); |
| 4304 | useRightPanelStore.getState().close(activeThreadRef); |
| 4305 | } |
| 4306 | }, [activeRightPanelSurface, activeThreadRef]); |
| 4296 | 4307 | const togglePreviewPanel = useCallback(() => { |
| 4297 | 4308 | if (!activeThreadRef || !isPreviewSupportedInRuntime()) return; |
| 4298 | 4309 | if (previewPanelOpen) { |
| 4299 | | useRightPanelStore.getState().close(activeThreadRef); |
| 4310 | closePreviewPanel(); |
| 4300 | 4311 | return; |
| 4301 | 4312 | } |
| 4302 | 4313 | const activeTabId = activePreviewState.activeTabId; |
| ... | ... | @@ -4305,13 +4316,13 @@ export default function ChatView(props: ChatViewProps) { |
| 4305 | 4316 | } else { |
| 4306 | 4317 | createBrowserSurface(); |
| 4307 | 4318 | } |
| 4308 | | }, [activePreviewState.activeTabId, activeThreadRef, createBrowserSurface, previewPanelOpen]); |
| 4309 | | const closePreviewPanel = useCallback(() => { |
| 4310 | | if (activeThreadRef) { |
| 4311 | | setMaximizedRightPanelThreadKey(null); |
| 4312 | | useRightPanelStore.getState().close(activeThreadRef); |
| 4313 | | } |
| 4314 | | }, [activeThreadRef]); |
| 4319 | }, [ |
| 4320 | activePreviewState.activeTabId, |
| 4321 | activeThreadRef, |
| 4322 | closePreviewPanel, |
| 4323 | createBrowserSurface, |
| 4324 | previewPanelOpen, |
| 4325 | ]); |
| 4315 | 4326 | const addTerminalSurface = useCallback(() => { |
| 4316 | 4327 | if (!activeThreadRef || !activeThreadId || !activeProject) return; |
| 4317 | 4328 | const cwd = gitCwd ?? activeProject.workspaceRoot; |