feat: add star item feature for klipper
Reason for the change
This MR adds a “starred” mode to Klipper and updates the UI to make it easy to keep important clips around:
-
Star toggle on each entry:
A Gmail-style star icon lets you mark or unmark any clipboard item. -
Protect starred items from auto-clear:
Starred entries won’t be removed when Klipper prunes old history. You can still delete them manually (one-by-one or in bulk), but you’ll get a confirmation prompt first. -
Two-tab layout:
- All History – your complete history, just like before.
- Starred Only – only the items you’ve starred. (The “Current” item is always pinned at the top, even in this tab.)
Together, these changes let you bookmark high-value clips without losing the familiar workflow of the existing history view, while keeping Ctrl+V behavior predictable thanks to the pinned “Current” entry.
This change builds upon concepts for managing important items, similar to the "pinned items" model discussed in the related Klipper merge request !4988 (closed), and incorporates suggested code/approaches from it for a robust implementation. The goal is to provide a more intuitive and efficient way for users to manage a list of items.
Test plan
To test these changes, please perform the following steps:
-
Star / Unstar behavior
- Click the star icon on any history item → it appears under “Starred Only.”
- Click again → it returns to “All History.”
-
Tab switching
- Switch to All History → all items (including starred) are shown, with “Current” pinned.
- Switch to Starred Only → only starred items (plus “Current” if it’s starred) appear.
-
“Current” pin
- Copy a new entry → it appears in the “Current” section immediately.
- Verify “Current” remains visible when switching tabs.
-
UI consistency
- Confirm tabs, pinned header, and star icons follow KDE HIG guidelines.
- Test under different themes and popup sizes.
Screenshots or screen recordings
(Note: This Merge Request is an early submission to facilitate collaboration and allow others to follow progress. The core functionality is still under active development and not yet fully working. Screenshots will be provided once the implementation is more complete and visuals are stable.)
| Before | After |
|---|---|
![]() |
![]() ![]() |
(Updated screenshots will be provided as development progresses.)
Bugs fixed
BUG: 54212
Additional Improvements
Enhanced UI Robustness: This MR includes defensive programming improvements for gradient calculations in ClipboardItemDelegate.qml to prevent visual glitches caused by NaN/undefined values during complex UI interactions.
Database Schema Updates: Updated the clipboard job handling to properly support the new starred field across all database operations.


