Skip to content

File Block: Replace on-mount downloadButtonText effect with a default variation#79236

Merged
Mamaduka merged 1 commit into
trunkfrom
remove/file-block-mount-effect
Jun 16, 2026
Merged

File Block: Replace on-mount downloadButtonText effect with a default variation#79236
Mamaduka merged 1 commit into
trunkfrom
remove/file-block-mount-effect

Conversation

@Mamaduka

@Mamaduka Mamaduka commented Jun 16, 2026

Copy link
Copy Markdown
Member

What?

PR replaced the on-mount useEffect that imperatively set the localized downloadButtonText default ("Download") with a declarative isDefault block variation, mirroring the Search block pattern.

This also fixed an odd bug with the File block in StrickMode, when reloading a newly saved post, it becomes dirty again. Related #73378.

P.S. I've wanted to remove this effect for a while. Props @t-hamano for suggesting this method in a different PR.

Testing Instructions

  1. Open a post or page.
  2. Insert a File block and select a file.
  3. Confirm that the download button default text is correctly set.

Testing Instructions for Keyboard

Same.

Screencast

CleanShot.2026-06-16.at.17.25.05.mp4

Use of AI Tools

Assisted by Claude.

@Mamaduka Mamaduka self-assigned this Jun 16, 2026
@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Block] File Affects the File Block labels Jun 16, 2026
@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Jun 16, 2026
@github-actions

github-actions Bot commented Jun 16, 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: Mamaduka <[email protected]>
Co-authored-by: t-hamano <[email protected]>

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

Size Change: +46 B (0%)

Total Size: 8.59 MB

📦 View Changed
Filename Size Change
build/scripts/block-library/index.min.js 324 kB +46 B (+0.01%)

compressed-size-action

@t-hamano t-hamano left a comment

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.

Nice enhancement 👍

@github-actions

Copy link
Copy Markdown

Flaky tests detected in 97d1cf4.
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/27619317820
📝 Reported issues:

@Mamaduka Mamaduka merged commit b786c86 into trunk Jun 16, 2026
80 of 86 checks passed
@Mamaduka Mamaduka deleted the remove/file-block-mount-effect branch June 16, 2026 14:25
@github-actions github-actions Bot added this to the Gutenberg 23.5 milestone Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] File Affects the File Block [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants