Skip to content

Clipboard: rich formats (image + HTML/MIME) beyond plain text#38

Open
codymullins wants to merge 1 commit into
mainfrom
feat/rich-clipboard
Open

Clipboard: rich formats (image + HTML/MIME) beyond plain text#38
codymullins wants to merge 1 commit into
mainfrom
feat/rich-clipboard

Conversation

@codymullins

Copy link
Copy Markdown
Contributor

Closes #21.

The clipboard was plain text only. A browser needs to copy/paste images and HTML. This adds typed clipboard read/write while keeping ClipboardText as the text convenience.

What changed

  • AppWindow.GetClipboardData(mimeType) / SetClipboardData(mimeType, data) / ClipboardFormatsIWindowBackend.
  • AppKit backend — maps text/plain, text/html, and image/png to their NSPasteboard UTIs and reads/writes typed NSData. ClipboardFormats enumerates which of those are present.
  • GLFW backend — text only: text/plain round-trips through the GLFW clipboard string; other MIME types are dropped on write and return null on read; ClipboardFormats reports text/plain when text is present.

Tests

  • Skyline.WindowedTests — typed text round-trip on a real GLFW window, null for an unsupported type, a dropped non-text write (no throw), and ClipboardFormats. Covers every GLFW clipboard branch.

Verification

  • dotnet build Skyline.slnx clean (0 warnings); Skyline.Apple builds clean on the macos workload.
  • Headless tests pass; windowed harness passes (92 checks); format-check.sh clean.
  • Coverage: GlfwWindowBackend 100%; AppWindow 96.9% (matches main). Overall 98.1% unchanged.

Notes

  • The AppKit typed read/write (NSPasteboard UTIs, image/html data) compiles on the macos workload but isn't exercised by the headless harness — the GLFW text path is the covered, verified one. Image/HTML round-trips want a hands-on macOS run.
  • Branched on top of merged Input: carry modifier-key state on key and pointer events #29. Touches the window seam (IWindowBackend/AppWindow/GLFW/AppKit/FakeBackend), so it overlaps the open PRs in distinct regions — trivial rebases as they land.

Add AppWindow.GetClipboardData / SetClipboardData / ClipboardFormats so a
browser can copy and paste images and HTML, not only text. ClipboardText
stays as the text convenience.

- AppKit backend maps text/plain, text/html, and image/png to
  NSPasteboard types and reads/writes typed data.
- GLFW backend stores text only; other MIME types are dropped, and it
  reports text/plain alone when text is present.

Closes #21
Copilot AI review requested due to automatic review settings June 17, 2026 01:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Clipboard: rich formats (image + HTML/MIME) beyond plain text

2 participants