feat(knowledge-base): add fine-grained embedding model validation with inline warnings

Extract validation logic from default.ts into shared utils.ts, enabling
node card, panel, and checklist to share the same validation rules.
Introduce provider-scoped model list queries to detect non-active model
states (noConfigure, quotaExceeded, credentialRemoved, incompatible).
Expand node card from 2 rows to 4 rows with per-row warning indicators,
and add warningDot support to panel field titles.
This commit is contained in:
yyh
2026-03-10 17:25:27 +08:00
parent 369e4eb7b0
commit 0b2ded3227
14 changed files with 710 additions and 167 deletions

View File

@ -65,6 +65,7 @@ import type { Shape as HooksStoreShape } from '../hooks-store/store'
import type { Shape } from '../store/workflow'
import type { Edge, Node, WorkflowRunningData } from '../types'
import type { WorkflowHistoryStoreApi } from '../workflow-history-store'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { render, renderHook } from '@testing-library/react'
import isDeepEqual from 'fast-deep-equal'
import * as React from 'react'
@ -154,6 +155,13 @@ function createWorkflowWrapper(
const historyCtxValue = historyConfig
? createTestHistoryStoreContext(historyConfig)
: undefined
const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: false,
},
},
})
return ({ children }: { children: React.ReactNode }) => {
let inner: React.ReactNode = children
@ -175,9 +183,13 @@ function createWorkflowWrapper(
}
return React.createElement(
WorkflowContext.Provider,
{ value: stores.store },
inner,
QueryClientProvider,
{ client: queryClient },
React.createElement(
WorkflowContext.Provider,
{ value: stores.store },
inner,
),
)
}
}