Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 7, 2025

Description

Fixes the web resource comparison order to match user expectations and standard diff conventions. When comparing a local web resource with its server version, the diff view now correctly displays the server version on the left and the local version on the right.

Problem

When using the "Compare with Server" feature for web resources, the diff view was showing:

  • Left side: Local file (user's changes)
  • Right side: Server file (base version)

This was counter-intuitive and opposite to standard diff conventions where the base/original version appears on the left and the modified version appears on the right.

Solution

Modified the compareWebResources method in src/helpers/webResourceHelper.ts to:

  1. Swap the parameters passed to vscode.diff command so the server file (temp file) is the left parameter and the local file is the right parameter
  2. Update the diff title from "Local <--> Server" to "Server <--> Local" to accurately reflect the new order

Before:

await vscode.commands.executeCommand("vscode.diff", vscode.Uri.file(fullPath), tempFilePath, `Local <--> Server : ${resourceToCompare["@_dvDisplayName"]}`);

After:

await vscode.commands.executeCommand("vscode.diff", tempFilePath, vscode.Uri.file(fullPath), `Server <--> Local : ${resourceToCompare["@_dvDisplayName"]}`);

Impact

Users will now see a more intuitive comparison view:

  • Left side: Server version (base/original)
  • Right side: Local version (modifications)

This aligns with standard diff tool conventions and makes it easier to review local changes against the server version.

Closes #[issue_number]

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: Compare local and server should be reversed</issue_title>
<issue_description>### What happened?

When doing the compare of the web resources; local should be on the right and server should be on the left

What version of the tool are you using?

2.2.5

What version of Visual Studio Code are you running?

1.104.2

Any relevant session id from VSCode?

No response

Relevant log output

```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>
Fixes #281

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits October 7, 2025 18:49
Co-authored-by: Power-Maverick <36135520+Power-Maverick@users.noreply.github.com>
Co-authored-by: Power-Maverick <36135520+Power-Maverick@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix direction of comparison for local and server resources Fix: Reverse web resource compare order - Server (left) vs Local (right) Oct 7, 2025
Copilot AI requested a review from Power-Maverick October 7, 2025 18:51
@Power-Maverick Power-Maverick marked this pull request as ready for review October 7, 2025 19:14
@Power-Maverick Power-Maverick merged commit bfbdbca into main Oct 7, 2025
2 checks passed
@Power-Maverick Power-Maverick deleted the copilot/fix-compare-local-and-server branch October 7, 2025 19:16
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.

[Bug]: Compare local and server should be reversed

2 participants