Wire deterministic context-menu close signaling across Electron and renderer#2932
Open
Wire deterministic context-menu close signaling across Electron and renderer#2932
Conversation
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Deploying waveterm with
|
| Latest commit: |
f302fa7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://49738305.waveterm.pages.dev |
| Branch Preview URL: | https://copilot-update-context-menu.waveterm.pages.dev |
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update context menu system to hook up callback
Wire deterministic context-menu close signaling across Electron and renderer
Feb 24, 2026
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (5 files)
Review NotesThis PR adds lifecycle callbacks ( ✅ Proper state tracking - No bugs or issues detected. |
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.
Context-menu opens previously produced renderer callbacks only on selection (0 or 1 events). This change makes the lifecycle deterministic: every menu open now emits exactly one completion signal, with
nullon cancel and item id on selection.Main process: single terminal callback per popup
emain/emain-menu.tsto usemenu.popup({ callback }).contextmenu-click: nullonly when the menu closes without selection.Preload + API typing: nullable context-menu callback payload
frontend/types/custom.d.tsso:onContextMenuClicknow accepts(id: string | null) => void.Renderer context menu model: close/select/cancel hooks
showContextMenuwith optionalopts:onSelect?: (item) => voidonCancel?: () => voidonClose?: (item: MenuItem | null) => voidclickonSelectonCloseonCancelonClose(null)Targeted behavior tests
frontend/app/store/contextmenu.test.tsto verify:click -> onSelect -> onClose),onCancel -> onClose(null)).Not applicable — this is a behavioral/API flow change in native context menu lifecycle rather than a visual UI update.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.