Repository navigation
PT-2989: Context menu closes when the window loses focus, for release-prep (#45) - #48
Merged
Merged
Conversation
The editor's context menu now closes when the window loses focus, the way a native menu does. In Platform.Bible every pane is its own iframe, so a click in a neighbouring pane or another application never produced a pointerdown in the editor's document and left the menu open over a window the user had already left. ContextMenuPlugin gains a window `blur` listener, registered only while the menu is open, that closes it. Element blurs inside the document do not bubble to the window, so moving focus within the menu keeps it open. Tests cover closing on window blur and staying open on an element's own blur. packages/platform/dist is rebuilt; no public API change. The blur fires only if the editor's frame had focus when the menu opened, so this relies on paranext-core#2963, under which core's overlay service no longer pulls focus back to another pane after a click elsewhere. Reaches Platform.Bible with the next editor package update. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Session-URL: https://claude.ai/code/session_012P3p4bJXV7dm3VADUZtyNb (cherry picked from commit 06cbc96) On release-prep packages/platform/dist was rebuilt (pnpm rebuild-committed-output) instead of merged, because release-prep's bundle differs from main's (main also has #42).
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.
Brings #45 (PT-2989) onto
release-prep. The editor's right-click context menu now closes as soon as the window loses focus, for example when the user clicks into another pane or another application. Before this, it stayed open over a window the user had already left. The source change is oneuseEffectinContextMenuPlugin.tsxplus its tests, identical tomain.This pick is not an exact copy of main's commit, in its committed build output only. Please read this before merging and before the next rebase of
release-prepontomain.libs/shared-reactare identical tomain. A patch-id taken over just those paths matches main's commit.packages/platform/dist/index.jsand its source map are built differently onrelease-prep. Main's bundle also contains PT-4974: Export the font part of the project stylesheet as generateUsjFontCss #42 (generateUsjFontCss), which is not onrelease-prep, so the plain cherry-pick conflicted in the source map. I did not merge it by hand. I reset the bundle torelease-prep's and rebuilt it withpnpm rebuild-committed-output. The rebuild changed only those two files, by the same 8 added and 1 removed lines as main's commit. CI's committed-output check will confirm that the bundle matches the source.release-prepontomain, Git will not skip this commit automatically and may conflict inpackages/platform/dist/index.jsorindex.js.map. If so, take main's version ofpackages/platform/dist. The same applies to PT-4960: Let an empty paragraph after a chapter be deleted, for release-prep (#39) #47's earlier pick of PT-4960: Let an empty paragraph after a chapter be deleted #39, whose bundle was rebuilt for the same reason.release-prep.Testing on this branch, with dependencies installed from
release-prep's lockfile:ContextMenuPlugin.test.tsxpasses (29 tests). CI reruns here, including the committed-output check. No new live run. The source is identical tomain, where #45 was live-checked together with core #2963.AI-assisted — session
🤖 Generated with Claude Code
This change is