Skip to content

refactor toolbar in ew#1018

Open
hannessolo wants to merge 2 commits into
mainfrom
ewtb
Open

refactor toolbar in ew#1018
hannessolo wants to merge 2 commits into
mainfrom
ewtb

Conversation

@hannessolo

Copy link
Copy Markdown
Contributor

@aem-code-sync

aem-code-sync Bot commented Jun 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

- toolbar shows on caret (not just range); marks-at-cursor drive its active state
- drop storedMarks preservation across cursor moves so toggled marks clear if the user moves without typing
- emit controller updates unconditionally on setActive so the toolbar re-renders against fresh view.state
- hide inline-only block controls in wysiwyg/layout mode
- only hide the toolbar on actual canvas view-mode transitions, not on port-ready/ctx/iframe-load

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hannessolo hannessolo marked this pull request as ready for review June 19, 2026 12:42

function shouldShow() {
if (state.mode === 'none') return false;
if (state.interacting) return false;

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.

Do we need to explicitly hide the toolbar when related interactions are happening? Why not still have the toolbar in the background when the table or other modals are open? We then dont have to worry about rendering the toolbar again on closure.

const disabled = !this.view;
// In wysiwyg mode the iframe owns block-level structure (paragraph/heading,
// lists, tables) — only show inline marks and link controls.
const inlineOnly = this._mode === 'wysiwyg';

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.

In wyswyg, shouldn't the user still be able to change the heading types etc?

@sharanyavinod

Copy link
Copy Markdown
Contributor

In wyswyg, toolbar doesnt appear when I focus at the end of the text intermittently.
Note: Here the cursor is after Get your cup today!
Screenshot 2026-06-22 at 10 21 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.

2 participants