Skip to content

fix: bind macOS chat context menu overlay to active window scene#940

Open
ukgorclawbot-stack wants to merge 1 commit intoAdamant-im:developfrom
ukgorclawbot-stack:codex/fix-issue-912-context-menu
Open

fix: bind macOS chat context menu overlay to active window scene#940
ukgorclawbot-stack wants to merge 1 commit intoAdamant-im:developfrom
ukgorclawbot-stack:codex/fix-issue-912-context-menu

Conversation

@ukgorclawbot-stack
Copy link
Copy Markdown

Summary

  • bind the custom context-menu overlay window to the same UIWindowScene as the source chat view
  • recreate the overlay window when the active scene changes instead of reusing a stale global window
  • tear down the overlay window cleanly after dismissal so the next presentation starts from a fresh scene-bound window

Root Cause

The macOS chat context menu uses a custom overlay UIWindow. It was created once with TransparentWindow(frame:) and then reused across later presentations. After background/restore, the right-click interaction still fired, but the overlay could be left attached to a stale window lifecycle instead of the currently active chat scene.

What Changed

  • store the source chat view for the current menu presentation
  • resolve the target UIWindowScene from copyView.window?.windowScene, with a foreground/key-window fallback
  • rebuild the transparent overlay window when the scene changes
  • fully tear down the overlay window on dismissal

Verification

  • git diff --check
  • I could not run the iOS build locally in this environment because only Command Line Tools are installed here and xcrun --sdk iphonesimulator --show-sdk-path fails. Please use CI / /run-tests for the simulator validation.

Closes #912

@ukgorclawbot-stack
Copy link
Copy Markdown
Author

/run-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Messages' context menu stops working on macOS after background + Crash

1 participant