Skip to content

fix: preserve focus across heartbeat re-renders in the network Who's Online widget - #390

Merged
josephfusco merged 1 commit into
mainfrom
fix/389-network-widget-focus
Aug 28, 2026
Merged

josephfusco merged 1 commit into
mainfrom
fix/389-network-widget-focus

Conversation

@josephfusco

Copy link
Copy Markdown
Collaborator

Closes #389

Third time for this one: 45e4f13 fixed it for Who's Online and 07846f7 for Active Posts, both on 2026-08-12, and the network widget shipped afterwards without picking it up.

Verified in Chromium against a three-site wp-env network, focusing a site link and forcing a real re-render:

server-rendered data-blog-id: ["1","2","3"]

-- focused site link 1: "localhost:8888/" (blog 1)
   dropped row 11, blog 3 now has 4
   heartbeat: tick
   after: "localhost:8888/" (blog 1, in widget: true)
   PASS focus returned to the same site

-- focused site link 2: "localhost:8888/marketing/" (blog 2)
   dropped row 6, blog 3 now has 3
   heartbeat: tick
   after: "localhost:8888/marketing/" (blog 2, in widget: true)
   PASS focus returned to the same site

Before the patch the same run reported "localhost:8888/" -> "<body>".

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5

Used for: Assisting with implementation

@github-actions

Copy link
Copy Markdown
Contributor

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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props joefusco.

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

@github-actions

Copy link
Copy Markdown
Contributor

▶ Preview in WordPress Playground

Single site Multisite network

Both boot a fresh WordPress with this PR's presence-api build and log you in. Single site seeds 5 demo users and lands on the dashboard. Multisite network adds three sub-sites alongside the main one, seeds 5 users on each, and lands on Network Admin.

Stress-test variant: 40 demo users · Built from add22c43b6cf4863a184f0e6b42ba7f6d0532066. Auto-updates when you push.

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.87%. Comparing base (5549e5c) to head (add22c4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #390   +/-   ##
=========================================
  Coverage     96.87%   96.87%           
  Complexity      239      239           
=========================================
  Files            19       19           
  Lines          2782     2782           
=========================================
  Hits           2695     2695           
  Misses           87       87           
Flag Coverage Δ
multisite 96.87% <100.00%> (ø)
phpunit 72.53% <0.00%> (ø)

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

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

@josephfusco
josephfusco merged commit 33e6548 into main Aug 28, 2026
18 checks passed
@josephfusco
josephfusco deleted the fix/389-network-widget-focus branch August 28, 2026 02:43
@josephfusco josephfusco added the [Area] Multisite Network-wide presence, aggregation, and Network Admin surfaces label Sep 4, 2026
@josephfusco josephfusco added this to the 0.2.0 milestone Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Multisite Network-wide presence, aggregation, and Network Admin surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Network dashboard widget drops keyboard focus on every presence change

1 participant