Skip to content

Bookmark Command - #634

Merged
Zabuzard merged 68 commits into
Together-Java:developfrom
Nxllpointer:feature/bookmarks
Nov 29, 2022
Merged

Zabuzard merged 68 commits into
Together-Java:developfrom
Nxllpointer:feature/bookmarks

Conversation

@Nxllpointer

@Nxllpointer Nxllpointer commented Oct 16, 2022 •

Copy link
Copy Markdown
Contributor

Closes (#570)

  • Implement /bookmarks add [note] command
  • Implement /bookmarks list command
  • Implement /bookmarks remove command
  • Limit note size
  • Add spam protection
  • Delete bookmarks of users that left the server after a week

Screenshots:
(2 entries a page for demonstrating purposes)
imageimageimageimageimageimageimage

@marko-radosavljevic

Copy link
Copy Markdown
Contributor

Thank you for your contribution, and welcome to the project! ☺️ ❤️

@Nxllpointer

Copy link
Copy Markdown
Contributor Author

Thank you!

@marko-radosavljevic

Copy link
Copy Markdown
Contributor

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. ^^

@Nxllpointer

Copy link
Copy Markdown
Contributor Author

Ah ok great. Im gonna fix them real quick

@Nxllpointer

Copy link
Copy Markdown
Contributor Author

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.

@Taz03 Taz03 added enhancement New feature or request new command Add a new command or group of commands to the bot priority: normal labels Oct 16, 2022
@Taz03

Taz03 commented Oct 17, 2022

Copy link
Copy Markdown
Contributor

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

@Zabuzard

Copy link
Copy Markdown
Member

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.

@Nxllpointer

Nxllpointer commented Oct 17, 2022 •

Copy link
Copy Markdown
Contributor Author

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

@Nxllpointer
Nxllpointer marked this pull request as ready for review October 17, 2022 13:46
@Nxllpointer
Nxllpointer requested review from a team as code owners October 17, 2022 13:46
@Nxllpointer

Copy link
Copy Markdown
Contributor Author

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

@Nxllpointer
Nxllpointer requested a review from Taz03 October 17, 2022 14:18
@Taz03

Taz03 commented Oct 17, 2022

Copy link
Copy Markdown
Contributor

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

@Nxllpointer

Copy link
Copy Markdown
Contributor Author

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.

@Tais993 Tais993 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'll do a full review tomorrow, but just submitting this for now

@Zabuzard Zabuzard left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

mh. do it like this:

  • limit the bookmarks per user to 500.
  • delete bookmarks for an user if they leave the guild
  • delete bookmarks for threads that are deleted (not archived, deleted)
  • write a warning message in modauditlog if the total amount of bookmarks exceeds 1 million
  • totally block creation of new bookmarks for everyone once the total amount exceeds 1_100_000 bookmarks

disk space isnt really a concern for us. we just have to prevent that someone exploits it and spams us to death (gigabytes, terrabytes)

this should do the trick and is easier than expiration

and better ux, since the user doesnt have to keep their bookmarks alive

@Zabuzard Zabuzard left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

@Taz03

Taz03 commented Oct 18, 2022

Copy link
Copy Markdown
Contributor

delete bookmarks for an user if they leave the guild

no, y?

@Taz03

Taz03 commented Oct 18, 2022

Copy link
Copy Markdown
Contributor

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?

@Zabuzard

Copy link
Copy Markdown
Member

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

Zabuzard commented Oct 19, 2022 •

Copy link
Copy Markdown
Member

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.

@Nxllpointer

Nxllpointer commented Oct 19, 2022 •

Copy link
Copy Markdown
Contributor Author

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

@Nxllpointer

Copy link
Copy Markdown
Contributor Author

Days since messing up my commit history: 0

@Zabuzard
Zabuzard self-requested a review November 2, 2022 19:17
@Nxllpointer
Nxllpointer requested a review from Tais993 November 4, 2022 17:37
@Taz03

Taz03 commented Nov 8, 2022

Copy link
Copy Markdown
Contributor

make a package coz u have multiple files

@Zabuzard Zabuzard self-assigned this Nov 9, 2022
Zabuzard and others added 6 commits November 10, 2022 10:47
* BookmarksPaginationHandler -> BookmarksListRemoveHandler
* RequestWithPagination -> Request
- Moved to own package
- Improved code design
- Naming changes
@Nxllpointer

Copy link
Copy Markdown
Contributor Author

Zabuzards rework has been merged dd85945

@Nxllpointer

Copy link
Copy Markdown
Contributor Author

Everything resolved and no conflicts anymore. We should be able to merge now

@Zabuzard
Zabuzard merged commit fa434fe into Together-Java:develop Nov 29, 2022
@Zabuzard Zabuzard mentioned this pull request Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request new command Add a new command or group of commands to the bot priority: normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants