Skip to content

fix: stop clearing new-editor flag when Sidekick lands on /edit - #714

Merged
mhaack merged 6 commits into
mainfrom
togglefix
Sep 4, 2026
Merged

fix: stop clearing new-editor flag when Sidekick lands on /edit#714
mhaack merged 6 commits into
mainfrom
togglefix

Conversation

@mhaack

@mhaack mhaack commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • connectedCallback's implicit-choice sync used to clear nx2:ew-user-enabled whenever you landed directly on /edit — including when Sidekick's "Edit" button (not the user) put you there. Now only the /canvas opt-in sync remains.
  • The toolbar switch hides itself on /edit when the flag is already on (instead of clearing it), since showing it in a misleading "off" state doesn't make sense once /edit redirects away anyway.
  • The profile-menu switch now renders wherever the flag is on, independent of path, so there's always a way to turn it off.

Companion fix for adobe/da-live#1289 — pair with the da-live redirect PR.

Related Issue

adobe/da-live#1289

How Has This Been Tested?

Combine with the da-live ewredir branch via the ?nx=togglefix override:

https://ewredir--da-live--adobe.aem.live/edit?nx=togglefix#/aem-sandbox/block-collection/drafts/shsteimer/testing

  1. Toggle "New Authoring" on (nav switch on /edit, or profile menu on /canvas).
  2. Re-visit the /edit#... URL above directly (simulating Sidekick bouncing you back) — the flag stays on and you're redirected straight back to /canvas instead of landing on the old editor with the switch cleared.

Full test suite (96 files) passes locally.

mhaack and others added 3 commits September 2, 2026 13:27
The toolbar switch treated any direct landing on /edit as an implicit
opt-out, clobbering the persisted nx2:ew-user-enabled flag even when
Sidekick's Edit button (not the user) put you there. It's now only
hidden in that case, and the profile-menu switch stays available so
there's always a way to turn the flag off.

Fixes adobe/da-live#1289.
The toolbar switch already never renders on /canvas, so the menu
switch's extra /canvas path check was redundant.
@aem-code-sync

aem-code-sync Bot commented Sep 2, 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 nx2/blocks/editortoggle/editortoggle.js Outdated
if (!this._userEnabled) return nothing;
} else if (window.location.pathname !== '/edit' || this._userEnabled) {
return nothing;
}

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.

Maybe we can clean it up here slightly since we now have multiple if with different patterns, and all returning nothing

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.

that is already the "short" version. my friend claude came up with more if/else before. will have a look.

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.

Cleaned this up in 6a5bf11 — replaced the mixed if/else-if with two named showMenu/showToolbar conditions and a single guard clause.

Replaces the mixed if/else-if (one nested, one negated condition,
both eventually returning nothing) with two explicit showMenu/
showToolbar booleans and a single guard clause.
anfibiacreativa
anfibiacreativa previously approved these changes Sep 2, 2026
sharanyavinod
sharanyavinod previously approved these changes Sep 2, 2026
@mhaack
mhaack merged commit 09630a4 into main Sep 4, 2026
3 checks passed
@mhaack
mhaack deleted the togglefix branch September 4, 2026 14:36
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