Skip to content

Editor: Remove sidebar tabs focus sync effect - #81020

Merged
Mamaduka merged 1 commit into
trunkfrom
remove/editor-sidebar-tab-effect
Jul 31, 2026
Merged

Editor: Remove sidebar tabs focus sync effect#81020
Mamaduka merged 1 commit into
trunkfrom
remove/editor-sidebar-tab-effect

Conversation

@Mamaduka

Copy link
Copy Markdown
Member

What?

Extracted from #81006.

PR removes the focus-sync effect that kept the focused and selected tabs together, along with the data-tab-id attributes and the ref plumbing that existed only to serve them.

Why?

The focus-sync effect was added in #58041 to fix a race when tabbing off the last block: focus moved to the active Block tab, then interfaceStore noticed focus had left the blocks and switched selection to Post, leaving one tab focused and the other selected. That race is no longer reachable. The post title and blocks are a single contenteditable writing flow, so there are no per-block tab stops to leave, and Tab exits straight to the sidebar. The navigation it depended on was removed in #65204, which also deleted the guard test #58041 had updated.

Testing Instructions

  1. Open a post. Toggle the settings sidebar and switch between the Post and Block tabs.
  2. Arrow between the two tabs and confirm selection does not follow focus; Enter or Space selects the focused tab.
  3. Select a block, press Tab into the sidebar, and confirm the Block tab is focused and selected. Click the title, press Tab, and confirm the same for the Post tab.
  4. Check panel scrolling and the sticky panel header.
  5. Enter and leave revision mode.

Testing Instructions for Keyboard

Same.

Use of AI Tools

Assisted by Claude.

@Mamaduka Mamaduka self-assigned this Jul 31, 2026
@Mamaduka Mamaduka added [Type] Code Quality Issues or PRs that relate to code quality [Package] Editor /packages/editor labels Jul 31, 2026
@github-actions

Copy link
Copy Markdown

Size Change: -143 B (0%)

Total Size: 7.76 MB

📦 View Changed
Filename Size Change
build/scripts/editor/index.min.js 500 kB -143 B (-0.03%)

compressed-size-action

@tyxla tyxla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Confirmed that since #79055 this effect is redundant, as controlled Tabs keep focus in sync when selectedTabId changes.

Nice cleanup!

🚢

const { Tabs } = unlock( componentsPrivateApis );

const SidebarHeader = ( _, ref ) => {
export default function SidebarHeader() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we'll need to add a CHANGELOG entry since we're technically changing the API here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's a local component and isn't used anywhere else.

@github-actions

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 <mamaduka@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>

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

@Mamaduka
Mamaduka merged commit 256fc11 into trunk Jul 31, 2026
57 of 60 checks passed
@Mamaduka
Mamaduka deleted the remove/editor-sidebar-tab-effect branch July 31, 2026 14:26
@github-actions github-actions Bot added this to the Gutenberg 23.8 milestone Jul 31, 2026
@ciampo

ciampo commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Thank you for cleaning this up, I missed it in my original Ariakit update PR 🙏

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

Labels

[Package] Editor /packages/editor [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants