Skip to content

Render snackbar notices on the AI Request Logs page - #1184

Merged
dkotter merged 4 commits into
developfrom
claude/confident-cannon-wtd2w1
Oct 15, 2026
Merged

dkotter merged 4 commits into
developfrom
claude/confident-cannon-wtd2w1

Conversation

@jeffpaul

@jeffpaul jeffpaul commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

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.tsx sends notices to the core/notices store with type: '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. The Page component from @wordpress/admin-ui has no notices UI, and nothing in src/ or routes/ mounts a SnackbarList. The ai-home route 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?

  • Renders SnackbarNotices from @wordpress/notices inside the app, scoped to an ai-request-logs notices 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-notices is loaded from WordPress core at runtime. SnackbarNotices first shipped in @wordpress/notices 5.40.0, and core's wp-notices in WordPress 7.0.3 (the plugin's minimum) and 7.0.4 both include it.
  • Added CSS in index.scss to 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.
  • In 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 @since docblocks.

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

  1. Enable the AI Request Logging experiment and open Tools → AI Request Logs.
  2. In Manage Logs, pick "All logs" → Delete → Yes, Delete. The snackbar "All logs have been deleted." appears at the bottom left of the content area, next to the admin menu.
  3. Seed some old logs, pick "Older than 90 days" and delete. You see "N log entries have been deleted." If there were no old logs, you see "No logs older than the selected age were found."
  4. Collapse the admin menu and resize the window. The snackbar stays clear of the menu.

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-env could not start. I ran the spec against the stock wordpress:latest image (WP 7.1.3) instead, without the OpenAI provider plugin and with a stub Twenty Twenty-One theme.

  • These passed: "Can enable the experiment…", "Tools menu does not list…" and "Deleting logs older than a chosen age…" (including the new 2 log entries have been deleted. assertion).
  • "Deleting all logs" depends on the OpenAI-backed row from an earlier test, so it couldn't run as written there. I checked its new assertion with a temporary copy that seeds a log row first, and it passed.
  • With the old index.tsx both 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.

Before After
Before: no notice appears after deleting logs After: "2 log entries have been deleted." snackbar at the bottom left of the content area, clear of the admin menu
No notice appears after deleting logs "2 log entries have been deleted." snackbar at the bottom left of the content area, clear of the admin menu

Changelog Entry

Fixed - Show success and error notices on the AI Request Logs screen, such as the confirmation after deleting logs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PMKS11fsFh9wnZD5iV2FcC


Generated by Claude Code

Open WordPress Playground Preview

@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.25%. Comparing base (5f69e26) to head (4b240e3).
⚠️ Report is 1 commits behind head on develop.

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           
Flag Coverage Δ
unit 82.25% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@jeffpaul jeffpaul added this to the 1.5.0 milestone Oct 15, 2026
@jeffpaul

Copy link
Copy Markdown
Member Author

Tested and works as expected, opening up for review.

@jeffpaul
jeffpaul marked this pull request as ready for review October 15, 2026 16:53
@jeffpaul
jeffpaul requested a review from a team October 15, 2026 16:53
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

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 props-bot label.

Unlinked Accounts

The 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.

Unlinked contributors: claude.

Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@jeffpaul jeffpaul moved this from Triage to Needs review in WordPress AI Roadmap Oct 15, 2026
@jeffpaul
jeffpaul requested a review from dkotter October 15, 2026 16:54
claude and others added 3 commits October 15, 2026 16:54
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
@jeffpaul
jeffpaul force-pushed the claude/confident-cannon-wtd2w1 branch from 12431bb to 0f33153 Compare October 15, 2026 16:54
…render notices specific to this page and not any notice that has been set
@dkotter
dkotter merged commit a465300 into develop Oct 15, 2026
36 of 37 checks passed
@dkotter
dkotter deleted the claude/confident-cannon-wtd2w1 branch October 15, 2026 18:20
@github-project-automation github-project-automation Bot moved this from Needs review to Done in WordPress AI Roadmap Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants