TJ-Bot icon indicating copy to clipboard operation
TJ-Bot copied to clipboard

Bookmark Command

Open Nxllpointer opened this issue 3 years ago • 24 comments

Resolves #570

  • [x] Implement /bookmarks add [note] command
  • [x] Implement /bookmarks list command
  • [ ] Implement /bookmarks remove command

Screenshots: image image

Nxllpointer avatar Oct 16 '22 18:10 Nxllpointer

Thank you for your contribution, and welcome to the project! :relaxed: :heart:

marko-radosavljevic avatar Oct 16 '22 18:10 marko-radosavljevic

Thank you!

Nxllpointer avatar Oct 16 '22 19:10 Nxllpointer

Ran the checks for you, so you can be aware of issues early on.

Feel free to ping me whenever you want me to run them again. ^^

marko-radosavljevic avatar Oct 16 '22 19:10 marko-radosavljevic

Ah ok great. Im gonna fix them real quick

Nxllpointer avatar Oct 16 '22 19:10 Nxllpointer

I made everything sonarlint compliant and the tests passed locally. Should be fine now. I dont neccesairily agree with the switch statement changes but hey.

Nxllpointer avatar Oct 16 '22 19:10 Nxllpointer

isn't this command is supposed to work in dms too?? and if not u can set the command visibility to guild no need to handle that explicitly

Taz03 avatar Oct 17 '22 05:10 Taz03

isn't this command is supposed to work in dms too?

that would be ideal yes. should be as simple as making it a GLOBAL command instead of GUILD.

Zabuzard avatar Oct 17 '22 07:10 Zabuzard

Yes it does already work in DMs. I also handled trying to add a bookmark in a DM

Nxllpointer avatar Oct 17 '22 07:10 Nxllpointer

Ok. I have now added sorting by activity and thats all i wanted to add. The UI still looks the same.

Nxllpointer avatar Oct 17 '22 13:10 Nxllpointer

there are extra empty lines in ur code at places like, between methods, between fields, etc. it'd be nice if u can look for them and fix it

Taz03 avatar Oct 17 '22 14:10 Taz03

there are extra empty lines in ur code at places like, between methods, between fields, etc. it'd be nice if u can look for them and fix it

I did this on purpose. It makes the code more organized in my opinion. Like having an extra newline between static things, grouping methods and stuff like that. I think it makes it much more readable.

Nxllpointer avatar Oct 17 '22 14:10 Nxllpointer

delete bookmarks for an user if they leave the guild

no, y?

Taz03 avatar Oct 18 '22 08:10 Taz03

for better ux, i think the pagination should display 10 embeds, not just one.

then also state a solution for delete thing rn user can scroll through each bookmark and delete one they want by clicking the delete button, how'll this work with 10 embeds?

Taz03 avatar Oct 18 '22 08:10 Taz03

delete bookmarks for an user if they leave the guild

no, y?

whats the point of keeping bookmarks for an user who is gone? they cant use the bookmarks anymore since they are not part of the server. they cant click the channel links, the channels are effectively dead for them. we need to do housekeeping, otherwise the database keeps growing indefinitely.

Zabuzard avatar Oct 19 '22 06:10 Zabuzard

for better ux, i think the pagination should display 10 embeds, not just one.

then also state a solution for delete thing rn user can scroll through each bookmark and delete one they want by clicking the delete button, how'll this work with 10 embeds?

this is a good point. in general, i am voting for a /bookmark delete command anyways, it has the better and more straightforward entry-ux. if an user wants to delete a bookmark, they will first look for such a command and might miss the fact that /bookmark list can be used for that. in fact, if we keep the current way of deleting, i would even rename list to manage, to make this clearer.

that said, i am unsure about a really good ux for a /bookmark delete command. realistically, one would want to enter the title of the bookmarked thread (with auto-complete fuzzy-matching, such as we just did for TagCommand).

personally, i think making the delete-flow a bit more cumbersome is worth the price. the list flow is used far more frequently and will be one of the main use cases for this. it just has to be good. and the ux, right now, if u have lots of bookmarks, is just super annoying.

like, u need a decent way of getting a quick overview of all ur 100 bookmarks. and clicking "next" 100 times certainly isnt.

Zabuzard avatar Oct 19 '22 07:10 Zabuzard

but deleting bookmarks with commands is also really annoying. Bookmarks expiring after a few days would help with that ;)

Nxllpointer avatar Oct 19 '22 07:10 Nxllpointer

whats the point of keeping bookmarks for an user who is gone?

if someone left the server by mistake and join just after that they'll loose all their bookmarks, also iirc the current system automatically removes the bookmarks after 3 days so if they actually left the server the bookmark will be gone after 3 days automatically

Taz03 avatar Oct 19 '22 07:10 Taz03

@Taz03 im doing a full rewrite

Nxllpointer avatar Oct 19 '22 07:10 Nxllpointer

How about adding a /bookmarks delete command that gives you a message with a selection menu which to delete, like you can do with your helper roles?

Nxllpointer avatar Oct 19 '22 07:10 Nxllpointer

How about adding a /bookmarks delete command that gives you a message with a selection menu which to delete, like you can do with your helper roles?

i like the selection menu suggestion. note though that selection menus are limited. so it needs a page parameter as well. such as /boomarks delete show-page: 3

if someone left the server by mistake and join just after that they'll loose all their bookmarks

then we delay the deletion for a week. but we should still cleanup bookmarks from dead users. for example by adding a column to the database delete_at TIMESTAMP with a cleanup routine. adding such a column is probably a good idea anyways, since its generic enough to also be used in a different context.

Bookmarks expiring after a few days would help with that ;)

for me, thats a no-go. the point of a bookmark is to have, well, a bookmark. i want to be able to view that again in 1 year.

Zabuzard avatar Oct 19 '22 07:10 Zabuzard

Ok so now lets recap how this should be done.

Noone had something to say about the bookmark add command so it should stay the same. For listing bookmarks i would suggest still using a pagination system but with 10 bookmarks per page. The user can then choose in a SelectionMenu (25 entries max) which bookmarks to delete.

React with :+1: if you agree

Nxllpointer avatar Oct 21 '22 16:10 Nxllpointer

@Nxllpointer sounds good to me. but the deletion part needs some sort of pagination system (as explained above) as well. users could have hundreds of bookmarks and it has to be able to handle that.

Zabuzard avatar Oct 21 '22 17:10 Zabuzard

wait so the list command still do the delete stuff? i'd say have a separate command for deleting, how it'll work is u get an embed with pagination (25 bookmarks per page, as embed fields) the fields will just be the tag nothing else we don't need that info here list is for that purpose and we'll have a selection menu to select and then click the delete button to delete

Taz03 avatar Oct 21 '22 17:10 Taz03

@Taz03 sounds good

Nxllpointer avatar Oct 21 '22 17:10 Nxllpointer

Ok. So I did a full rewrite of this feature. Spam protection and the note size limit will be added later today. I had to force push this because when starting this feature I accidentially based my branch on the modmail feature branch.

Nxllpointer avatar Oct 25 '22 10:10 Nxllpointer

Ok. So I did a full rewrite of this feature. Spam protection and the note size limit will be added later today. I had to force push this because when starting this feature I accidentially based my branch on the modmail feature branch.

Cool stuff. Could you add pictures of all the features? Easier to review with that :) For example the delete stuff isnt on the picture yet.

Zabuzard avatar Oct 25 '22 12:10 Zabuzard

Oh yes i wanted to but forgot about it.

Nxllpointer avatar Oct 25 '22 12:10 Nxllpointer

y the selection in the select menu says "delete bookmark n"?? y not just its title

Taz03 avatar Oct 25 '22 15:10 Taz03

@Taz03 great question. I will change it

Nxllpointer avatar Oct 25 '22 16:10 Nxllpointer

Ok. My todo list is now complete. I would be very happy to get feedback on this and finally being done with this feature.

Nxllpointer avatar Oct 25 '22 21:10 Nxllpointer