Skip to content

feature: Add clipboard editor#1916

Open
nabaco wants to merge 4 commits intoAvengeMedia:masterfrom
nabaco:clipboard-editor
Open

feature: Add clipboard editor#1916
nabaco wants to merge 4 commits intoAvengeMedia:masterfrom
nabaco:clipboard-editor

Conversation

@nabaco
Copy link
Copy Markdown

@nabaco nabaco commented Mar 5, 2026

Summary

Enhance the clipboard history modal with a basic text editor. It works both for short and long entries (with base64 decode), a split save menu with multiple save actions, new keyboard shortcuts and hints. Usefull when pasting the same thing multiple times with small edits (terminal commands, IM messages), or for sanitizing text before pasting into the terminal.

Changes

  • Editor UX
    • Add an editor view to the modal
    • Fetches full clipboard entry content (clipboard.getEntry) and decodes base64 via Qt.atob/atob (needed for long text)
    • Editor fills available modal space and is scrollable
    • Esc in editor reliably returns to history
  • Save actions
    • Split Save button with dropdown:
      • Save
      • Save and close
      • Save and paste
  • Clipboard entry UI
    • Fixed action button hit‑area overlap after adding the edit button.
  • Keyboard shortcuts
    • History view:
      • Ctrl+Tab / Ctrl+Shift+Tab: switch Recents/Saved
      • Ctrl+S: pin/unpin selected entry
      • Ctrl+E: edit selected entry
    • Editor view:
      • Ctrl+S: save
      • Ctrl+Shift+S: save & close
      • Ctrl+Shift+V: save & paste
      • Esc: return to history
  • Keyboard hints
    • Updated to include new shortcuts and wrap to prevent overflow.
  • Focus & refresh
    • Restores search field focus when returning to history.
    • Refreshes history after saving to show updated entries immediately.

Testing

  • Open clipboard modal, edit entries (including long text).
  • Verify full text loads in editor and scrolls.
  • Verify all shortcuts in history/editor modes.
  • Verify save dropdown actions (save, save & close, save & paste).
  • Confirm search field regains focus when returning to history view.
  • Confirm pin/unpin and tab switching shortcuts.

Todo

  • Start an external editor for images (gradia/satty)
  • Add configuration options in DMS settings for default image editor and for default save action
  • New clip button from creating items in clipboard from scratch (?)

Screenshots / Videos

Added "edit" button

image

Edit UI

image

Save button

image

Keyboard hints

image
Screencast.mp4

id: mouseArea
anchors.fill: parent
anchors.rightMargin: 80
anchors.left: parent.left
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

required for making all buttons clickable, otherwise the leftmost button was not operational

@Purian23
Copy link
Copy Markdown
Collaborator

Purian23 commented Mar 7, 2026

Hi there, this looks pretty cool. It'll be a couple of days yet and @bbedward and I will talk this over.

@nabaco nabaco force-pushed the clipboard-editor branch from d006efa to a74a2d4 Compare March 7, 2026 17:02
}
}

Item {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would probably be better if we broke this out into a ClipboardEditor.qml , or something else if more appropriate.

ClipboardService.selectedIndex = 0;
ClipboardService.keyboardNavigationActive = false;
}
property var editClipboardModal: null
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Doesn't seem to be set anywhere

Popup {
id: saveMenu
parent: Overlay.overlay
width: 220
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Prefer not to use hardcoded widths here, but rather implicitWidth of the content, it may not scale with larger font sizes etc.


StyledRect {
width: saveMenu.width - saveMenu.padding * 2
height: 32
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same with hardcoded height.

service: ClipboardService
}

property string mode: "history"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd prefer to use an enum here but it's not a big deal since theyre kinda annoying in QML

@lakapple
Copy link
Copy Markdown
Contributor

Is this actively being worked on @nabaco?

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.

4 participants