Skip to content

Notifications: Give approve button more flex space for centering#108642

Open
StevenDufresne wants to merge 3 commits intotrunkfrom
fix/notification-approved-button-spacing
Open

Notifications: Give approve button more flex space for centering#108642
StevenDufresne wants to merge 3 commits intotrunkfrom
fix/notification-approved-button-spacing

Conversation

@StevenDufresne
Copy link
Contributor

@StevenDufresne StevenDufresne commented Feb 11, 2026

Part of DOTMSD-982

Proposed Changes

  • Give the notification approve/approved button slightly more flex space (flex: 1.25 vs flex: 1 for other action buttons) so the longer "Approved" text is better centered.
  • Add a className prop to ActionButton so individual buttons can be targeted with CSS.

Why are these changes being made?

The "Approved" button text in notification comment actions appeared off-center compared to the other buttons (Spam, Like, Edit) because the longer word didn't have enough space. Giving the approve button 25% more flex space provides better visual balance.

Testing Instructions

  1. Open the Dashboard notifications panel
  2. Navigate to a comment notification
  3. Observe the Approve/Approved button alignment relative to Spam, Like, and Edit buttons

Before (trunk)

before-approved-button

before-approved-full-notification

After (this PR)

after-approved-button

after-approved-full-notification

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@matticbot
Copy link
Contributor

matticbot commented Feb 11, 2026

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • agents-manager
  • help-center

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/notification-approved-button-spacing on your sandbox.

@StevenDufresne StevenDufresne requested a review from a team February 12, 2026 02:49
@StevenDufresne StevenDufresne marked this pull request as ready for review February 12, 2026 02:49
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 12, 2026
StevenDufresne and others added 3 commits February 12, 2026 14:55
The "Approved" text in notification comment actions appeared off-center
due to the longer word not having enough space. Give the approve button
flex: 1.25 (vs flex: 1 for other buttons) so it gets slightly more room.

Ref: DOTMSD-982

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These will be removed before merge.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move screenshots to external repo to keep binary files out of the codebase.
@StevenDufresne StevenDufresne force-pushed the fix/notification-approved-button-spacing branch from eca6dde to 4032ee6 Compare February 12, 2026 05:55
Copy link
Contributor

@fushar fushar left a comment

Choose a reason for hiding this comment

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

Works 👍 Though it might still be a problem in other languages 🤔

Copy link
Member

@p-jackson p-jackson left a comment

Choose a reason for hiding this comment

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

Yes the assumption that each button can be exactly the same size doesn't feel very language responsive.

But this change is also English-centric. Who's to say "Spam" isn't the largest label? Maybe the suggestion below would work?

Ideally each button label would be able to wrap too 😳 but that sounds even more complicated :D

@@ -291,6 +291,10 @@
.wpnc__action-link.has-icon.has-text {
flex: 1;
Copy link
Member

Choose a reason for hiding this comment

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

This is short for flex-grow: 1; flex-shrink: 1; flex-basis: 0%;. Starting each button from 0 and giving them all equal space.

What about going with

flex-grow: 1;
flex-shrink: 1;
flex-basis: auto;

Now each button gets to start with its natural width, and then then share out the remaining space from there.

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

Labels

[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants