feat: Validierungs-Panel mit Details und Click-to-Jump
Issue #1 + #3: Validierung zeigt keine Details / Fehler-Lokalisierung NEU: ValidationPanel Component - Zeigt alle Fehler und Warnungen mit vollständigen Details - Gruppiert nach Severity (Fehler/Warnungen) - Aufklappbar pro Gruppe (collapsible) - Click-to-Jump: Fehler mit nodeId sind klickbar - Klick selektiert betroffene Node → Config-Panel öffnet sich - Schließbar, öffnet sich automatisch bei neuen Fehler/Warnungen Features: - Fixed position (bottom-right, über Canvas) - Farb-Kodierung: Rot (Errors) / Gelb (Warnings) - Hover-Effekt auf klickbare Items - Type-Labels (structure, isolation, etc.) - Scrollbar bei vielen Fehler/Warnungen - X-Button zum Schließen UX-Verbesserungen: - Kein Raten mehr: Zeigt WAS der Fehler ist - Kein Suchen mehr: Klick springt direkt zur Node - Übersichtlich auch bei vielen Fehler/Warnungen - Funktioniert in großen Workflows Technisch: - handleValidationNodeClick: setSelectedNodeId - Auto-show bei errors.length > 0 || warnings.length > 0 - State: showValidationPanel (closable) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
3fa01dd686
commit
549c31431e
2 files changed
+272
No files matched your search
@@ -19,6 +19,7 @@ import { PlaceholderPicker } from '../components/workflow/panels/PlaceholderPick
|
||||
import { WorkflowExecutePanel } from '../components/workflow/panels/WorkflowExecutePanel'
|
||||
import { WorkflowResultViewer } from '../components/workflow/panels/WorkflowResultViewer'
|
||||
import { InlineTemplateEditor } from '../components/workflow/panels/InlineTemplateEditor'
|
||||
import { ValidationPanel } from '../components/workflow/panels/ValidationPanel'
|
||||
import { Toast } from '../components/Toast'
|
||||
import { ConfirmDialog } from '../components/ConfirmDialog'
|
||||
import '../styles/workflowEditor.css'
|
||||
@@ -78,6 +79,7 @@ export default function WorkflowEditorPage() {
|
||||
const endNodeTextareaRef = useRef(null)
|
||||
const inlineTemplateTextareaRef = useRef(null)
|
||||
const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false)
|
||||
const [showValidationPanel, setShowValidationPanel] = useState(true)
|
||||
|
||||
// Toast & Confirm Dialog
|
||||
const [toast, setToast] = useState(null)
|
||||
@@ -122,6 +124,11 @@ export default function WorkflowEditorPage() {
|
||||
const { errors, warnings } = validateWorkflowGraph(nodes, edges)
|
||||
setValidationErrors(errors)
|
||||
setValidationWarnings(warnings)
|
||||
|
||||
// Re-show validation panel if there are new errors/warnings
|
||||
if (errors.length > 0 || warnings.length > 0) {
|
||||
setShowValidationPanel(true)
|
||||
}
|
||||
}, [nodes, edges])
|
||||
|
||||
// Warn on browser back/refresh if unsaved changes
|
||||
@@ -380,6 +387,15 @@ export default function WorkflowEditorPage() {
|
||||
navigate('/admin/prompts')
|
||||
}
|
||||
|
||||
const handleValidationNodeClick = (nodeId) => {
|
||||
// Select the node to show its config panel
|
||||
setSelectedNodeId(nodeId)
|
||||
|
||||
// TODO: Optional - scroll to node in canvas
|
||||
// ReactFlow doesn't expose a direct scrollTo API, but we could use fitView
|
||||
// or manual DOM manipulation if needed
|
||||
}
|
||||
|
||||
const handlePlaceholderSelect = (placeholderString) => {
|
||||
if (!selectedNode) return
|
||||
|
||||
@@ -870,6 +886,16 @@ export default function WorkflowEditorPage() {
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Validation Panel */}
|
||||
{showValidationPanel && (validationErrors.length > 0 || validationWarnings.length > 0) && (
|
||||
<ValidationPanel
|
||||
errors={validationErrors}
|
||||
warnings={validationWarnings}
|
||||
onNodeClick={handleValidationNodeClick}
|
||||
onClose={() => setShowValidationPanel(false)}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Toast Notification */}
|
||||
{toast && (
|
||||
<Toast
|
||||
|
||||
Reference in new issue
Block a user