Notifications: Give approve button more flex space for centering#108642
Notifications: Give approve button more flex space for centering#108642StevenDufresne wants to merge 3 commits intotrunkfrom
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
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.
eca6dde to
4032ee6
Compare
fushar
left a comment
There was a problem hiding this comment.
Works 👍 Though it might still be a problem in other languages 🤔
p-jackson
left a comment
There was a problem hiding this comment.
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; | |||
There was a problem hiding this comment.
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.
Part of DOTMSD-982
Proposed Changes
flex: 1.25vsflex: 1for other action buttons) so the longer "Approved" text is better centered.classNameprop toActionButtonso 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
Before (trunk)
After (this PR)
Pre-merge Checklist