Skip to content

Ew toolbar#380

Merged
hannessolo merged 16 commits intoewfrom
ew-toolbar
Apr 23, 2026
Merged

Ew toolbar#380
hannessolo merged 16 commits intoewfrom
ew-toolbar

Conversation

@hannessolo
Copy link
Copy Markdown
Contributor

@hannessolo hannessolo commented Apr 21, 2026

@aem-code-sync
Copy link
Copy Markdown

aem-code-sync Bot commented Apr 21, 2026

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

}

function everyTextblockInSelection(state, pred) {
let seen = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we want to establish a convention for booleans naming like

isVisible
isOk

etc?

cc: @sharanyavinod

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.

For locally scoped variables IMO we don't need this. But happy to be convinced otherwise. It would probably trigger renaming a lot of things though.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we don't need it locally, but it's a good way to consolidate and make code faster to understand.
We can start enforcing for other cases, though, and leave a big refactor as a TODO

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'm not convinced. I think "seen" and "ok" are already pretty obviously booleans (eg. response.ok is a really well known property in the fetch api). And anyway it would have to be hasSeen , not isSeen, in this case, because the function has seen it, not the function is being seen.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

oh I was just giving examples, this is why I mentioned isVisible, not isSeen. But I get your point. Ok, is ok (pun intended) because it maps directly to a response.ok for a 200/299 range. Not sure seen is very intuitive I would call it hasTextBlocks or isNotEmpty.
This is not a blocker to merge the PR, but it would be great to find our standards to work faster and have a style reference.

'bullet-list': (state, dispatch) => wrapInList(state.schema.nodes.bullet_list)(state, dispatch),
'numbered-list': (state, dispatch) => wrapInList(state.schema.nodes.ordered_list)(state, dispatch),
'heading-1': (s, d) => applyHeadingLevel(s, d, 1),
'heading-2': (s, d) => applyHeadingLevel(s, d, 2),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Curious about the change from set to apply. Is it because it's not strictly a setter with a getter?

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's just because I wanted a unified way of handling this between the slash menu and the toolbar. I think "apply" is more what we're doing than "set".

In the previous iteration of the code, it wasn't even consistently "set", I don't think setBulletList makes sense as a name

getToken,
});
path: controllerPathnameFromEditorCtx(this.ctx),
getToken: createQuickEditGetToken(),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Couldn't this be just a generic utility getToken function?

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.

Yes, let me fix that. Please do call out more pointless functions like that. I had cursor refactor but it created a lot of wrapper functions that don't add value, I should have used a better model...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am somewhat convinced that we could make other functions in that same file that could be generic with more config tradeoff. But this one stood out.

Copy link
Copy Markdown

@sharanyavinod sharanyavinod left a comment

Choose a reason for hiding this comment

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

We need a single source of truth for command config. The same information (id, schema name, label, icon etc) is currently spread across the code. Adding or renaming a command requires changes in multiple locations, and there's no overarching view of what's supported.

Comment thread nx2/blocks/canvas/nx-editor-wysiwyg/utils/handlers.js Outdated
Comment thread nx2/blocks/canvas/nx-editor-wysiwyg/utils/handlers.js Outdated
Comment thread nx/public/plugins/quick-edit/src/prose.js Outdated
Comment thread nx2/blocks/canvas/editor-utils/selection-toolbar.js Outdated
Comment thread nx2/blocks/canvas/editor-utils/commands.js Outdated
Comment thread nx/public/plugins/quick-edit/src/prose.js Outdated
@sharanyavinod
Copy link
Copy Markdown

FYI: I see you've been adding icons into https://github.com/adobe/da-nx/tree/ew/nx2/blocks/img/icons whereas we've been adding into https://github.com/adobe/da-nx/tree/ew/nx2/img/icons. Note for when you're moving things into da-live.

@hannessolo hannessolo merged commit d7e993e into ew Apr 23, 2026
3 checks passed
@hannessolo hannessolo deleted the ew-toolbar branch April 23, 2026 09:06
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.

3 participants