Skip to content

Ai prompt fix#398

Merged
shobhit99 merged 5 commits into
mainfrom
ai-prompt-fix
May 15, 2026
Merged

Ai prompt fix#398
shobhit99 merged 5 commits into
mainfrom
ai-prompt-fix

Conversation

@shobhit99
Copy link
Copy Markdown
Contributor

No description provided.

shobhit99 and others added 5 commits May 15, 2026 19:19
The prompt window's 'window-shown' IPC message was sent immediately after
createPromptWindow() — but on the first open the BrowserWindow had just
been created and the React app hadn't mounted yet, so PromptApp's
onWindowShown listener wasn't registered. The message was silently
dropped. Subsequent opens reused the already-loaded window, so the
listener was live and the text arrived correctly.

Fix mirrors the pattern used for the main launcher window:

- PromptApp now calls rendererReady() on mount, emitting the same
  'renderer-ready' IPC signal the main App.tsx sends.
- createPromptWindow registers an ipcMain.once('renderer-ready') handler
  (with re-register-on-wrong-sender semantics) that sets
  promptRendererReady=true and flushes any pending payload.
- showPromptWindow checks promptRendererReady: if true, sends
  immediately (all subsequent opens); if false, stores the payload in
  pendingPromptWindowShown so the handler delivers it once the app mounts.

Also rewrites get-selected-text.swift with BFS traversal across focused
element, focused window, and system-wide element roots; adds text marker
range support for Chromium/Electron apps; skips secure text fields; and
adds AXEnhancedUserInterface opt-in for richer attribute access. Adds
AppKit framework to the native build command to support NSWorkspace.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- clipboard-manager.ts: update getFastPasteAddon → getNativeHelpersAddon /
  fast_paste.node → native_helpers.node (addon rename from #392). Adopt
  main's expanded image-format support (jpeg/webp/heic/tiff via
  readClipboardBufferForFormats, nativeImage fallback). Keep our changeCount
  optimisation and add fallbackImage to destructuring.
- native_helpers.mm: export both getPasteboardChangeCount (this branch)
  and setWindowAnimationBehaviorNone (from #392).
- package.json build:native: keep -framework AppKit for get-selected-text
  (required by the selected-text fix on this branch) while using
  native-helpers-addon / native_helpers.node paths from main's rename.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 879f26fe7c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +140 to +142
useEffect(() => {
window.electron.rendererReady();
}, []);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope renderer-ready signal to the launcher window

Emitting renderer-ready from the prompt renderer can trip launcher initialization listeners that currently do not validate event.sender (for example ipcMain.once('renderer-ready', dispatchLauncherEntry) in src/main/main.ts:17524). Because this channel is process-global, a prompt prewarm/open before the launcher mount can consume that one-shot listener and call openLauncherFromUserEntry() at the wrong time, recreating the race where launcher startup messages are sent before the launcher React handlers are attached. Use a window-specific channel or add sender checks on all launcher-side renderer-ready listeners.

Useful? React with 👍 / 👎.

@shobhit99 shobhit99 merged commit f980e6f into main May 15, 2026
1 check passed
@shobhit99 shobhit99 deleted the ai-prompt-fix branch May 15, 2026 18:52
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.

1 participant