Skip to content

fix(ew): add Block Library to the tool panel dropdown#1115

Open
amol-anand wants to merge 3 commits into
mainfrom
shwblock
Open

fix(ew): add Block Library to the tool panel dropdown#1115
amol-anand wants to merge 3 commits into
mainfrom
shwblock

Conversation

@amol-anand

Copy link
Copy Markdown
Contributor

Adds Block Library to the ew canvas tool panel dropdown

Description

Adds Block Library to the right tool panel dropdown, alongside the other tools (Outline, Files, Versions, Templates, Icons, Placeholders, AEM Assets).

Selecting it opens the same block library dialog that the slash menu and outline "+" button already open — inserting a variant drops it at the current cursor position in the editor.

Motivation and Context

Block Library is the odd one out: every other tool is reachable from the tool panel dropdown, but the block library was only accessible via the slash menu and a small, easy-to-miss + button on the outline section header rows. This puts it where users already look for tools, so it's discoverable in the same place as everything else — without removing the existing entry points.

Rather than rendering it inline like the other library tools (its tree + preview layout needs far more room than the side panel offers), the dropdown entry reuses the existing openBlockLibraryModal() flow. This keeps a single block-library UI and avoids offering two different experiences for the same feature.

Implementation
extensionToPanelView special-cases the blocks extension to produce a view with a new experience: 'modal' and an openModal() that calls the existing openBlockLibraryModal(), wiring insertion into the active editor view.
ew-tool-panel handles the new modal experience in showPanel — mirroring the existing window case: it fires the action and returns without mounting anything inline or changing the active tab. The dropdown item shows the "opens externally" affordance.

No changes to the block library modal component or its styles — it's the exact same dialog, now reachable from a third entry point.

How Has This Been Tested?

https://shwblock--da-live--adobe.aem.live/canvas#/aem-sandbox/block-collection/drafts/amol/shwblock

Verified Block Library appears in the tool panel dropdown for a site with a configured blocks library, grouped under Library.
Selecting it opens the block library dialog; searching, expanding blocks, and previewing variants all work as before.
Inserting a variant places the block at the current cursor position in the editor.
Confirmed the existing entry points (slash menu, outline section "+" button) still work unchanged.
Confirmed the dropdown entry does not appear for sites with no blocks library configured.

Screenshots (if appropriate):

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.

@amol-anand
amol-anand requested review from hannessolo and mhaack July 15, 2026 22:18
@aem-code-sync

aem-code-sync Bot commented Jul 15, 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

@mhaack
mhaack requested a review from sharanyavinod July 16, 2026 11:10
@mhaack

mhaack commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@amol-anand can you have a look at the link issues and we should add some tests as well

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