close
Skip to content

[Request Logs]: Fix focus loss on interaction with Purge Actions#599

Merged
dkotter merged 2 commits into
WordPress:developfrom
yogeshbhutkar:request-logs/fix-focus-lost-on-button-press
May 21, 2026
Merged

[Request Logs]: Fix focus loss on interaction with Purge Actions#599
dkotter merged 2 commits into
WordPress:developfrom
yogeshbhutkar:request-logs/fix-focus-lost-on-button-press

Conversation

@yogeshbhutkar
Copy link
Copy Markdown
Contributor

@yogeshbhutkar yogeshbhutkar commented May 21, 2026

What, and Why?

Adds focus management for the request logs purge confirmation flow. When Purge All Logs is clicked, focus moves to Cancel in the confirmation UI. When either Cancel or Yes, Purge All closes the confirmation UI, focus returns to Purge All Logs.

See #589

How?

Uses simple callback refs to focus conditionally rendered buttons as they mount.

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: Initial code skeleton; final implementation was reviewed and edited by me.

Testing Instructions

  1. Enable the "AI Request Logging" Experiment from Settings → AI.
  2. Navigate to Tools → AI Request Logging.
  3. Verify that no focus loss occurs when interacting with the confirmation buttons, including focus restoration after clicking Cancel.

Screencast

Before

before.mov

After

after.mov

Changelog Entry

Fixed - Focus loss issues when interacting with Purge actions in the Request Logs experiments page.
Fixed - Disabled the “Purge All” button when no logs are available to purge.

Open WordPress Playground Preview

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.18%. Comparing base (246680c) to head (91d96ce).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #599   +/-   ##
==========================================
  Coverage      73.18%   73.18%           
  Complexity      1731     1731           
==========================================
  Files             85       85           
  Lines           7473     7473           
==========================================
  Hits            5469     5469           
  Misses          2004     2004           
Flag Coverage Δ
unit 73.18% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review May 21, 2026 08:39
@github-actions
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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

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

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

@dkotter dkotter merged commit 59ec5fd into WordPress:develop May 21, 2026
33 checks passed
@github-project-automation github-project-automation Bot moved this from Needs review to Done in WordPress AI Planning & Roadmap May 21, 2026
@yogeshbhutkar yogeshbhutkar deleted the request-logs/fix-focus-lost-on-button-press branch May 22, 2026 03:39
@jeffpaul jeffpaul linked an issue May 26, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

a11y: Focus is lost on many button actions

3 participants