diff --git a/frontend/editor/src/portal/components/policies/PolicySetupWizard.tsx b/frontend/editor/src/portal/components/policies/PolicySetupWizard.tsx index 9dada09290..9dce344b89 100644 --- a/frontend/editor/src/portal/components/policies/PolicySetupWizard.tsx +++ b/frontend/editor/src/portal/components/policies/PolicySetupWizard.tsx @@ -213,22 +213,11 @@ function PolicySetupWizardBody({ ); const sourcesAsync = useAsync(() => fetchSources(), []); - const availableSources = useMemo(() => { - const backendSources = (sourcesAsync.data?.sources ?? []).filter( - (s) => s.status !== "disabled", - ); - const editorSource = { - id: "editor", - name: t("portal.sources.types.editor.label"), - type: "editor", - status: "active" as const, - referenceCount: 0, - referencingPolicies: [], - config: [], - docsTotal: null, - }; - return [editorSource, ...backendSources]; - }, [sourcesAsync.data, t]); + const availableSources = useMemo( + () => + (sourcesAsync.data?.sources ?? []).filter((s) => s.status !== "disabled"), + [sourcesAsync.data], + ); // Document-type scoping has no UI; preserve any saved scope on edit and // default new policies to all document types. const [scopeTypes] = useState(policy?.state.scopeTypes ?? []); @@ -475,9 +464,8 @@ function PolicySetupWizardBody({ {t("portal.policies.wizard.sources.loading")}

) : ( - // The editor is always an available source (unconditionally prepended - // to availableSources), so the list is never empty — no "no sources" - // state exists. + // The backend always returns the editor as a virtual source, so the + // loaded list is never empty - no "no sources" state exists.
{availableSources.map((src) => ( // A selectable multi-line tile (icon + name + type + check).