Skip to content

Interfaces: make edit sidebar resizable #70616

Open
DarkMatter-999 wants to merge 7 commits intoWordPress:trunkfrom
DarkMatter-999:try/resizable-edit-sidebar
Open

Interfaces: make edit sidebar resizable #70616
DarkMatter-999 wants to merge 7 commits intoWordPress:trunkfrom
DarkMatter-999:try/resizable-edit-sidebar

Conversation

@DarkMatter-999
Copy link

What?

Closes #64664

This PR adds the ability to modify the sidebar width either manually or programatically.

Why?

Right now, the editor does not have the ability to change sidebar width, this PR adds support for this.

How?

This PR created a resize-handle which can be dragged using mouse or through keyboard using arrow keys to change the width of the sidebar.

Testing Instructions

  1. Open the Block Editor.
  2. Grab the left edge of the sidebar
  3. Start dragging the edge to change the width and match your preference.

Testing Instructions for Keyboard

  1. Tab and reach to the resize-handle (one less tab from the Post and Block buttons bar)
  2. Once in focus use arrow keys to modify its width.

Screenshots or screencast

Exposed API to programmatically change sidebar width.

// Get sidebar width.
wp.data.select('core/interface').getComplementaryAreaWidth('core');

// Set sidebar width.
wp.data.dispatch('core/interface').setComplementaryAreaWidth('core', 500);
Screen.Recording.2025-07-04.at.3.01.11.PM.mov

Before

Screen.Recording.2025-07-04.at.3.00.00.PM.mov

After

Screen.Recording.2025-07-04.at.2.59.14.PM.mp4

@github-actions
Copy link

github-actions bot commented Jul 4, 2025

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @DarkMatter-999! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jul 4, 2025
@DarkMatter-999 DarkMatter-999 marked this pull request as ready for review July 4, 2025 10:01
@github-actions
Copy link

github-actions bot commented Jul 4, 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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @Sirjazzfeetz, @vitaliikaplia.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Unlinked contributors: Sirjazzfeetz, vitaliikaplia.

Co-authored-by: DarkMatter-999 <lakshyajeet@git.wordpress.org>
Co-authored-by: yyppsk <pranjalpratapsingh@git.wordpress.org>
Co-authored-by: noisysocks <noisysocks@git.wordpress.org>
Co-authored-by: ndiego <ndiego@git.wordpress.org>
Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org>
Co-authored-by: yratof <yratof@git.wordpress.org>
Co-authored-by: Zealth57 <elrae@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

github-actions bot commented Jul 4, 2025

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core, Gutenberg Plugin.
  • Labels found: General Interface, First-time Contributor.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@t-hamano t-hamano added the General Interface Parts of the UI which don't fall neatly under other labels. label Jul 4, 2025
@yyppsk
Copy link

yyppsk commented Aug 17, 2025

Hey @DarkMatter-999 , I have tested this PR in my local environment and below I have given a detailed report for the outcome.

What: Adds the ability to modify the Block Editor sidebar width manually (drag) and programmatically (API).
Why: The editor previously could not change the sidebar width.
How: Introduces a resize-handle at the sidebar’s left edge; supports mouse drag and keyboard arrow keys.


Test Environment

  • OS: macOS

  • Browsers:

    • Firefox 141.0.3 (aarch64)

    • Chrome latest

    • Safari latest


Test Plan & Results

Pointer (Mouse/Trackpad) Resize

Steps

  1. Open the Block Editor.

  2. Hover the left edge of the sidebar until the resize cursor appears.

  3. Drag to adjust the width to preference.

Result

  • Width adjusts smoothly.

  • No layout breakage observed.

  • Consistent behavior across Firefox, Chrome, and Safari on macOS.

API: Programmatic Control

// Get sidebar width
wp.data.select('core/interface').getComplementaryAreaWidth('core');

// Set sidebar width (example: 500px)
wp.data.dispatch('core/interface').setComplementaryAreaWidth('core', 500);



Observations

  • Dragging does not cause visual regressions or layout shifts.

  • Behavior appears stable and consistent across tested environments.

  • A post-patch video demonstrating the behavior is attached .


Video Test :

Screen.Recording.2025-08-17.at.10.16.03.PM.mov

Screenshots

Firefox

Screenshot 2025-08-17 at 10 11 30 PM

Safari

Screenshot 2025-08-17 at 10 11 00 PM

Result of my testing

Result: Feature works as expected for pointer resizing with no layout breakage observed.

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

Labels

First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository General Interface Parts of the UI which don't fall neatly under other labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow the sidebar to be a more flexible width

3 participants