Automattic / Automattic/jetpack

Sortable block editor sidebar extensions

Open
#16,877 1 comment 0 reactions 0 assignees View on GitHub
[Extension] Social Previews [Feature] Publicize [Feature] SEO Tools [Feature] Sharing [Feature] Shortlinks [Focus] Blocks [Pri] Normal [Status] Blocked / Hold Enhancement
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

#### Is your feature request related to a problem? Please describe.
Jetpack has its sidebar for block editor extensions. We use Slot/Fill mechanism to fill it with content but we have no way to sort them, eg: put new/important feature at the very top.

#### Describe the solution you'd like
Some way to give each item a priority.

#### Describe alternatives you've considered
Introduce some sort of prioritization for the entire `registerJetpackPlugin`, not just the sidebar panel. The order of things in the sidebar is equal to the order in which plugins get registered, which I believe will rely solely on the position of the code in the built source code.

#### Additional context
It's using: https://developer.wordpress.org/block-editor/components/slot-fill/

Source for the sidebar: https://github.com/Automattic/jetpack/blob/master/extensions/shared/jetpack-plugin-sidebar.js

There is a theoretical capability to sort the `fills` array before rendering it in `jetpack-plugin-sidebar.js` but there seems to be no API to tell which fill is which and what their priority is. The array has react elements directly in it and if we read from those, I wonder if that would be too brittle.

Contributor guide

Open the contributing guide

Research direction

Start with extensions/shared/jetpack-plugin-sidebar.js and the WordPress Slot/Fill documentation linked in the issue; inspect how fills are collected and rendered. Done would require a defined way for sidebar extensions to declare priority and for the sidebar to render them in that order, with the API behavior clarified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.