Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/pr-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ jobs:
**/*Models.ts
**/*Interface.ts
**/*Interfaces.ts
**/interfaces.ts
**/interfaces.tsx
**/types.ts
**/types.tsx
**/styles.ts
Expand Down
8 changes: 8 additions & 0 deletions Localize/lang/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,11 @@
"5LV34t": "The ''{invalidProperties}'' properties are invalid for the ''{authType}'' authentication type.",
"5N/tfe": "Extraction progress details",
"5OvGgn": "Body",
"5QUuaP": "Jump to failed iteration",
"5R1r3q": "Create a new connection",
"5SAQOb": "Authority",
"5Tqzsm": "Categorization",
"5UmjLL": "Failed…",
"5Vbd0e": "Select a knowledge hub",
"5VhY2X": "Loading models...",
"5WTRY8": "Errors",
Expand Down Expand Up @@ -654,6 +656,7 @@
"9emgHc": "Specify which HTTP status codes should trigger a retry. Select one or more status codes.",
"9euy52": "Complete",
"9gb/xS": "Create",
"9hDI1a": "Failed iteration {iteration}",
"9hKeBq": "Select an Azure OpenAI resource",
"9iYe3N": "The designer does not support workflows with multiple triggers. Use Run details to view this run.",
"9klmbJ": "Save",
Expand Down Expand Up @@ -1966,6 +1969,7 @@
"YoQara": "None",
"YpTC5c": "Status",
"YqKlGx": "Connect to external services and applications",
"YrNXP1": "Failed iterations {first} to {last}",
"Yrw/Qt": "Your personal and company data are protected in this chat",
"YsOyuE": "Create agent parameter",
"Yskw5t": "Add Action",
Expand Down Expand Up @@ -2426,9 +2430,11 @@
"_5LV34t.comment": "Error message when having multiple invalid authentication properties",
"_5N/tfe.comment": "Keyboard-scrollable extraction milestones and contextual recovery details",
"_5OvGgn.comment": "The title of the body field in the static result query action",
"_5QUuaP.comment": "Accessible name and tooltip for failed-iteration destination select in the loop pager",
"_5R1r3q.comment": "Button text to create a new connection",
"_5SAQOb.comment": "Authority Label Display Name",
"_5Tqzsm.comment": "Categorization section title",
"_5UmjLL.comment": "Visible compact prompt text for failed-iteration destination select in the loop pager",
"_5Vbd0e.comment": "Placeholder text for knowledge hub dropdown",
"_5VhY2X.comment": "Placeholder while models load for create form",
"_5WTRY8.comment": "The tab label for the errors tab on the errors panel",
Expand Down Expand Up @@ -2681,6 +2687,7 @@
"_9emgHc.comment": "tooltip for retry policy HTTP status codes setting",
"_9euy52.comment": "Text to indicate that the artifact upload is completed",
"_9gb/xS.comment": "Button text for creating a group",
"_9hDI1a.comment": "Option label for a failed loop iteration destination in the loop pager",
"_9hKeBq.comment": "Select the Azure Cognitive Service Open AI resource to use for this connection",
"_9iYe3N.comment": "Message shown instead of the designer canvas when a Consumption workflow definition has more than one trigger and a run is selected in monitoring view. The backend supports the workflow, but the designer cannot render it; the Run details action opens the full run experience.",
"_9klmbJ.comment": "Button text for saving changes for parameter in the customize parameter panel",
Expand Down Expand Up @@ -3993,6 +4000,7 @@
"_YoQara.comment": "Display text for when About Panel has no Tags",
"_YpTC5c.comment": "Label for the status column",
"_YqKlGx.comment": "Action in an app category description",
"_YrNXP1.comment": "Submenu label for a range of failed loop iteration destinations",
"_Yrw/Qt.comment": "Letting user know that their data is protected in the chatbot",
"_YsOyuE.comment": "Create agent parameter",
"_Yskw5t.comment": "Text on example action node",
Expand Down
35 changes: 35 additions & 0 deletions e2e/designer/sharedNodeUiConnections.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,41 @@ for (const flag of ['true', 'false'] as const) {
expect((await getSerializedWorkflowFromStateV2(page)).definition.actions).toEqual(before.definition.actions);
});

if (flag === 'true') {
test('restores the serialized branch DAG with one Undo after duplicating a nested Scope', async ({ page }) => {
await openSharedWorkflow(page, 'All Scope Nodes', flag);
const readActions = async () => (await getSerializedWorkflowFromStateV2(page)).definition.actions;
const readScopeBody = async () => (await readActions()).Switch.cases.Scope_Case.actions.Scope.actions;
const before = await readActions();
const scopeBody = before.Switch.cases.Scope_Case.actions.Scope.actions;
const undo = page.getByRole('button', { name: 'Undo', exact: true });
await expect(undo).toBeDisabled();

const nestedScope = page.locator('#msla-node-Scope_nested');
await nestedScope.press('Enter');
await nestedScope.focus();
await page.keyboard.press('ControlOrMeta+d');
await expect.poll(async () => Object.keys(await readScopeBody()).length).toBe(Object.keys(scopeBody).length + 1);
const after = await readScopeBody();
const duplicateId = Object.keys(after).find((id) => !scopeBody[id]);
if (!duplicateId) {
throw new Error('Duplicate must add a new Scope inside the original branch.');
}
expect(after[duplicateId].type).toBe('Scope');
expect(after[duplicateId].runAfter).toEqual({ Scope_nested: ['SUCCEEDED'] });
expect(after.Scope_empty.runAfter).toEqual({
[duplicateId]: scopeBody.Scope_empty.runAfter.Scope_nested,
});
await expect
.poll(async () => Object.values((await readScopeBody())[duplicateId].actions ?? {}))
.toEqual(Object.values(scopeBody.Scope_nested.actions));

await undo.click();
await expect.poll(readActions).toEqual(before);
await expect(undo).toBeDisabled();
});
}

