Skip to content

Image copy fix#394

Merged
shobhit99 merged 2 commits into
mainfrom
image-copy-fix
May 15, 2026
Merged

Image copy fix#394
shobhit99 merged 2 commits into
mainfrom
image-copy-fix

Conversation

@shobhit99
Copy link
Copy Markdown
Contributor

No description provided.

shobhit99 and others added 2 commits May 15, 2026 19:19
- clipboard-manager.ts: merge changeCount optimisation (from this branch)
  with the expanded image-format support from main (#391). Use
  readClipboardBufferForFormats for GIF check, keep fallbackImage in
  destructuring, and carry the O(1) getPasteboardChangeCount early-exit.
- native_helpers.mm: export both getPasteboardChangeCount (this branch)
  and setWindowAnimationBehaviorNone (main); update loader to use
  native_helpers.node (renamed in #392) via getNativeHelpersAddon().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shobhit99 shobhit99 merged commit 024af7b into main May 15, 2026
1 check passed
@shobhit99 shobhit99 deleted the image-copy-fix branch May 15, 2026 16:18
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: 5d1f1c0328

ℹ️ 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 +836 to +839
const addon = getNativeHelpersAddon();
if (addon?.getPasteboardChangeCount) {
lastPasteboardChangeCount = addon.getPasteboardChangeCount();
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Seed image state when pasteboard addon is unavailable

This startup path now relies entirely on getPasteboardChangeCount(), but getNativeHelpersAddon() explicitly falls back to null when the native module cannot be loaded. In that fallback case, lastClipboardImageHash is no longer initialized from the current clipboard image, so the immediate pollClipboard() call treats any pre-existing image as a new copy and adds a spurious history entry on launch. This regresses the previous behavior for environments where native_helpers.node is missing or fails to load (e.g., architecture/build mismatch).

Useful? React with 👍 / 👎.

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