Skip to content

Dynamic Gallery: Rename toolbar button to Detach and add a modal explaining what will happen#80727

Open
andrewserong wants to merge 4 commits into
trunkfrom
try/detach-modal-for-dynamic-gallery-block
Open

Dynamic Gallery: Rename toolbar button to Detach and add a modal explaining what will happen#80727
andrewserong wants to merge 4 commits into
trunkfrom
try/detach-modal-for-dynamic-gallery-block

Conversation

@andrewserong

@andrewserong andrewserong commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

What?

Fixes #80613

The Dynamic mode of the gallery block (the Dynamic Gallery variation) has an ambiguous "Convert to images" button in the block toolbar. As discussed in #80613 this can be confusing to users, and it also doesn't accurately reflect what's really going to happen.

This PR tries out ideas discussed in that issue: let's try renaming the button to Detach and add a confirm dialog that helps explain what will happen.

Very happy for feedback and ideas on the wording! Right now I've borrowed from @ramonjd's mockups.

Why?

The block can operate in two modes: dynamic mode connected to a source, and a static mode where the block isn't attached to a source and is made up of editable inner blocks. The two modes provide powerful behaviour (at least I think so), but it's also difficult to understand.

Hopefully, the button and modal can help users learn how to interact with the gallery block in each of its states, and also with this change, we hopefully reduce some confusion.

How?

  • Add an additional confirm dialog and state to the dynamic mode of the gallery block
  • When a user clicks "Detach" trigger the modal instead of immediately switching to a static version of the gallery block

Testing Instructions

  • Upload a bunch of images to a post or page (or attach them manually via the media library)
  • Insert a Gallery block to the page and select "Use attached images" to switch to the dynamic mode
  • Try out the "Detach" button in the block toolbar or the "Detach gallery" button in the inspector sidebar
  • How does the text read / look / feel? Does it make sense?
  • Click to confirm the detach. And make sure it otherwise works as on trunk.

Screenshots or screencast

This screenshot includes the three changes:

  • Block toolbar button copy change (it now says Detach)
  • Inspector controls button copy change (it now says Detach gallery)
  • The new modal
image

Use of AI Tools

Claude Code (Opus 5) for making the initial change, with testing and a little tweaking by me.

@andrewserong andrewserong self-assigned this Jul 27, 2026
@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Jul 27, 2026
@andrewserong andrewserong added [Type] Bug An existing feature does not function as intended [Block] Gallery Affects the Gallery Block - used to display groups of images and removed [Package] Block library /packages/block-library labels Jul 27, 2026
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

Size Change: +238 B (0%)

Total Size: 7.75 MB

📦 View Changed
Filename Size Change
build/scripts/block-library/index.min.js 356 kB +238 B (+0.07%)

compressed-size-action

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Jul 27, 2026
@andrewserong
andrewserong marked this pull request as ready for review July 27, 2026 07:21
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: bph <bph@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Flaky tests detected in e324af8.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/30245839636
📝 Reported issues:

@jasmussen

Copy link
Copy Markdown
Contributor

I like it! It feels like it explains quite well, even if after the fact, what this is. How do you feel about it?

Nit, I'd love if this could be a small dialog rather than be medium sized. We can potentially make the text shorter if that helps. I do like how you emulated detaching from the page list, but perhaps we can trim it. Instead of:

Detach gallery?

The gallery displays the images attached to the post. Detaching will enable you to add, delete, or reorder images. However newly attached images will no longer be added automatically.

[Cancel] [Detach]

Perhaps we could:

Detach Gallery

This gallery displays your post's attachments. Detaching will enable you to add, delete, or reorder images. However, new attachments will no longer be added automatically.

[Cancel] [Detach]

Well, barely shorter. Up to you!

@Mamaduka

Copy link
Copy Markdown
Member

Nit, I'd love if this could be a small dialog rather than be medium sized.

I thought all confirmation dialogs were the same size.

@jasmussen

Copy link
Copy Markdown
Contributor

Could be my mistake, it just looked wider in the screenshot. You can safely ignore me if that's not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Gallery Affects the Gallery Block - used to display groups of images [Package] Block library /packages/block-library [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gallery: Dynamic variation has confusing "Convert to ..." actions

3 participants