SGA-A / c2c

Source code for the custom app exclusive to cc, where most interactions begin and end.
MIT License
2 stars 0 forks source link

Rewrite the showcase #104

Closed SGA-A closed 1 month ago

SGA-A commented 2 months ago

Is your feature request related to a problem? Please describe.

This is an issue that requests for the showcase to be rewritten. The way it is stored as well as the algorithms used will be rewritten again entirely from scratch.

Describe the solution you'd like

We want to make a single command that is used to manage your entire showcase. The fundamentals behind how this logic works needs to be firm.

A single callback This function defines the select options that will be displayed along with the logic that returns the embed for what the showcase will look like on the Discord UI. It will also return a list of tuples. It makes a single query to the database that fetches all the item metadata, item ID sorted by its position. This function is called every single time an interaction is made with the view this command is in to invalidate possibly outdated data. No cache systems are built in for the sake of keeping it simple.

Here's the gist of what this function will do:

Button logic [Not Complete] This will list all the buttons, what they do and how to behave in certain scenarios. The brackets containing Unicode Character indicates that there will be no label on the button, just an emoji representing what it does.

Select menu logic [Not Complete] Based on what's selected and where it's selected the buttons to move up and down will be disabled. By default, the first time you view the showcase, you will always have selected the first item (or nothing if it doesn't exist). Therefore, the item should be disabled immediatley when the class is instantiated.

In any callback, whether it be a button or a select menu, should refresh the showcase by checking it again in the database. It doesn't matter if changes weren't made, we call the database for a double check regardless.

Describe alternatives you've considered

None at this time.

SGA-A commented 1 month ago

We are considering placing everything in one command. So there will be buttons to remove and items instead of making them seperate commands. This isn't definite though.

Update: This has been made definite and will be implemented in this way.

SGA-A commented 1 month ago

Most of what we said was going to be made was not implemented, simply because of how complex it had gotten. Keeping track of states on every interaction is not easy, and we weren't willing to let the bot keep up with it. It's now stateless and you can no longer change the positioning of items in your showcase. In the end, we just wanted a functional and efficient showcase management system.