test('blocks node mutations in monitoring even when the host omits readOnly', async ({ page }) => {
await openSharedWorkflow(page, 'General Run After', flag);
const compose = page.locator('#msla-node-Compose');
Expand Down
158 changes: 158 additions & 0 deletions e2e/designer/sharedNodeUiForeachFailureMenu.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
import { expect, test } from '@playwright/test';
import { openSharedWorkflow, waitForViewport } from './utils/sharedNodeUi';

const scopeRunId = '/foreach-failure-menu-run';
const scopeRepetitions = `/url${scopeRunId}/actions/Foreach/scopeRepetitions`;
const times = { startTime: '2026-01-01T00:00:00Z', endTime: '2026-01-01T00:00:01Z' };

test(
'jumps between confirmed Foreach failures by keyboard without clipping the pager or covering the outgoing edge',
{
tag: ['@mock', '@shared-node-ui'],
},
async ({ page }) => {
// Dev-mode StandardRunService returns no failed repetitions before calling HTTP. Exercise the real
// Standard request builder on the fixture only; all other run service calls stay in Local dev mode.
await page.route(/\/LocalDesigner\/localDesignerV2\.tsx(?:\?|$)/, async (route) => {
const response = await route.fetch();
await route.fulfill({
response,
body: `${await response.text()}
const fixtureRunService = new runService.constructor({
...runService.options,
isDev: false,
httpClient: {
async get({ uri, queryParameters }) {
const url = new URL(uri, window.location.origin);
url.search = new URLSearchParams(queryParameters).toString();
const response = await fetch(url);
if (!response.ok) throw new Error("Foreach fixture returned HTTP " + response.status);
return response.json();
},
},
});
const originalGetScopeRepetitions = runService.getScopeRepetitions.bind(runService);
runService.getScopeRepetitions = (action, status) =>
action.runId === ${JSON.stringify(scopeRunId)} && action.nodeId === "Foreach" && status === "Failed"
? fixtureRunService.getScopeRepetitions(action, status)
: originalGetScopeRepetitions(action, status);`,
});
});
await page.route(
(url) => url.pathname === scopeRepetitions,
(route) =>
route.fulfill({
json: {
value: [1, 5].map((itemIndex) => ({
id: `${scopeRunId}/actions/Foreach/scopeRepetitions/${String(itemIndex).padStart(6, '0')}`,
properties: { ...times, status: 'Failed', repetitionIndexes: [{ scopeName: 'Foreach', itemIndex }] },
})),
},
})
);

await openSharedWorkflow(page, 'ForEach');
await page.evaluate(() => {
const store = window.DesignerStoreV2;
store.dispatch({
type: 'designerOptions/initDesignerOptions',
payload: { ...store.getState().designerOptions, isMonitoringView: true, readOnly: true },
});
});
const history = page.locator('.fui-InlineDrawer').filter({ has: page.getByRole('heading', { name: 'Run history', exact: true }) });
await history.locator('.fui-DrawerHeaderNavigation button').click();
await expect(history).toBeHidden();

const [filteredRequest] = await Promise.all([
page.waitForRequest((request) => new URL(request.url()).pathname === scopeRepetitions),
page.evaluate(
({ scopeRunId, times }) => {
const store = window.DesignerStoreV2;
store.dispatch({ type: 'workflow/setRunIndex', payload: { nodeId: 'Foreach', page: 3 } });
store.dispatch({
type: 'workflow/setRepetitionRunData',
payload: { nodeId: 'Foreach', runData: { ...times, status: 'Failed', iterationCount: 123456 } },
});
store.dispatch({
type: 'workflow/setRunInstance',
payload: { id: scopeRunId, name: scopeRunId.slice(1), properties: { status: 'Failed' } },
});
},
{ scopeRunId, times }
),
]);
const query = new URL(filteredRequest.url()).searchParams;
expect(query.get('$filter')).toBe("status eq 'Failed'");
expect(query.get('api-version')).toBe('2018-11-01');

await page.getByRole('button', { name: 'Zoom view to fit', exact: true }).click();
await waitForViewport(page);

const card = page.locator('#msla-node-Foreach[data-node-card="foreach"]');
const row = card.locator('[data-loop-pager-row]');
const pager = row.getByRole('group', { name: 'Iterations', exact: true });
const number = pager.getByRole('textbox', { name: /Iteration number, 1 to 123[,\s]?456/ });
const chooser = pager.getByRole('button', { name: 'Jump to failed iteration', exact: true });
await expect(number).toHaveValue('4');
await expect(chooser).toHaveAttribute('aria-haspopup', 'menu');
await expect(pager.getByRole('combobox')).toHaveCount(0);

await chooser.press('ArrowDown');
const menu = page.getByRole('menu').filter({ has: page.getByRole('menuitem', { name: 'Failed iteration 2', exact: true }) });
const previousFailure = menu.getByRole('menuitem', { name: 'Previous failed iteration', exact: true });
const nextFailure = menu.getByRole('menuitem', { name: 'Next failed iteration', exact: true });
await expect(menu.getByRole('menuitem')).toHaveText([
'Previous failed iteration',
'Next failed iteration',
'Failed iteration 2',
'Failed iteration 6',
]);
await expect(previousFailure).toBeEnabled();
await expect(nextFailure).toBeEnabled();
await expect(previousFailure).toBeFocused();
await page.keyboard.press('Escape');
await expect(menu).toBeHidden();
await expect(chooser).toBeFocused();
await expect(number).toHaveValue('4');

await chooser.press('ArrowDown');
await expect(previousFailure).toBeFocused();
await page.keyboard.press('ArrowDown');
await expect(nextFailure).toBeFocused();
await page.keyboard.press('Enter');
await expect(menu).toBeHidden();
await expect(number).toHaveValue('6');

const total = pager.getByText('/ 123456', { exact: true });
await expect(total).toBeInViewport({ ratio: 1 });
await expect
.poll(() =>
total.evaluate((element) => {
const row = element.closest('[data-loop-pager-row]')!.getBoundingClientRect();
const label = element.getBoundingClientRect();
const range = document.createRange();
range.selectNodeContents(element);
const text = range.getBoundingClientRect();
return text.width > 0 && text.left >= Math.max(row.left, label.left) - 1 && text.right <= Math.min(row.right, label.right) + 1;
})
)
.toBe(true);

const port = card.locator('.react-flow__handle.source');
// Same clearance predicate as the existing simulated-run spec; use the actual React Flow path, not its painted arrow.
const outgoing = page.locator('.react-flow__edge[data-id^="Foreach%2D#scope-"] .msla-shared-edge-path').first();
await expect
.poll(async () => {
const controls = await pager.boundingBox();
const source = await port.boundingBox();
const edgeStartY = await outgoing.evaluate((path: SVGPathElement) => {
const transform = path.getScreenCTM();
return transform && path.getPointAtLength(0).matrixTransform(transform).y;
});
return controls && source && edgeStartY !== null
? Math.min(source.y + source.height, edgeStartY) - (controls.y + controls.height)
: -1;
})
.toBeGreaterThanOrEqual(0);
}
);
Loading
Loading