feat: Script Generator Phase 1 — backend models, engine, API, and AD templates #105

Merged
chihlasm merged 78 commits from feat/script-generator into main 2026-03-15 00:19:00 +00:00
Showing only changes of commit 1e035ac375 - Show all commits

View File

@@ -1,5 +1,5 @@
import * as Sentry from '@sentry/react' import * as Sentry from '@sentry/react'
import { type ReactNode } from 'react' import { type ReactNode, useEffect, useRef } from 'react'
import { Button } from '@/components/ui/Button' import { Button } from '@/components/ui/Button'
interface FallbackProps { interface FallbackProps {
@@ -18,17 +18,20 @@ function isChunkLoadError(error: Error): boolean {
} }
function DefaultFallback({ error, resetError }: FallbackProps) { function DefaultFallback({ error, resetError }: FallbackProps) {
const reloadingRef = useRef(false)
// Auto-reload on stale chunk errors (happens after deployments) // Auto-reload on stale chunk errors (happens after deployments)
if (isChunkLoadError(error)) { useEffect(() => {
if (!isChunkLoadError(error)) return
const key = 'rf_boundary_chunk_reload' const key = 'rf_boundary_chunk_reload'
const lastReload = sessionStorage.getItem(key) const lastReload = sessionStorage.getItem(key)
const now = Date.now() const now = Date.now()
if (!lastReload || now - Number(lastReload) > 10_000) { if (!lastReload || now - Number(lastReload) > 10_000) {
sessionStorage.setItem(key, String(now)) sessionStorage.setItem(key, String(now))
reloadingRef.current = true
window.location.reload() window.location.reload()
return null
} }
} }, [error])
return ( return (
<div className="flex min-h-[400px] flex-col items-center justify-center p-8"> <div className="flex min-h-[400px] flex-col items-center justify-center p-8">