Skip to content

Comments

Add confirmation modal for adaptor changes with credentials #4413

Closed
lmac-1 wants to merge 5 commits intomainfrom
4395-change-adaptor-type-credentials
Closed

Add confirmation modal for adaptor changes with credentials #4413
lmac-1 wants to merge 5 commits intomainfrom
4395-change-adaptor-type-credentials

Conversation

@lmac-1
Copy link
Collaborator

@lmac-1 lmac-1 commented Feb 10, 2026

Description

When changing adaptors in the collaborative editor, users now see a confirmation modal warning that credentials will be reset. The modal only appears when:

  • Changing to a different adaptor package (not just version)
  • A credential is currently selected

Also optimizes Y.Doc synchronization to eliminate double-sync by ensuring version changes happen in a single operation rather than syncing @latest then the actual version.

Includes comprehensive test coverage for all confirmation scenarios.

Validation steps

Setup:

  1. Open collaborative editor and select a job with an adaptor
  2. Click Connect and create a credential to add to that step

1. Confirmation appears when changing adaptors WITH credentials:

  1. Click on the adaptor on the step to open adaptor picker
  2. Select a different adaptor (e.g., switch from Salesforce to HTTP)
  3. Expected: "Change Adaptor?" confirmation modal appears with warning
  4. Click "Continue"
  5. Expected: Credential clears, adaptor changes, version auto-selects latest version number

2. No confirmation when changing adaptors WITHOUT credentials:

  1. Clear any selected credential
  2. Click "Change" and select different adaptor
  3. Expected: No confirmation, adaptor changes immediately

3. No confirmation when changing versions:

  1. With credential set, change version in dropdown (don't click "Change")
  2. Expected: No confirmation, version changes immediately

4. Cancel preserves state:

  1. With credential set, click "Change" → select different adaptor
  2. Click "Cancel" on confirmation
  3. Expected: Original adaptor and credential unchanged, modal stays open

Additional notes for the reviewer

  1. NOTE: Pressing Escape when the confirmation modal is open closes everything (confirmation + modal + inspector).
    This is consistent with existing behaviour for delete/reset confirmations throughout Inspector. If we want to
    change this so Escape only closes the confirmation dialog (leaving the parent modal open), that should be
    handled in a separate issue as it would require reworking how AlertDialog integrates with the keyboard
    shortcut priority system across the application.

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

Pre-submission checklist

  • I have performed an AI review of my code (we recommend using /review
    with Claude Code)
  • I have implemented and tested all related authorization policies.
    (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

When changing adaptors in the collaborative editor, users now see a
confirmation modal warning that credentials will be reset. The modal
only appears when:
- Changing to a different adaptor package (not just version)
- A credential is currently selected

Also optimizes Y.Doc synchronization to eliminate double-sync by
ensuring version changes happen in a single operation rather than
syncing @latest then the actual version.

Includes comprehensive test coverage for all confirmation scenarios.
@github-project-automation github-project-automation bot moved this to New Issues in v2 Feb 10, 2026
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.36%. Comparing base (a3126d7) to head (d5d75b7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4413   +/-   ##
=======================================
  Coverage   89.36%   89.36%           
=======================================
  Files         425      425           
  Lines       20187    20187           
=======================================
  Hits        18041    18041           
  Misses       2146     2146           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lmac-1
Copy link
Collaborator Author

lmac-1 commented Feb 10, 2026

@theroinaochieng this is ready for review. I have assigned you as one of the reviewers but please reassign depending on dev availability, thanks!

Copy link
Contributor

@doc-han doc-han left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes work fine in the JobForm but not for the FullScreenIDE. Hence, when I'm on the canvas and update the job form that's fine but when I'm in the code editor, the previous behaviour persists

@github-project-automation github-project-automation bot moved this from New Issues to In review in v2 Feb 18, 2026
@lmac-1
Copy link
Collaborator Author

lmac-1 commented Feb 18, 2026

Great catch @doc-han - will get this done now.

@lmac-1
Copy link
Collaborator Author

lmac-1 commented Feb 18, 2026

Anyone else looking at this - please hold off from reviewing further until tagged - I am uniting the adaptor configuration component today.

@lmac-1
Copy link
Collaborator Author

lmac-1 commented Feb 19, 2026

I decided to refactor this into a shared component so that in future there won't be more problems like this. But it took a bit longer than expected and DR project took over yesterday. Hoping to finish this off today or tomorrow.

@lmac-1
Copy link
Collaborator Author

lmac-1 commented Feb 19, 2026

Sorry still not finished. Proving to be quite gnarly because of the modals on top of modals in FullScreenIDE. I have to prioritise some documents for the DR project proposal for the rest of the day so will have to stop now.

@lmac-1
Copy link
Collaborator Author

lmac-1 commented Feb 22, 2026

@doc-han I have moved this over to a fresh PR (#4446) as I started the solution from scratch with the extra context of having the functionality in both JobInspector and FullScreenIDE. That PR is now ready for review and I will close this one.

@lmac-1 lmac-1 closed this Feb 22, 2026
@github-project-automation github-project-automation bot moved this from In review to Done in v2 Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants