fix(editor): Keep workflow name in edit mode after Rename menu action (#41120)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
João Almeida 2026-10-16 09:04:26 +00:00 committed by GitHub
parent 116a81e06e
commit fc9f9575e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -203,6 +203,8 @@ const workflowMenuItems = computed<WorkflowMenuItem[]>(() => {
label: locale.baseText('generic.rename'),
icon: { type: 'icon', value: 'pencil' },
disabled: props.workflowPermissions.update !== true,
// Focus moves to the name input; returning it to the trigger blurs and ends the edit.
suppressCloseAutoFocus: true,
});
}

View File

@ -292,6 +292,21 @@ describe('WorkflowDetails', () => {
});
describe('Workflow menu', () => {
it('should keep the name input in edit mode after the rename action', async () => {
workflowDocumentStoreRef.value?.setScopes(['workflow:update']);
const { getByTestId, queryByTestId } = renderComponent({
props: { ...defaultProps },
});
await userEvent.click(getByTestId('workflow-menu'));
await userEvent.click(getByTestId('workflow-menu-item-rename'));
await vi.waitFor(() =>
expect(queryByTestId('workflow-menu-item-rename')).not.toBeInTheDocument(),
);
expect(getByTestId('inline-edit-input')).toHaveFocus();
});
it('should not show a dependencies entry when the workflow has none', async () => {
workflowDocumentStoreRef.value?.setScopes(['workflow:read']);
const { getByTestId, queryByTestId } = renderComponent({