refactor: replace dev-proxy with preview-server, simplify proxy utils

This commit is contained in:
Chris Scott committed 2026-06-21 20:25:15 -04:00
1 parent 088b1d7b18
commit a214212b7b
24 files changed
+308 -1273

No files matched your search

@@ -1,5 +1,5 @@
import { useMutation } from '@tanstack/react-query'
import { getDevServerStatus, getDevPreviewUrl } from '@/api/devServer'
import { getDevServerStatus } from '@/api/devServer'
import { Button } from '@/components/ui/button'
import { showToast } from '@/lib/toast'
import { Loader2, Play } from 'lucide-react'
@@ -14,14 +14,14 @@ export function DevServerPreviewButton({ repoId, onOpen }: DevServerPreviewButto
const { mutate, isPending } = useMutation({
mutationFn: () => getDevServerStatus(repoId),
onSuccess: (state) => {
if (state.status !== 'running') {
if (state.status !== 'running' || !state.previewUrl) {
showToast.error(`No app detected on localhost:${state.port}`)
return
}
onOpen({
source: 'devserver',
previewUrl: getDevPreviewUrl(repoId),
previewUrl: state.previewUrl,
title: 'App preview',
})
},