Please consider adding a "Copy Code" button

Hello!

While I’m not a developer, I do frequently work with various commands and scripts that I have saved in Bear for reference.

While I’m aware of the “Copy Code” option in the menu (and have it mapped to a keyboard shortcut), I’d much prefer a simple “Copy Code” icon in or immediately adjacent to code blocks. Perhaps it could even remain hidden until a mouse hover or tap/long press?

I think this could be a simple quality-of-life improvement that wouldn’t sacrifice design principles, and could even be offered as a toggle-on feature in settings.

Please consider it!

Thanks team! :bear:

6 Likes

I believe this has been requested before, with no response from devs. But for what its worth, I agree!

1 Like

Yeah I’d appreciate this also but am using drafts for this in the mean time

1 Like

Yes! This, please. Also requested here and here. A copy icon in the top right corner of a code block (it could only show on hover if you want to keep the UI uncluttered) would be a far better UX compared to the current clunkiness tarnishing the shine of Bear 2’s new UI (i.e., right-click on code block, try to ignore the text shifting unnecessarily to reveal markdown, and then try to find the “Copy code” option from amongst 20+ choices in the context menu). The current experience of copying code blocks feles so “1990s” compared to the rest of Bear 2. :wink:

We hear you, and this is something we consider. Unfortunately, it would require a bigger change in how the code block is rendered, so it is not a trivial change. Based on feedback, we are making improvements all over the place, and eventually, we might get to this.

1 Like

Just please remember that as with any formatting, people can use markdown code format for many different uses, not only code, so in case of implementing “copy code” button, make it at least disappear by default or not immediately visible unless hovering above it etc.

1 Like

Yes, that is how we think about things. We want nice features while still keeping the app clean for people who don’t use them.

2 Likes

To be clear, I’m not advocating for a “Copy code” button; rather, a single-tap “Copy” icon that appears when hovering over a code block to allow copying the content of the code block without switching to edit mode or, if in edit mode, moving the cursor position. Something like this:

copy code

@rexikan thanks for your reply. It’s nice to know it’s on your radar. Bear 2’s UX is so slick, copying code blocks deservers to be equally slick some day. :slight_smile:

2 Likes

This would be really useful!
Notion does this really well on hover.