kord icon indicating copy to clipboard operation
kord copied to clipboard

Feat/components v2

Open DRSchlaubi opened this issue 6 months ago • 1 comments

DRSchlaubi avatar Apr 26 '25 16:04 DRSchlaubi

Hey @DRSchlaubi ! Nice PR. I had to make a few tiny changes to make it work here:

  • in the common module, regenerate code and dump API again
  • in the rest module, dump API again
  • make DiscordComponent.description both Optional and nullable [1]

You can see the details in the last three commits here: https://github.com/ptitjes/kord/commits/feat/components-v2-didier/

[1] When deserializing the incoming messages in the Gateway, the description field sent back by Discord was null, and this was creating a deserialization error.

ptitjes avatar May 11 '25 12:05 ptitjes

I haven't had time to look into things in detail yet, but the presence of AbstractMessageCreateBuilder and AbstractMessageModifyBuilder is a strong indictment of Kord's development philosophy, imo.

These types aren't new and weren't even touched in this PR, they have been there since #891

This approach makes no sense from a logical viewpoint, and will significantly complicate things for API consumers - now instead of having a single base type that already worked everywhere, I need to mix between the interface and abstract type depending on whether I want to use components or not, and I need to go back over every single piece of code that currently uses the interface to make sure it doesn't now actually need the abstract type.

I couldn't find anything you can do with the Abstract* classes that you can't do with the interfaces. Did you need to use the Abstract* classes in some code? You shouldn't have to.

lukellmann avatar Jul 02 '25 23:07 lukellmann

Is there something that can be helped with regarding this PR?

Would love to see this implemented.

Galarzaa90 avatar Aug 27 '25 08:08 Galarzaa90

#1019, #1018 need fixing

DRSchlaubi avatar Aug 27 '25 13:08 DRSchlaubi

tested around a bit and so far there was no error during the entire testing that could have been related to components v2

Edit: found out the hard way that a section cant have more than 3 text displays.

NotJansel avatar Sep 29 '25 17:09 NotJansel

Is this PR only targeting Components V2 in messages? I tried out the branch for my discord bot because I'd like to use a string select component in my modal, but it seems like I can only attach action rows to my modal (which limits me to text inputs only), and labels aren't supported.

honkling avatar Nov 06 '25 01:11 honkling

@honkling to my knowlede yes, as the modal stuff got added pretty much right after this pr was ready for review/merge

NotJansel avatar Nov 06 '25 10:11 NotJansel

Hmm. Then, should components v2 support for modals be expected in a future PR? Or will this PR expand scope to accommodate modals?

honkling avatar Nov 06 '25 21:11 honkling