Subscribers: Add success notice for deleted subscriber#101326
Subscribers: Add success notice for deleted subscriber#101326allilevine merged 6 commits intotrunkfrom
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~132 bytes added 📈 [gzipped]) DetailsSections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~140 bytes added 📈 [gzipped]) DetailsReact components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
|
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 |
There was a problem hiding this comment.
The only change here is adding the ref.
dcalhoun
left a comment
There was a problem hiding this comment.
Thank you for exploring a fix for this! 🙇🏻♂️
I agree with the spirit of these changes, but, as noted in an inline comment, I'm uncertain if the new UX is better than the previous version. I'm curious to hear your thoughts on my findings.
Unrelated to the proposed changes: I was able to get site's subscribers list into some really odd states—where the total count did not match the subscribers list and I often could not remove subscribers because they supposedly didn't exist. I'm not sure if it was the nature of the emails I used (e.g., name+test1@domain.com, name+test2@domain.com) or the speed at which I was adding/removing subscribers.
Refreshing the page would only sporadically fix the issue. Generally, waiting a while and adding an additional subscriber would cause some (not all) of the previous subscribers to show up in the list.
There was a problem hiding this comment.
From my testing, I do not hear this message via screen reader—both with or without this logic. That isn't too surprising to me, as screen readers can be quite selective as to what they read aloud depending on what else is going on at the same time. It is quite possible updates to the surrounding UI—e.g., the DataViews—is competing for attention. Do you consistently here this read aloud for screen readers?
I'll note the WordPress Notice component already announces the contained text. In theory, this logic should not be necessary.
There was a problem hiding this comment.
Do you consistently here this read aloud for screen readers?
I did consistently hear this read testing with Brave + VoiceOver. But I can remove it in favor of the Notice. Thanks!
There was a problem hiding this comment.
Ideally, we shouldn't need to handle focus ourselves, as the WordPress Modal component provides focusOnMount and automatically hides content outside the modal. However, I can reproduce the reported console error—where the root id="wpcom" container is not hidden from screen readers—when testing the Gutenberg Storybook, which is unfortunate.
From my testing, the proposed focus logic may cause problems more disruptive than the original problem. Namely, I note this new logic:
- Prevents moving focus to the modal close (X) button;
- Prevents text selection within the modal;
- And fails to move focus back to the previous focused element on modal dismissal.
I'm not confident resolving the original console error (and the erroneously visible non-modal content) is worth introducing these new problems. I think the current production version is more accessible.
WDYT?
There was a problem hiding this comment.
I'm also finding that the new implementation doesn't capture focus when Tabbing through:
Screen.Recording.2025-03-14.at.8.16.44.AM.mov
I agree that I don't think this tradeoff is worth fixing the console error. And it seems that @dcalhoun found that the error might need to fixed upstream in the Modal component.
There was a problem hiding this comment.
I'm not confident resolving the original console error (and the erroneously visible non-modal content) is worth introducing these new problems. I think the current production version is more accessible.
Thank you for testing! 🙌 In that case, I'll revert the focus management and we'll need to live with it as is until this is fixed upstream.
@dcalhoun Thanks for raising this, we have an issue here: https://github.com/Automattic/loop/issues/486 I've added this report. |
3c788ff to
70ba128
Compare
|
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/17303543 Some locales (Hebrew) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday. Thank you @allilevine for including a screenshot in the description! This is really helpful for our translators. |
|
These strings: cause some issues in Korean where there is no explicit plural form and the plurality is inferred from the count. A better solution would be to use something like this pseudocode: which would take care of the singular subscriber case and cover all the possible plural forms. |
@dlind1 I'm confused since I got the opposite feedback here: #99177 (comment) Should the pseudocode approach be used when there are different variables? Or when the strings are different enough? |
The feedback in #99177 is correct. When one string refers to a quantity and could contain singular/plural nouns, like |
|
To add to that, when using translations with plurals the same placeholders should be used in the singular and the plural forms 99% of the time, with maybe a couple exceptions. |
70ba128 to
3b5b5d2
Compare
|
@dlind1 Thanks for explaining! 🙌 I've updated the strings: wp-calypso/client/my-sites/subscribers/hooks/use-unsubscribe-modal.ts Lines 51 to 67 in 0a9cda8 Let me know if more changes are needed. |
Looks great, thank you! 🎉 |
…ent when subscriber is deleted.
0a9cda8 to
93ee394
Compare
* Handle focus management in confirm modal, and add voiceover announcement when subscriber is deleted. * Translate announcement. * Add more translation context and a success notice. * Revert attempt 2. * Separate the singular and plural translations. * Add all countable cases.


Related to https://github.com/Automattic/loop/issues/488
Proposed Changes
Multiple subscribers deleted:
Note we've decided not to fix the original aria-hidden console warning. Adding focus management made the experience worse. The issue will need to be fixed upstream in core.
Why are these changes being made?
Testing Instructions
Pre-merge Checklist