p0deje / Maccy

Lightweight clipboard manager for macOS
https://maccy.app
MIT License
12.1k stars 521 forks source link

Allow to custom sort pins #342

Open p0deje opened 2 years ago

p0deje commented 2 years ago

I would like to suggest a feature. Could you please add the ability to custom sort the saved pins? If this is not possible, maybe they could sort by the shortcut letter? Or they can sort by the title of the pin alphabetically?

dr-dimitru commented 2 years ago

Please add support for sorting pressing control + + arrow key up/down In the same way as sorting works in Notes.app and Sublime Text.app

p0deje commented 2 years ago

@dr-dimitru I tried pressing this in Notes.app and it didn't change sorting for notes at all. Can you be more specific?

dr-dimitru commented 2 years ago
  1. Create a list in a note
  2. Sort pressing control + + arrow key up/down
p0deje commented 2 years ago

But this list is unsorted, whilst pins are sorted in the same way as all other records based on Preferences / Storage / Sory by setting.

dr-dimitru commented 2 years ago

You're right, what I described called "reordering". I'd be glad having reordering implemented, should I create separate issue?

dr-dimitru commented 2 years ago

I found #441 initially and "manual sorting" sounds like "reordering" and I thought that's what I was looking for

p0deje commented 2 years ago

What if it's just sorted alphabetically by pin letter?

dr-dimitru commented 2 years ago

I'd vote for default sorting based on usage

p0deje commented 2 years ago

Usage meaning what? Number of copies?

dr-dimitru commented 2 years ago

Number of copies?

Exactly

p0deje commented 2 years ago

Have you tried enabling this in Preferences?

dr-dimitru commented 2 years ago

@p0deje I don't see such option. I'm on Version 0.23.0 (12) from AppStore

p0deje commented 2 years ago

It's in Preferences / Storage. It would apply to all history items - not just pins.

dr-dimitru commented 2 years ago

It would apply to all history items - not just pins.

This is the reason why I have it OFF

GerZah commented 1 year ago

I'd like to unearth this issue. My use-case is that Maccy is disabled at all times, unless I'd like to add a new text-blob. I've got <10 to choose from. I've pinned them, to prevent accidental deletion.

Looking at the sqlite database, like so:

sqlite3 ~/Library/Containers/org.p0deje.Maccy/Data/Library/Application\ Support/Maccy/Storage.sqlite "select * from ZHISTORYITEM order by Z_PK desc;"

presents the items in the exact same order as given in the menu.

I would just love to be able to re-order the items. As someone said above: control + + arrow key up/down would be just awesome.


… Suggestion: If I'd have to code that, I'd add a Z_WEIGHT field to the ZHISTORYITEM table, and use that as a potential sort order for pinned items.

mithunsridharan commented 1 year ago

What if it's just sorted alphabetically by pin letter?

This is a feature I'd vote for.

Wild5au commented 11 months ago

Thank you for the quick response! So sorry, it's still not clear to me how this feature is accessible - is it the suggested CTRL + COMMAND + arrow up or down combination? I can't seem to get that to work when I select a pin in the Preferences/Pins panel.

p0deje commented 11 months ago

@Wild5au This feature is not implemented yet.

Wild5au commented 11 months ago

Got it - thank you kindly for clarifying.

The111 commented 7 months ago

Huuuuuge +1 to this feature request. My use case is that I have around 30 long complex strings I want to save for frequent access. I want them to ALWAYS appear in the same order, and I cannot do this with any of the 3 existing sort options. I have an idea for a hack that might make this easier. Is the stored data editable by the user? If so I can just edit the "first copied time" of any of my pins to force them into the order I want. Please let me know where this userdata is located, I'm having a hard time finding it, I don't know the MacOS file layout very well. Thanks! Other than the sorting issue, this is an amazing tool.

The111 commented 7 months ago

Update to the above, I was able to edit the sqlite files and force reordering in the way that I want by changing the ZFIRSTCOPIEDDAT values. This is a hack, but it works. Now a new shortcoming seems to be that I can only have 26 pins, since they seem to be required to have a keybinding. Why? Can this requirement be removed please?

p0deje commented 7 months ago

Why? Can this requirement be removed please?

There shouldn't be a requirement like that - after you're out of letters, there is supposed to be letterless pins available. Can you please record a video showing the problem?

The111 commented 7 months ago

Thanks for the response! Unfortunately I can't record a video since all my pins are strings that can't be publicly shared. But I will note that if I have 26 pins lettered a-z, and I try to pin a 27th thing, it does indeed work as a "letterless pin" as you say... but only for the remainder of that app session. If I close and reopen the app, the new 27th pin is no longer there. Maybe this is related to the fact that I've mucked with the DB manually (as I've noticed if I do that mucking carelessly, it can break other things). Not sure.

p0deje commented 7 months ago

I've just tried pinning 26+ items and then quitting/opening Maccy, the letterless pins are still there.

Screenshot 2024-02-23 at 10 32 27
The111 commented 7 months ago

Thanks for confirming that. Sounds like it probably is related to my DB hacking. By really strange coincidence, I happen to have exactly 26 pins now, and these pins are pretty much the only reason I'm using Maccy. I don't care about ephemeral strings. So my request for more than 26 was basically future-looking.

I had to try my DB hacking multiple times to finally get to the state I'm in now where it works perfectly with the 26 things I have pinned (in the order that I want them). Any time I screwed up the DB, I had to wipe it and start over. So I'm not keen to mess with it anymore, it sounds like I'll have to be content with what I have.

But I'll note that if you added the ability to assign a manual fixed sort order to your pins, then I wouldn't have to do these hacks. Thanks again for your consideration! It is working great for me even with my current issue.