Skip to content

✨ attribute OCR and plugin pastes to CrossPaste and show its logo as their source icon - #5240

Merged
guiyanakuang merged 4 commits into
mainfrom
feat/crosspaste-source-icon
Oct 21, 2026
Merged

guiyanakuang merged 4 commits into
mainfrom
feat/crosspaste-source-icon

Conversation

@guiyanakuang

@guiyanakuang guiyanakuang commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Pastes that CrossPaste produces itself — OCR "Extract text" and process plugin output (e.g. the bundled Translate plugin) — now carry source = "CrossPaste", and their source icon is CrossPaste's own Mac-style app icon, rendered through exactly the same pipeline as every captured app icon.

Changes

  • OCR extract text (ExtractTextMenuContributor) and plugin replaceClipboard output: our own pasteboard writes are never captured by the pasteboard listener (self-write detection), so the result previously reached the clipboard without a history entry. They now follow the same path as crosspaste copy in the CLI: createLocalPasteData(source = AppName) first, then tryWritePasteboard(id = …, localOnly = true) so the listener ignores the write and sync goes through the normal local release.
  • Plugin newPaste output: source changes from the plugin's manifest id to AppName.
  • Source icon: on GUI startup, the bundled Mac-style app icon (crosspaste_mac.png, the same one Conveyor packages for macOS, transparent padding included) is written to icons/<local appInstanceId>/CrossPaste.png. The existing Coil fetcher, the side-title alpha-trim + crop transformation, the title background color extraction and the icon push to peers all pick it up with no UI special case, so it is cropped and tinted exactly like other app icons. It is rewritten on every launch so it follows logo changes across upgrades.

Testing

  • Updated ProcessPluginRunnerTest and ExtractTextMenuContributorTest to assert the paste is recorded with AppName as source and the clipboard write uses the new paste id.
  • Ran the bundled icon and a captured Chrome icon through AppSourceIconCropTransformation side by side; both come out framed identically.
  • ./gradlew app:desktopTest passes.

@guiyanakuang
guiyanakuang force-pushed the feat/crosspaste-source-icon branch from a5b4dae to 0111a21 Compare October 21, 2026 05:04
@guiyanakuang
guiyanakuang merged commit 3ec6fca into main Oct 21, 2026
7 checks passed
@guiyanakuang
guiyanakuang deleted the feat/crosspaste-source-icon branch October 21, 2026 06:19
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