Skip to content

fix: show section breaks in version compare - #1764

Open
varunmitra wants to merge 1 commit into
mainfrom
cmpbreak
Open

varunmitra wants to merge 1 commit into
mainfrom
cmpbreak

Conversation

@varunmitra

Copy link
Copy Markdown

Section breaks (<hr>) were hard to see in version compare in both the classic editor and the canvas Versions panel. An unchanged break showed as a thin, unlabeled line. An added or removed break was wrapped in a small inline ins/del box, which showed up as a stray pink or green sliver next to a plain line.

This PR gives breaks the same "SECTION BREAK" line and label the editor uses, and tints them when they are added or removed.

Description

  • blocks/shared/version/compare.css (classic editor compare modal):
    • Style hr with the editor's grey line and "Section Break" label.
    • Render a break wrapped in ins.diffins or del.diffdel as a borderless block, green when added and red when removed.
  • blocks/canvas/ew-comparison/ew-canvas-compare.css (canvas compare, inline and split panes): the same rules, using the --s2-* colour variables.
  • test/unit/blocks/shared/version/htmldiff.test.js: two tests asserting that an added <hr> is wrapped in ins and a removed one in del, which the styling depends on.

CSS and tests only. No JS behaviour changes.

Related Issue #1205

Motivation and Context

How Has This Been Tested?

Testing

  • npm run lint passes.
  • The test/unit/blocks/shared/version unit tests pass.
  • Checked manually on localhost (stage) and on a branch preview with a page that has several section breaks and versions:
    • Classic editor compare modal: unchanged breaks show as grey labeled lines, and a break present only in the current document shows as a red labeled line.
    • Canvas split view: unchanged breaks show as grey labeled lines in both panes, and a break added in the current document shows as a red labeled line with its highlighted content.

Screenshots (if appropriate):

Screenshot 2026-11-19 at 2 48 32 PM Screenshot 2026-11-19 at 2 48 10 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.

Render added and removed section breaks with labeled, color-coded rules in canvas and shared comparisons, and test that HTML diffs mark them as insertions or deletions.
@aem-code-sync

aem-code-sync Bot commented Nov 19, 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

This branch was successfully deployed

1 active deployment
cmpbreak — 22a42d51 Deployed Nov 19, 2026 by aem-code-sync[bot]
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.

1 participant