Skip to content

bug(desktop): composer undo skips and may duplicate pasted content #3786

Description

@Sun-GLiang

What happened

After entering content in the Maka composer and immediately pasting additional content, pressing Command+Z on macOS or Ctrl+Z on Windows/Linux does not undo the most recent paste operation.

Instead, the most recently typed content is removed while the pasted content remains.

If undo is pressed repeatedly until only the pasted content remains, subsequent undo operations may insert one or two additional copies of that content.

This issue is not limited to a specific type of content. Both the manually entered and pasted content can be Chinese text, English text, URLs, or other plain text.

Expected behavior:

  • The first undo should remove the most recently pasted content.
  • Subsequent undo operations should remove previously entered content in reverse order.
  • Undo operations should never reinsert or duplicate pasted content.

How to reproduce

  1. Open the Maka composer.
  2. Manually enter any content.
  3. Immediately paste any additional content.
  4. Press Command+Z on macOS or Ctrl+Z on Windows/Linux.
  5. Observe that the manually entered content is removed while the pasted content remains.
  6. Continue pressing undo until only the pasted content remains.
  7. Press undo again.
  8. Observe that the pasted content may be inserted again one or two times.

Environment

  • Maka version or commit: TBD
  • OS and version: macOS (version TBD)
  • Surface: Desktop
  • Node.js version, if running from source: N/A

Logs, screenshots, or additional context

The problem appears to be related to how paste operations are recorded in the composer's undo history.

The issue is independent of the content type. It can occur with Chinese text, English text, URLs, or other plain text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions