Skip to content

feat(visual diff) diff view to support LOC and MSM file changes in EW - #1189

Open
ravuthu wants to merge 15 commits into
mainfrom
ewdiff
Open

feat(visual diff) diff view to support LOC and MSM file changes in EW#1189
ravuthu wants to merge 15 commits into
mainfrom
ewdiff

Conversation

@ravuthu

@ravuthu ravuthu commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Description

Currently, the file diff view is only supported in the DA editor. Implemented the same feature for EW as well. Layout and split views will be disabled when a file has merge conflicts to prevent a broken layout for content authors.

Related Issue

#1144

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Screenshot 2026-07-24 at 2 18 48 PM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@aem-code-sync

aem-code-sync Bot commented Jul 30, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

Comment thread blocks/edit/prose/diff/diff-utils.js Outdated
Comment thread blocks/canvas/ew-editor-doc/ew-editor-doc-diff.css Outdated
Comment thread blocks/canvas/ew-editor-doc/ew-editor-doc-diff.css Outdated
Comment thread blocks/canvas/ew-canvas-header/ew-canvas-header.js
Comment thread blocks/canvas/canvas.js Outdated

canvasBus.mergeConflictsState.subscribe((detail) => {
header.hasUnresolvedMergeConflicts = detail?.hasMergeConflicts ?? false;
if (header.hasUnresolvedMergeConflicts) header.setEditorView('content');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here as well, editorview should only be updated via the canvasbus

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated

Comment thread blocks/edit/prose/diff/diff-utils.js Outdated
colorOverlay.style.display = 'block';
colorOverlay.className = 'loc-tabbed-color-overlay diff-bg-upstream';
} else if (targetTab === 'diff') {
colorOverlay.style.display = 'none';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would be good to do this via a class instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated

Comment thread blocks/edit/prose/diff/diff-utils.js Outdated
host.style.setProperty('--diff-label-upstream', `'${labels.upstream}'`);
}

function getDiffHost(view) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Think this still has the same underlying shape as earlier though. Would it be worth computing the host once when each editor initializes and passing it down explicitly instead - the same way onMergeConflictsChange already gets threaded through initProse? EW already has this/this.shadowRoot available before initProse() is called, so it wouldn't need to be derived from view at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree, updated

super.disconnectedCallback();
}

_reloadIframe() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we do this explicitly here? Also this raises another question - since merge conflicts are contained to doc mode and layout mode is disabled until conflicts are resolved, why do we need explicit reload and checks in wyswyg mode? Wouldn't resolving conflicts cause an update within the doc and wouldn't this in turn by default update the wyswyg mode content?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is redundant. Removed it.

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.

4 participants