VideoPress: Move caption manager outcome messages to snackbars#50430
Open
obenland wants to merge 2 commits into
Open
VideoPress: Move caption manager outcome messages to snackbars#50430obenland wants to merge 2 commits into
obenland wants to merge 2 commits into
Conversation
The caption manager funneled every message — successes, async/API failures, and form validation — through a single inline notice. Split that into two channels: transient outcomes and async errors now surface as snackbars rendered by SnackbarList at the bottom of the modal, while sticky form-validation errors stay inline where the user is acting. Adds a use-caption-snackbars hook to own the snackbar list, routes the mutation hook and modal flows to notify()/setValidationNotice() accordingly, removes the now-unused NoticeState type, and updates the tests to assert moved messages on the snackbar list. Claude-Session: https://claude.ai/code/session_017px3yqTVgtB3RJXZwB5yFk
Contributor
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Contributor
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 2 files.
1 file is newly checked for coverage.
|
The caption manager modal returns null while closed but stays mounted, so its snackbar state survives close→reopen. An undismissed outcome or error snackbar would reappear on the next open. Clear the list in the open-reset effect, alongside the existing validation-notice reset. Claude-Session: https://claude.ai/code/session_01R3bxjgvnb5f8KG4PuRksGg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
The VideoPress caption manager modal previously funneled every message — success confirmations, async/API failures, and form-validation errors — through a single inline
<Notice>at the top of the modal. This splits that into two purpose-built channels:SnackbarListat the bottom of the modal) for transient outcomes and async/API errors: publish/upload/save/delete/download results, track-list and draft load failures, and "Subtitle text imported." Each bubble auto-dismisses after ~6s.Implementation notes:
use-caption-snackbarshook owning the{ id, content }[]list withnotify()/removeSnackbar();SnackbarListrenders inside the modal so bubbles sit above modal content with no editor z-index conflicts.use-track-mutationstakes anotifycallback instead ofsetNotice; its pre-mutation notice-clears are dropped (snackbars self-expire).NoticeStatetype.ConfirmationOverlayis unchanged — it's a dialog, not a notice.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
https://claude.ai/code/session_017px3yqTVgtB3RJXZwB5yFk