Focus Timer: react to the linked window closing - #416
Merged
AllTerrainDeveloper merged 1 commit intoJul 24, 2026
Conversation
Addresses review feedback (WordPress#410): - The window picker now lists only currently-open windows. A closed window is nothing to shake, so it is never offered as a choice (drops the previous dangling "(closed)" entry). - The timer runtime now listens for `desktop-mode-window-closed`. If the linked window is closed while the timer is running or paused, the timer is cancelled (back to idle) and a toast explains why. The listener lives in the page-wide runtime, not the view, so it fires even when the widget card has been re-docked or torn down.
AllTerrainDeveloper
approved these changes
Jul 24, 2026
AllTerrainDeveloper
left a comment
Collaborator
There was a problem hiding this comment.
Thanks! Works as expected!
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.
Fixes #410
Follow-up to #403 (which added the Focus Timer widget) — addresses the review feedback in #410.
Changes
desktop-mode-window-closed. If the linked window is closed while the timer is running or paused, the timer is cancelled (back to idle) and a toast explains why. The listener lives in the page-wide runtime rather than the view, so it fires even when the widget card has been re-docked or torn down.Testing
npm run typecheck,npm run lint(on the new sources), andnpm run build:widget-focus-timerall pass.