Skip to content

Fix Schema Compare switch direction button to match Azure Data Studio behavior #19666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 26, 2025

The Schema Compare "Switch Direction" button was incorrectly disabled when either the source or target endpoint was empty, which differs from Azure Data Studio behavior where the button is enabled as long as at least one endpoint is populated.

Changes Made

Modified the disabled condition in CompareActionBar.tsx for the Switch Direction button:

Before:

disabled={
    context.state.isComparisonInProgress ||
    isEndpointEmpty(context.state.sourceEndpointInfo) ||
    isEndpointEmpty(context.state.targetEndpointInfo)
}

After:

disabled={
    context.state.isComparisonInProgress ||
    (isEndpointEmpty(context.state.sourceEndpointInfo) &&
        isEndpointEmpty(context.state.targetEndpointInfo))
}

Behavior Changes

Scenario Before After
Both endpoints empty Disabled ✅ Disabled ✅
Source populated, target empty Disabled ❌ Enabled ✅
Source empty, target populated Disabled ❌ Enabled ✅
Both endpoints populated Enabled ✅ Enabled ✅

Design Rationale

  • Switch Direction button: Should be enabled when at least one endpoint exists to allow switching between source/target positions
  • Other buttons (Compare, Options, Save): Correctly maintain OR logic as they require both endpoints to function

This change aligns the VS Code extension behavior with Azure Data Studio, providing a consistent user experience across Microsoft's SQL tooling.

Fixes #19335.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /usr/local/bin/node ./out/test/unit/runTest.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: lewis-sanchez <87730006+lewis-sanchez@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Schema Compare: Switch direction is disabled if both source and target are not currently populated Fix Schema Compare switch direction button to match Azure Data Studio behavior Jun 26, 2025
@Copilot Copilot AI requested a review from lewis-sanchez June 26, 2025 23:17
Copilot finished work on behalf of lewis-sanchez June 26, 2025 23:17
Copy link

github-actions bot commented Jun 26, 2025

PR Changes

Category Main Branch PR Branch Difference
Code Coverage 59.42% 59.32% ⚪ 0.00%
VSIX Size 15486 KB 15502 KB ⚪ 16 KB ( 0% )
Webview Bundle Size 3772 KB 3772 KB ⚪ 0 KB ( 0% )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Schema Compare: Switch direction is disabled if both source and target are not currently populated
2 participants