feat(clipboard): add type filters to clipboard history#2640
Conversation
|
A couple of follow-up ideas came up while implementing this, but I left them out to keep the scope of this PR focused:
The backend already exposes clipboard entry types and the CLI supports filtering, so this PR focuses only on exposing that functionality in the clipboard UI. Also, this is my first contribution to a large open-source project. I chose this because it is rather simple, self-contained, and something I definitely needed. Any feedback, suggestions, or pointers on how I can improve my contributions would be greatly appreciated. |
|
Filtering is indeed needed, but I feel the current location of the filter menu is unreasonable and it might be a more appropriate location for it to appear on the left or right side of the search bar. I also noticed that it is not controlled by blur and animation speed settings. It would be even better if there was a search integration rather than just button interaction, such as requiring only the keyboard to type certain key characters for specific filtering, which would avoid unnecessary mouse manipulation. However, I didn't use more specific ideas on the specific interaction method of this function on my page. Perhaps it can give you some inspiration. |
|
Thank you for the feedback. About the location of the filter, I did have some confusions on where to place it, and I kept it where it was since there was a lot of empty space there. But what you say makes sense too, since search and filter both aim to narrow the results. I wasn't aware of the blur and animation speed settings, and I will take a look at it. Search integration also makes sense. Right now I am thinking of /text, /ltext, /image. I'll experiment with that approach, but I'd be interested to hear if you have another workflow in mind. |
|
Typing / (or another symbol) will bring up a partial list of candidates to choose from. This list can be toggled using tab or shift+tab, and selected using enter. You can continue typing while the candidate list is open. If no match is found for a particular type, the entire input in the search box will be treated as a regular string for filtering. Is this considered a classic type of interaction? I'm not sure if this kind of interaction is appropriate here. |
|
These are the ideas I have at the moment. I think it would make more sense to move the dropdown from its current location to beside the search bar, while also making it fully keyboard accessible. For filtering directly from the search bar, one idea is to use Once a filter is applied, a small visual chip could appear at the start of the search bar (e.g. I'll also start looking into the blur/animation settings integration and moving the dropdown closer to the search bar. Does this direction sound more appropriate? |
|
@dionjoshualobo This is how I imagine it. |
Is it possible to integrate this part with the drop-down menu? I'm not sure if it's appropriate to put it together, but it needs to be consistent, at least in terms of state. The others look fine, unless it's in a very unreasonable location like it was at the beginning. The other UI/UX details are a matter of detail, which mainly depends on user preferences. This will definitely not satisfy everyone. First, give a usable version and slowly optimize and adjust it during use. |
I went into more detail about this. The blur / transparency aspect is somewhat difficult for me to validate since I was not able to locate any option in my current configuration which changes the behavior of the dropdown. The other thing which I did confirm is that the global animation speed impacts other animations but not this one. I will do some further research on how the dropdown popup is implemented now and possibly adapt it to use the global animation speed as well. |
Do you mean this way, #2640 (comment) ? The chip itself is the dropdown? That also makes sense. |
Yes, it is equivalent to the search bar having an area that fixedly displays the search type. It is itself selectable with the mouse and can also be switched by typing /. |
|
That makes sense. I like that approach better as well as it avoids having separate UI elements for the same filter state. I'll try with integrating the filter selector directly into the search bar and use that as the single source of truth for the active filter, while still allowing keyboard-driven switching through |
|
Edited this according to the feedback regarding keeping the filter status closer to the search flow. The dropdown now resides next to the search box in order to maintain the same functionality in the dropdown, but at the same time increase visibility while using the search function. I have looked briefly into having keyboard control navigation between the search and the dropdown, but the current implementation of I am still considering the possibility of embedding the filter into the search field, but I will begin with this small layout adjustment first. |
94a25fd to
4c5572c
Compare
4c5572c to
89fc5c4
Compare
|
Hey @dionjoshualobo, thanks for the idea, I find it very useful! Thanks for the feedback/reviews @jbwfu and @hthienloc. I have gone ahead and updated it with some fixes and polish to the vision I have for it. It now fits together cleaning as in inline filter, alongside a new user facing toggle in Settings>System > Clipboard to optionally remember your last filter set.
|




Description
This PR introduces the ability to filter clipboard history by entry type (Text, Long Text, and Image), exposing the existing
getEntryType()backend classification to the frontend UI.Currently, users with large clipboard histories must scroll extensively or rely purely on text search, which is inefficient for finding specific media like images or long text blocks.
Key Changes:
activeFilterproperty toClipboardService.qml.updateFilteredModel()to apply the entry type filter before the search text filter and sorting logic.DankDropdowntoClipboardHeader.qmlwith options for "All", "Text", "Long Text", and "Image".I18n.tr()with appropriate context, using array indices to ensure safe selection regardless of the active language.ClipboardContentandClipboardHistoryContentto keep the UI perfectly synchronized with the singleton service.Type of change
Related issues
Closes #2639
Screenshots / video
DMSFilter.mp4
Checklist
I18n.tr()with translator context, reusing existing terms where possiblemake fmt, added/updated tests,make testpasses, andgo mod tidyis cleanmake lint-qmlwith no new warnings