Skip to content

Allow copying from history view; copy rich-text and plaintext MIME types. - #3358

Merged
dmsnell merged 1 commit into
trunkfrom
feature/history-revision-copy
May 15, 2026
Merged

dmsnell merged 1 commit into
trunkfrom
feature/history-revision-copy

Conversation

@dmsnell

@dmsnell dmsnell commented May 13, 2026 •

Copy link
Copy Markdown
Member

Resolves #3042
Resolves #2898

Summary

This 100% vibe-coded change addresses two frustrations with copying in the editor:

  1. Itโ€™s not possible to copy content from a revision because clicking outside of the revision slider closes the history view.
  2. Copying and pasting is rich-text unaware and only copies Markdown source as plaintext.

These changes fix the history viewer and require an explicit click to close (or a keypress of the Escape key, or by navigating to another note). This is a different behavior than the click-outside-to-close model, but it may be more ergonomic, because the old behavior prevents copying parts of an old version of a post.

Secondarily, several issues arose during the work on this feature relating to copy and paste behaviors. The app should be more aware of HTML/richly-formatted content when pasting, and will send two copies of copied content into the paste buffer: a text/plain version containing the markup source; and a text/html version containing the rendered note. This makes it possible for other applications to use the rendered content after copying.

A side-effect of this change is that itโ€™s now possible to preserve basic formatting when pasting HTML content into the app, as it parses the inbound HTML, sanitizes it, and creates Markdown syntax from the HTML.

Before / After

These videos demonstrate both aspects of this change:

  1. They attempt to select and copy a portion of an old revision of a note.
  2. They copy a noteโ€™s content and then paste it into another app, showing how the copied content, even if copied from the Markdown source itself, retains its formatting through the copy.

As a note on this, most applications provide an alternative paste mode where itโ€™s still possible to paste the plaintext content. In the After video, the plaintext content is automatically pasted into the search box since it doesnโ€™t support rich content, but in something like an email, it would likely be possible with a combination like Cmd + Opt + V or โ€œPaste without formatting.โ€

before-trunk-v2.mp4
after-feature-history-revision-copy-v2.mp4

@dmsnell

dmsnell commented May 13, 2026

Copy link
Copy Markdown
Member Author

I have performed checks on this and ran a (primitive, overly-naive) fuzzer on it to ensure that the changes arenโ€™t introducing obvious flaws. My plan is to merge, try to deploy to staging, then deploy to production.

@dmsnell
dmsnell force-pushed the feature/history-revision-copy branch from 41d8b6c to fff3d87 Compare May 13, 2026 21:09
Resolves #3042
Resolves #2898

This commit brings two notable changes:

 - Itโ€™s now possible to select content from an old revision of a note;
   previously when clicking into the note, the history view and slider
   would disappear to reveal the current version of the note.

 - When copying content from a note with Markdown active, the copy
   buffer receives two MIME payloads: the plaintext Markdown source,
   which had previously already been supplied; and a new `text/html`
   version containing the richly-formatted render of the note. This
   makes it possible to preserve formatting when pasting into other
   applications which can receive rich pastes, such as a word processor.

The changes in this patch were generated by Codex/GPT-5.5 and guided and
reviewed by @dmsnell
@dmsnell
dmsnell force-pushed the feature/history-revision-copy branch from fff3d87 to b0e29b8 Compare May 14, 2026 00:17
@dmsnell
dmsnell merged commit b0e29b8 into trunk May 15, 2026
7 checks passed
@dmsnell
dmsnell deleted the feature/history-revision-copy branch May 15, 2026 05:55
@mokagio mokagio added this to the 2.25 milestone May 15, 2026
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.

[Accessibility] Don't close History feature on outside click. Improve the accessibility of note History dialog

3 participants