Skip to content

Boot: Use the resting brand color for the current sidebar item - #87453

Merged
ciampo merged 2 commits into
trunkfrom
extract/sidebar-current-item-82294
Nov 26, 2026
Merged

ciampo merged 2 commits into
trunkfrom
extract/sidebar-current-item-82294

Conversation

@ciampo

@ciampo ciampo commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Extracted from #82294. This change can land on trunk independently.

What?

In the Site Editor v2 sidebar, color the current item with the resting brand color. Hover and focus keep the active brand color, so hovering any item, including the current one, changes its color.

Why?

The sidebar used foreground-interactive-brand-active for both the current item and hover. Hovering the current item gave no feedback, and a hovered item looked like a second current item. The current item is a persistent selection, not an interaction state, so it belongs on the resting token.

Note

This is mostly a change to improve the Sidebar (ie. differentiate between "selected" item and hovered/focus items) while respecting its current visual language, so that it can be merged quickly and enable #82294.
IMO as a later follow-up, we should analyize the "sidebar navigation" pattern, extract it as a UI component, and re-discuss its selected and hover/focus item states.

How?

The current item (aria-current or data-status="active") uses foreground-interactive-brand. The hover and focus rule comes after it, so it wins on the current item too. The classic site editor sidebar marks its current item with neutral colors and a background, so it does not need a matching change.

In every admin color scheme, the current item now has less contrast than the other items, because the resting brand color is the 4.5:1 brand text step. Against the real sidebar background, it ranges from 4.63:1 in Light (#0069A6 on #E1E5E4) to 7.86:1 in Modern. In Ectoplasm it is #B8C290 at 5.72:1, and the other items are #F0F0F2 at 9.46:1. The current item stays bold. Reviewers: is a brand-colored current item, instead of the brightest one, the signal we want?

Testing Instructions

  1. Enable the gutenberg-extensible-site-editor experiment and choose the Ectoplasm admin color scheme in your profile.
  2. Open Appearance → Design, then open Pages.
  3. Check that Pages is tinted with the brand color. Hover Templates and check that it uses a lighter brand color than Pages. Hover Pages and check that its color changes too.
  4. Repeat with the Light and Modern schemes.

Testing Instructions for Keyboard

Tab through the sidebar items. Each item with keyboard focus uses the active brand color, including the current item.

Screenshots

Both columns come from trunk at 5ba8aa21255. After adds this change. Each capture shows the v2 Pages screen. Pages is the current item, the pointer hovers Templates, and the other items are at rest. The labels show the measured text colors.

Before After
Ectoplasm on trunk: current Pages #EDF7C3, hovered Templates #EDF7C3 Ectoplasm with this PR: current Pages #B8C290, hovered Templates #EDF7C3
Light on trunk: current Pages #002041, hovered Templates #002041 Light with this PR: current Pages #0069A6, hovered Templates #002041
Sidebar in the other admin color schemes
Before After
Modern on trunk: current Pages #E4F0FF, hovered Templates #E4F0FF Modern with this PR: current Pages #8FB0FF, hovered Templates #E4F0FF
Default (Fresh) on trunk: current Pages #D5F5FF, hovered Templates #D5F5FF Default (Fresh) with this PR: current Pages #5EBEFF, hovered Templates #D5F5FF
Midnight on trunk: current Pages #FFE6E0, hovered Templates #FFE6E0 Midnight with this PR: current Pages #FF9788, hovered Templates #FFE6E0
Coffee on trunk: current Pages #FFE8CC, hovered Templates #FFE8CC Coffee with this PR: current Pages #F5C6A1, hovered Templates #FFE8CC
Ocean on trunk: current Pages #D5FDD7, hovered Templates #D5FDD7 Ocean with this PR: current Pages #B3D9B4, hovered Templates #D5FDD7
Blue on trunk: current Pages #D8F4FF, hovered Templates #D8F4FF Blue with this PR: current Pages #9CD6FF, hovered Templates #D8F4FF
Sunrise on trunk: current Pages #FFE8CD, hovered Templates #FFE8CD Sunrise with this PR: current Pages #FFC48E, hovered Templates #FFE8CD

Use of AI Tools

Claude Code extracted this change from #82294, captured the screenshots, and drafted this description.

The current item is a persistent selection, not an interaction state.
Keep the active brand color for hover and focus, so hovering the current
item also changes its color.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ciampo ciampo added [Type] Enhancement A suggestion for improvement. [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Package] Boot /packages/boot labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

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

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: +5 B (0%)

Total Size: 8.72 MB

📦 View Changed
Filename Size Change
build/modules/boot/index.min.js 51.8 kB +13 B (+0.03%)
build/scripts/editor/index.min.js 575 kB -8 B (0%)

03e511a Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric c4c1bf6 trunk % Change
timeToFirstByte 54.6 ms +8.52% -2.56% 55.85 ms +3.85% -5.1% -2.24%
largestContentfulPaint 88 ms +4.55% -6.82% 84 ms +4.76% -0% 4.76%
lcpMinusTtfb 29.4 ms +29.08% -6.97% 27.9 ms +13.08% -4.3% 5.38%
wpBeforeTemplate 28.47 ms +4.14% -0.88% 28.8 ms +5.52% -3.09% -1.15%
wpTemplate 22.44 ms +4.23% -5.79% 22.15 ms +4.65% -5.01% 1.31%
wpTotal 50.85 ms +8.77% -3.13% 51.91 ms +4.12% -5.26% -2.04%
wpMemoryUsage 7.75 MB +0% -0% 7.72 MB +0% -0% 0.45%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric c4c1bf6 trunk % Change
timeToFirstByte 46.15 ms +6.83% -3.36% 46.15 ms +8.99% -4.12% 0%
largestContentfulPaint 80 ms +7.5% -0% 80 ms +5% -2.5% 0%
lcpMinusTtfb 34.6 ms +2.89% -2.17% 34.3 ms +4.96% -6.71% 0.87%
wpBeforeTemplate 26.2 ms +7.33% -0.92% 26.35 ms +6.26% -2.28% -0.57%
wpTemplate 16.74 ms +2.33% -6.27% 16.39 ms +7.14% -3.66% 2.14%
wpTotal 43.04 ms +7.32% -3.09% 42.94 ms +9.69% -3.54% 0.23%
wpMemoryUsage 6.44 MB +0% -0% 6.41 MB +0% -0% 0.56%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric c4c1bf6 trunk % Change
mediaProcessingJpeg 400.3 ms +0.68% -1.56% 395.7 ms +0.78% -0.38% 1.16%
mediaProcessingAvif 6109.28 ms +0.9% -0.11% 6066.75 ms +0.5% -0.23% 0.7%
mediaProcessingJpegToAvif 4216.36 ms +0.14% -0.07% 4193.24 ms +0.14% -0.04% 0.55%

media-upload

Metric c4c1bf6 trunk % Change
jpegUploadProcessing 1494.75 ms +1.8% -0.62% 1500.11 ms +31.09% -0.38% -0.36%
pngUploadProcessing 272.47 ms +3.16% -6.05% 263.09 ms +1.07% -1.22% 3.57%
largeJpegUploadProcessing 1488.82 ms +1.19% -0.95% 1529.78 ms +28.43% -2.05% -2.68%
multipleImageUploadProcessing 2102.94 ms +0.86% -1.2% 2049.76 ms +1.28% -16.74% 2.59%

post-editor

Metric c4c1bf6 trunk % Change
serverResponse 326.88 ms +0.69% -6.86% 322.85 ms +0.83% -10.31% 1.25%
firstPaint 351.78 ms +1.93% -6.36% 327.26 ms +9.31% -3.85% 7.49%
domContentLoaded 640.48 ms +9.52% -1.71% 630.9 ms +1% -0.19% 1.52%
loaded 641.4 ms +9.5% -1.74% 631.68 ms +1% -0.19% 1.54%
firstContentfulPaint 361.61 ms +14.54% -1.42% 360.69 ms +0.52% -0.82% 0.26%
firstBlock 1725.05 ms +3.97% -0.98% 1709.55 ms +1.44% -0.67% 0.91%
type 15.74 ms +3.68% -8.01% 13.85 ms +5.85% -8.52% 13.65%
typeWithoutInspector 15.9 ms +5.66% -8.3% 14.21 ms +5.07% -7.53% 11.89%
typeWithTopToolbar 18.97 ms +4.69% -4.27% 18.64 ms +6.6% -6.28% 1.77%
typeContainer 7.04 ms +4.12% -12.36% 6.75 ms +2.07% -8.44% 4.3%
focus 87.58 ms +4.09% -2.68% 81.32 ms +2.98% -5.26% 7.7%
firstFocus 216.63 ms +0% -0% 198.77 ms +0% -0% 8.99%
selectAll 294.14 ms +8.13% -0.47% 294.63 ms +0.11% -4.33% -0.17%
undo 24.42 ms +4.87% -4.34% 23.95 ms +10.23% -3.59% 1.96%
listViewOpen 31.56 ms +6.43% -4.88% 29.28 ms +4.34% -6.11% 7.79%
inserterOpen 33.91 ms +8.14% -6.16% 31.82 ms +6.16% -5.53% 6.57%
inserterHover 9.2 ms +8.04% -5.22% 9.13 ms +7.23% -2.63% 0.77%
inserterSearch 7.39 ms +1.62% -6.63% 6.69 ms +3.14% -4.78% 10.46%
loadPatterns 507.42 ms +6.24% -4.81% 497.73 ms +4.9% -1.91% 1.95%
wpTotal 318.27 ms +0.69% -7.03% 314.35 ms +0.87% -10.57% 1.25%
wpMemoryUsage 14.81 MB +0% -0% 14.76 MB +0% -0% 0.33%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric c4c1bf6 trunk % Change
serverResponse 318.17 ms +4.02% -7.22% 318.54 ms +2.19% -9.5% -0.12%
firstPaint 358.32 ms +13.28% -7.12% 389.44 ms +4.93% -12.5% -7.99%
domContentLoaded 709.79 ms +4.5% -2.59% 690.32 ms +1.75% -2.1% 2.82%
loaded 710.61 ms +4.49% -2.58% 691.16 ms +1.73% -2.11% 2.81%
firstContentfulPaint 406.02 ms +5.1% -4.93% 392.98 ms +3.98% -1.57% 3.32%
firstBlock 2116.27 ms +8.12% -0.69% 2074.93 ms +0.67% -1.2% 1.99%
type 16.98 ms +8.89% -12.13% 15.34 ms +3.91% -5.67% 10.69%
navigate 96.21 ms +2.28% -7.42% 94.62 ms +12.88% -1.46% 1.68%
loadPatterns 1162.61 ms +4.93% -3.99% 1077.64 ms +13.41% -10.02% 7.88%
loadPages 933.45 ms +8.08% -2.41% 935.06 ms +6.99% -0.93% -0.17%
wpTotal 309.2 ms +4.04% -7.25% 310.19 ms +1.95% -9.77% -0.32%
wpMemoryUsage 12.84 MB +0% -0% 12.80 MB +0% -0% 0.28%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

03e511a Run

🏁 Flaky tests

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.

Navigates the list via UP/DOWN arrow keys from action buttons in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' })
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' }) with timeout 5000ms
  - waiting for getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' })
    14 × locator resolved to <button type="button" tabindex="-1" class="components-button is-small" id="view-list-0-179-primary-action-edit-post">Edit</button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:243:5

03e511a Run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ciampo ciampo self-assigned this Nov 26, 2026
@ciampo
ciampo marked this pull request as ready for review November 26, 2026 10:03
@ciampo
ciampo requested review from a team and Mamaduka November 26, 2026 10:03

@Mamaduka Mamaduka 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.

Looks good. Tested with couple admin color schemes.

@ciampo
ciampo enabled auto-merge (squash) November 26, 2026 10:17
@ciampo
ciampo merged commit fc34372 into trunk Nov 26, 2026
103 of 104 checks passed
@ciampo
ciampo deleted the extract/sidebar-current-item-82294 branch November 26, 2026 10:17
@github-actions github-actions Bot added this to the Gutenberg 24.6 milestone Nov 26, 2026
Vedant-Gandhi pushed a commit to Vedant-Gandhi/gutenberg that referenced this pull request Nov 30, 2026
…ress#87453)

* Boot: Use the resting brand color for the current sidebar item

The current item is a persistent selection, not an interaction state.
Keep the active brand color for hover and focus, so hovering the current
item also changes its color.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Boot: Link the changelog entry to its pull request

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Package] Boot /packages/boot [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants