New credential modals close without confirmation prompts
Users setting up Instance AI workflows can now close new credential modals immediately, even with unsaved data, because there's nothing to lose. Existing credentials still show the unsaved-changes confirmation as expected.
When users opened a new credential modal during Instance AI workflow setup, any attempt to close it triggered a confirmation dialog that rendered behind the modal itself. The close button appeared unresponsive, trapping users in a workflow they couldn't exit.
Credential modals now distinguish between new credentials and existing ones. For new credentials that have never been saved, the unsaved-changes confirmation is skipped entirely—there is no prior state to protect. Existing credentials continue to show the confirmation prompt when there are unsaved changes, preserving the safeguard against accidental data loss.
The fix lives in the credential editing component, where a condition checking for unsaved changes now also verifies whether the credential is new. A companion CSS adjustment ensures confirmation dialogs, when they do appear, render above their parent modals.
View Original GitHub Description
Summary
- When closing a new (never-saved) credential modal with unsaved changes,
beforeCloseshowed a confirmation dialog (message.confirm) that rendered behind the modal — making the X button appear broken - Skip the unsaved-changes confirmation for new credentials since there is nothing to lose
- This fixes the issue where the credential modal opened from the Instance AI workflow setup could not be closed
Related
https://www.notion.so/n8n/Permissions-modal-cannot-be-closed-3365b6e0c94f80fd8e5fe6ea35cb5fbb
Test plan
- Open Instance AI workflow setup, trigger credential creation
- Fill in some credential data, then click X — modal should close immediately
- Open an existing credential, make changes, click X — unsaved-changes confirmation should still appear
- Verify other modal close flows still work (NDV, expression editor)