FN-7041: fix optional workflow step descriptions
Fix the workflow results settings display for configured optional steps. - Treat workflow step definitions as missing only when the lookup has no entry. - Preserve empty descriptions for found optional-group steps such as Code Review. - Add regression coverage for configured, checkbox, and ordering displays. - Add a patch changeset for the published Fusion package. Files changed: .../fn-7041-workflow-step-definition-not-found.md | 7 +++++ .../app/components/WorkflowResultsTab.tsx | 9 +++++- .../__tests__/WorkflowResultsTab.test.tsx | 36 ++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) Fusion-Task-Id: FN-7041 Fusion-Task-Lineage: 84698437-d4d3-4b68-9c5f-c8b15f513230
This commit is contained in:
7
.changeset/fn-7041-workflow-step-definition-not-found.md
Normal file
7
.changeset/fn-7041-workflow-step-definition-not-found.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"@runfusion/fusion": patch
|
||||
---
|
||||
|
||||
summary: Fix task Workflow tab showing "Step definition not found." for Code Review and other optional steps.
|
||||
category: fix
|
||||
dev: WorkflowResultsTab configuredSteps now shows the not-found message only when a step id is absent from the step lookup, not when a found optional-group step has an empty description.
|
||||
@@ -595,13 +595,20 @@ export function WorkflowResultsTab({
|
||||
}
|
||||
}, [canEdit]);
|
||||
|
||||
/*
|
||||
FNXC:WorkflowSettings 2026-06-25-16:20:
|
||||
Optional-group steps such as Code Review and Browser Verification are valid configured workflow steps but intentionally carry an empty description from the resolver. Show "Step definition not found." only when the step id is genuinely absent from the lookup, never for a found step whose description is empty.
|
||||
*/
|
||||
const configuredSteps = useMemo(() => {
|
||||
return selectedWorkflowSteps.map((stepId) => {
|
||||
const stepInfo = workflowStepLookup.get(stepId);
|
||||
const isMissingStepDefinition = stepInfo === undefined;
|
||||
return {
|
||||
id: stepId,
|
||||
name: stepInfo?.name || stepId,
|
||||
description: stepInfo?.description || t("app:workflow.stepDefinitionNotFound", "Step definition not found."),
|
||||
description: isMissingStepDefinition
|
||||
? t("app:workflow.stepDefinitionNotFound", "Step definition not found.")
|
||||
: stepInfo.description,
|
||||
phase: stepInfo?.phase || "pre-merge",
|
||||
} as WorkflowStepOption;
|
||||
});
|
||||
|
||||
@@ -745,6 +745,42 @@ describe("WorkflowResultsTab", () => {
|
||||
expect(screen.getByText("Pre-merge steps run after implementation, before merge. Post-merge steps run after merge succeeds.")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows found optional-group steps with empty descriptions without the missing-definition fallback", async () => {
|
||||
mockedFetchWorkflowOptionalSteps.mockResolvedValueOnce([
|
||||
{
|
||||
templateId: "code-review",
|
||||
name: "Code Review",
|
||||
description: "",
|
||||
phase: "pre-merge",
|
||||
defaultOn: true,
|
||||
},
|
||||
]);
|
||||
|
||||
render(
|
||||
<WorkflowResultsTab
|
||||
taskId="FN-001"
|
||||
results={[]}
|
||||
canEdit
|
||||
enabledWorkflowSteps={["WS-101", "code-review"]}
|
||||
/>,
|
||||
);
|
||||
|
||||
const configuredStep = await screen.findByTestId("workflow-configured-step-code-review");
|
||||
await waitFor(() => expect(configuredStep).toHaveTextContent("Code Review"));
|
||||
expect(screen.getByTestId("workflow-configured-phase-code-review")).toHaveTextContent("Pre-merge");
|
||||
expect(within(configuredStep).queryByText("Step definition not found.")).not.toBeInTheDocument();
|
||||
|
||||
fireEvent.click(screen.getByTestId("workflow-steps-edit-toggle"));
|
||||
|
||||
const checkboxStep = await screen.findByTestId("workflow-step-checkbox-code-review");
|
||||
expect(checkboxStep).toHaveTextContent("Code Review");
|
||||
expect(within(checkboxStep).queryByText("Step definition not found.")).not.toBeInTheDocument();
|
||||
|
||||
const orderStep = screen.getByTestId("workflow-step-order-item-code-review");
|
||||
expect(orderStep).toHaveTextContent("Code Review");
|
||||
expect(within(orderStep).queryByText("Step definition not found.")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("falls back to step ID and default description when definition is missing", () => {
|
||||
render(
|
||||
<WorkflowResultsTab
|
||||
|
||||
Reference in New Issue
Block a user