Repository navigation
Render snackbar notices on the AI Request Logs page - #1184
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1184 +/- ##
==========================================
Coverage 82.25% 82.25%
Complexity 3403 3403
==========================================
Files 136 136
Lines 13225 13225
==========================================
Hits 10878 10878
Misses 2347 2347
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
|
Tested and works as expected, opening up for review. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @claude. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
The page created snackbar notices (delete confirmations and load errors) but nothing rendered them: the admin-ui Page component has no notices UI. Add a SnackbarList wired to the core/notices store, pin it to the bottom inline-start of the content area clear of the admin menu, and assert the success notices in the delete E2E tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jeffrey Paul <jeffpaul@hotmail.com> Claude-Session: https://claude.ai/code/session_01PMKS11fsFh9wnZD5iV2FcC
Hosts the before/after screenshots referenced from the PR description. Removed in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jeffrey Paul <jeffpaul@hotmail.com> Claude-Session: https://claude.ai/code/session_01PMKS11fsFh9wnZD5iV2FcC
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jeffrey Paul <jeffpaul@hotmail.com> Claude-Session: https://claude.ai/code/session_01PMKS11fsFh9wnZD5iV2FcC
12431bb to
0f33153
Compare
…render notices specific to this page and not any notice that has been set
What?
Follow up to #1182
Renders the snackbar notices that the AI Request Logs admin page already creates, so delete confirmations and load errors actually appear.
Why?
src/admin/ai-request-logs/index.tsxsends notices to thecore/noticesstore withtype: 'snackbar'. These include "All logs have been deleted.", "N log entries have been deleted.", "No logs older than the selected age were found.", "Unable to load summary data.", "Unable to load filter metadata." and delete failures. Nothing on the page displays them. ThePagecomponent from@wordpress/admin-uihas no notices UI, and nothing insrc/orroutes/mounts aSnackbarList. Theai-homeroute gets its snackbars from the route shell, which this classic admin page doesn't use. So after deleting logs, no notice text ever reached the DOM.How?
SnackbarNoticesfrom@wordpress/noticesinside the app, scoped to anai-request-logsnotices context.showNotice()now creates its notices in that context, so the page only shows its own snackbars and not global notices that other scripts create.wp-noticesis loaded from WordPress core at runtime.SnackbarNoticesfirst shipped in@wordpress/notices5.40.0, and core'swp-noticesin WordPress 7.0.3 (the plugin's minimum) and 7.0.4 both include it.index.scssto fix the list to the bottom inline-start of the content area. It is offset by the admin menu width and follows the full, auto-fold and folded menu states, like core's editor snackbars. It uses logical properties so it works in RTL.ai-request-logging.spec.js, both delete tests now also assert the success notice text inside.components-snackbar. The DELETE response checks are kept.No PHP changes, so there are no new
@sincedocblocks.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Used for: Implementation, tests and PR description, done from a task brief; to be reviewed by the PR author.
Testing Instructions
Checks run locally:
npm run lint:js(0 errors),npm run typecheck,npm run build.E2E: the session's network blocked wordpress.org and the Debian/Alpine mirrors, so
wp-envcould not start. I ran the spec against the stockwordpress:latestimage (WP 7.1.3) instead, without the OpenAI provider plugin and with a stub Twenty Twenty-One theme.2 log entries have been deleted.assertion).index.tsxboth new notice assertions fail ("element(s) not found"). With this change they pass.CI will run the full spec under
wp-env.Screenshots or screencast
Both shots were taken about 1.5s after confirming "Older than 90 days" → Yes, Delete, with two of the three seeded logs older than 90 days.
Changelog Entry
🤖 Generated with Claude Code
https://claude.ai/code/session_01PMKS11fsFh9wnZD5iV2FcC
Generated by Claude Code