sindresorhus / Pasteboard-Viewer

📋 Inspect the system pasteboards on macOS
https://sindresorhus.com/pasteboard-viewer
MIT License
697 stars 34 forks source link

Hex viewer #31

Closed davedelong closed 5 months ago

davedelong commented 5 months ago

This adds a hex viewer to Pasteboard Viewer and fixes #24.

This uses the HexFiend framework to add a hex viewer to the app, which can be accessed by toggling a picker in the toolbar.

Some things to note:

Screenshot 2024-05-02 at 9 10 09 PM Screenshot 2024-05-02 at 9 10 21 PM
sindresorhus commented 5 months ago

Thanks for working on this! This is already looking pretty good.

davedelong commented 5 months ago
  • I noticed it's quite slow to select something when viewing an image. Not sure if the problem is the framework or the wrapper code.

I took a quick look at this in instruments, and from what I can tell there's an identical spike when showing the text view as showing the hex view. I'm reasonably confident that this is down to retrieving the type.data() from the pasteboard to provide to the UI. There's probably an optimization that could be made there around caching it once it's been read, so that subsequent calls to .data() are instantaneous.

davedelong commented 5 months ago

Besides the hiccup when showing large datas (like images), all the other feedback has been addressed, including adding the ⌘1 and ⌘2 switcher in the View menu. 😃

davedelong commented 5 months ago

(I also confirmed that the branch builds cleanly for iOS)

sindresorhus commented 5 months ago

Looks great 🙌

sindresorhus commented 5 months ago

Update submitted.