feat: KB Accelerator — convert KB articles into interactive flows #104

Merged
chihlasm merged 20 commits from feat/kb-accelerator into main 2026-03-12 21:29:08 +00:00
Showing only changes of commit c920e825c6 - Show all commits

View File

@@ -7,7 +7,29 @@ interface FallbackProps {
resetError: () => void
}
function isChunkLoadError(error: Error): boolean {
const msg = error.message || ''
return (
msg.includes('dynamically imported module') ||
msg.includes('Loading chunk') ||
msg.includes('Failed to fetch') ||
error.name === 'ChunkLoadError'
)
}
function DefaultFallback({ error, resetError }: FallbackProps) {
// Auto-reload on stale chunk errors (happens after deployments)
if (isChunkLoadError(error)) {
const key = 'rf_boundary_chunk_reload'
const lastReload = sessionStorage.getItem(key)
const now = Date.now()
if (!lastReload || now - Number(lastReload) > 10_000) {
sessionStorage.setItem(key, String(now))
window.location.reload()
return null
}
}
return (
<div className="flex min-h-[400px] flex-col items-center justify-center p-8">
<div className="max-w-md text-center">