690414:1113 Update README.md /.agents/skills, /.windsurf/workflows

This commit is contained in:
2026-04-14 11:13:42 +07:00
parent 02400fd88c
commit 6d45bdaeb5
194 changed files with 12708 additions and 8762 deletions
@@ -0,0 +1,41 @@
'use client';
// ADR-021 T042: Error Boundary สำหรับ WorkflowLifecycle และ FilePreviewModal
// ป้องกัน crash ทั้งหน้าเมื่อเกิด unexpected error ใน Workflow components
// ต้องใช้ class component เพราะ React Error Boundary ยังไม่รองรับ hooks
import { Component, type ReactNode } from 'react';
interface Props {
children: ReactNode;
/** Custom fallback — ถ้าไม่ระบุจะแสดง default message */
fallback?: ReactNode;
}
interface State {
hasError: boolean;
}
export class WorkflowErrorBoundary extends Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = { hasError: false };
}
static getDerivedStateFromError(): State {
return { hasError: true };
}
render() {
if (this.state.hasError) {
return (
this.props.fallback ?? (
<div className="rounded-md bg-muted/50 p-4 text-center text-sm text-muted-foreground">
Workflow
</div>
)
);
}
return this.props.children;
}
}