Skip to content

feat: support named native clipboard formats - #425

Merged
tiensonqin merged 12 commits into
native-parity-0.1-backportsfrom
devin/1795762400-clipboard-formats
Nov 27, 2026
Merged

tiensonqin merged 12 commits into
native-parity-0.1-backportsfrom
devin/1795762400-clipboard-formats

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds clipboard_write_formats and clipboard_read_format to the macOS and Linux native shell APIs so hosts can atomically transport structured clipboard data alongside the plain-text fallback.

clipboard_write_formats
  [ "text/plain", markdown
  ; "text/html", html
  ; "application/logseq", encoded_blocks ]
  • macOS declares the complete pasteboard type set in one ownership change, writes exact MIME keys, and mirrors text/plain/text/html to native pasteboard types unless those native keys were explicitly supplied.
  • Linux writes all GTK clipboard targets in one ownership change; text/plain is also exposed through UTF8_STRING. Linux rejects embedded NULs in text/plain because GTK plain-text reads are NUL-terminated; custom formats may carry them.
  • Existing clipboard_write/clipboard_read behavior is unchanged.
  • The API contract, platform constraints, and migration example are recorded in docs/api-migrations.md.

Validation: dune build platform/native/lui_shell_linux platform/native/lui_shell passed; dune runtest platform/native/lui_shell_linux/test passed, including a real GTK multi-format clipboard round trip and a custom-format embedded-NUL payload. Real two-process macOS validation also passed at d60f967e: the full lui_shell_mac_test.exe suite passed 12/12, and an independent Swift process read text/plain, public.utf8-plain-text, text/html, and application/logseq with the expected distinct payloads after clipboard named formats ran.

Link to Devin session: https://app.devin.ai/sessions/c5d7e54b078e47e28153404536bb3def
Open in Devin Desktop: https://app.devin.ai/desktop/session/c5d7e54b078e47e28153404536bb3def?variant=devin
Requested by: @tiensonqin


🟢 Devin fixed all 2 findings · Follow Devin's work

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 findings. Devin automatically fixed all 2 findings.

Fixed by Devin (2)
  • Clipboard writes wait for the manager — Clipboard-manager persistence is now requested during process shutdown rather than synchronously after each copy, avoiding UI input blockage while retaining cross-restart clipboard contents.
  • Non-Linux shutdown fails after clipboard hook — The shutdown persistence hook is a no-op off Linux instead of raising the unsupported-backend exception.

View findings in Devin Review · Follow Devin's work

Devin Review

@tiensonqin
tiensonqin merged commit 34eac3d into native-parity-0.1-backports Nov 27, 2026
10 checks passed
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