Remove redundant onNavigateToEntityRecord handling#76523
Conversation
The filter excluding onNavigateToEntityRecord from the spread and the explicit re-assignment are no longer needed. After PR #75371 removed the wrapping logic, onNavigateToEntityRecord now passes through directly. Since it's in the BLOCK_EDITOR_SETTINGS allowlist, it's already included via the Object.fromEntries spread. Co-Authored-By: Claude Haiku 4.5 <[email protected]>
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: -10 B (0%) Total Size: 8.75 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in cf27c54. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23134642126
|
| hasFixedToolbar, | ||
| isDistractionFree, | ||
| keepCaretInsideBlock, | ||
| onNavigateToEntityRecord: settings.onNavigateToEntityRecord, |
There was a problem hiding this comment.
Should it be removed from the dependencies too?
There was a problem hiding this comment.
I think so, the linter was complaining about the deps in this hook.
There was a problem hiding this comment.
I don't think it should be removed from the dependencies as otherwise the settings won't update when it changes.
What?
Removes the now-unnecessary filter and explicit re-assignment of
onNavigateToEntityRecordfromuseBlockEditorSettings. Addresses #75371 (comment)Why?
After PR #75371 removed the wrapping logic for
onNavigateToEntityRecord, the setting now passes through directly. SinceonNavigateToEntityRecordis already in theBLOCK_EDITOR_SETTINGSallowlist, the filter excluding it and the explicit re-assignment are redundant.How?
Removed the
.filter( ( [ key ] ) => key !== 'onNavigateToEntityRecord' )and its comment, along with the explicitonNavigateToEntityRecord: settings.onNavigateToEntityRecordassignment. The setting is now handled purely through theObject.fromEntriesspread of allowed keys.