Skip to content

Conversation

@karthick-murugan
Copy link
Contributor

@karthick-murugan karthick-murugan commented Sep 19, 2025

Closes #71751

What?

This PR updates the flashBlock action in packages/block-editor/src/store/actions.js to support a configurable timeout duration.

Previously, the highlight duration was fixed at 150ms, which could feel too fast in some contexts. With this update, flashBlock accepts an optional timeout parameter, allowing developers to control how long the highlight remains visible.

Why?

  1. Provides flexibility for different UX needs (e.g., comments sidebar navigation vs. quick copy confirmation).
  2. Keeps backward compatibility by defaulting to 150ms when no timeout is specified.

Testing Instructions

Trigger flashBlock( clientId ) → should behave as before (150ms).

Trigger flashBlock( clientId, 1000 ) → highlight should remain visible for ~1 second.

cc @t-hamano

@github-actions
Copy link

github-actions bot commented Sep 19, 2025

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: karthick-murugan <[email protected]>
Co-authored-by: adamsilverstein <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: Mamaduka <[email protected]>

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

@Mamaduka Mamaduka self-requested a review September 19, 2025 07:47
@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Package] Block editor /packages/block-editor labels Sep 19, 2025
Copy link
Member

@adamsilverstein adamsilverstein left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@adamsilverstein
Copy link
Member

@Mamaduka / @t-hamano are we ok to merge this?

@t-hamano
Copy link
Contributor

I'm in favor of this enhancement, but I want to be careful because it's a public API. Let's mention the people involved in #22186, where the flashBlock was added. cc @mcsf @youknowriad @ellatrix

@Mamaduka
Copy link
Member

This should be good to merge. The default behavior remains the same, while allowing duration to be changed.

@t-hamano
Copy link
Contributor

@Mamaduka Thanks for the feedback! Well, let's merge this PR.

@Mamaduka Mamaduka merged commit 5f0cf04 into WordPress:trunk Sep 23, 2025
75 of 81 checks passed
@karthick-murugan karthick-murugan deleted the flashblock-api-updates branch September 23, 2025 04:12
@github-actions github-actions bot added this to the Gutenberg 21.8 milestone Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block editor /packages/block-editor [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make flashBlock duration configurable

4 participants