Clarify where Settings and Workflow Editor prompt editing responsibilities live. - Add explanatory Prompts settings copy and a Workflow Editor navigation affordance. - Thread the workflow settings opener into the Prompts section while keeping agent prompt tabs available. - Document prompt ownership and add regression coverage for the new Prompts section behavior. - Add a patch changeset for the published CLI package. Files changed: .changeset/fn-7098-prompts-workflow-alignment.md | 7 ++ docs/settings-reference.md | 11 +- .../dashboard/app/components/SettingsModal.tsx | 9 +- .../__tests__/SettingsModal.prompts.test.tsx | 118 +++++++++++++++++++++ .../settings/sections/PromptsSection.tsx | 23 +++- 5 files changed, 164 insertions(+), 4 deletions(-) Fusion-Task-Id: FN-7098 Fusion-Task-Lineage: 57ac1f1b-77f8-4180-abe9-f6752768b17b Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
60 lines
2.3 KiB
TypeScript
60 lines
2.3 KiB
TypeScript
/**
|
|
* Prompts section (U9 / KTD-10).
|
|
*
|
|
* Project-group section wrapping AgentPromptsManager. Presentational: it reads
|
|
* `agentPrompts`/`promptOverrides` off the modal form and relays edits back
|
|
* through `setForm`; the shell keeps persistence + save-split.
|
|
*/
|
|
import type { ReactNode } from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
import type { AgentPromptsConfig } from "@fusion/core";
|
|
import { AgentPromptsManager } from "../../AgentPromptsManager";
|
|
import { MovedSettingsStub } from "./MovedSettingsStub";
|
|
import type { SectionBaseProps } from "./context";
|
|
|
|
export interface PromptsSectionProps extends SectionBaseProps {
|
|
scopeBanner: ReactNode;
|
|
/**
|
|
* FNXC:Settings 2026-06-26-16:54:
|
|
* Settings Prompts and Workflow Editor prompts are distinct editing surfaces. Settings owns agent role templates plus PromptKey segment overrides, while this callback links users to per-workflow, per-node prompt/gate prompts in the Workflow Editor.
|
|
*/
|
|
onOpenWorkflowSettings?: () => void;
|
|
}
|
|
|
|
export function PromptsSection({ scopeBanner, form, setForm, onOpenWorkflowSettings }: PromptsSectionProps) {
|
|
const { t } = useTranslation("app");
|
|
return (
|
|
<>
|
|
{scopeBanner}
|
|
<h4 className="settings-section-heading">{t("settings.nav.prompts", "Prompts")}</h4>
|
|
<div className="form-group">
|
|
<small>
|
|
{t(
|
|
"settings.prompts.surfaceExplanation",
|
|
"Use this section for agent role system prompt templates, role assignments, and global PromptKey segment overrides. Per-workflow step prompts for prompt and gate nodes are edited in the Workflow Editor.",
|
|
)}
|
|
</small>
|
|
</div>
|
|
<MovedSettingsStub
|
|
message={t(
|
|
"settings.prompts.workflowPromptsRedirect",
|
|
"Per-workflow step prompts for prompt and gate nodes live in the Workflow Editor.",
|
|
)}
|
|
onOpenWorkflowSettings={onOpenWorkflowSettings}
|
|
/>
|
|
<AgentPromptsManager
|
|
value={form.agentPrompts}
|
|
onChange={(agentPrompts: AgentPromptsConfig) => {
|
|
setForm((f) => ({ ...f, agentPrompts }));
|
|
}}
|
|
promptOverrides={form.promptOverrides}
|
|
onPromptOverridesChange={(overrides) => {
|
|
setForm((f) => ({ ...f, promptOverrides: overrides }));
|
|
}}
|
|
/>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default PromptsSection;
|