Skip to content

Conversation

mkrasnitski
Copy link
Collaborator

Labels are a new top-level component only supported in modals that can hold a Text Input or Select Menu inside it. Oddly enough, the label and description are removed from the label payload when sent back as part of a modal response. See the docs.

Text Inputs inside Action Rows are deprecated, therefore I removed the InputText variant for ActionRowComponent. Also, at the moment modals can include Action Rows, Text Displays, and Labels as top-level components, so I changed modal responses to store Component instead of ActionRow and added a text method to quick modals. I thought about adding select menu support to quick modals but the methods felt a little too verbose.

@github-actions github-actions bot added model Related to the `model` module. builder Related to the `builder` module. examples Related to Serenity's examples. collector Related to the `collector` module. labels Oct 7, 2025
@github-actions github-actions bot removed the examples Related to Serenity's examples. label Oct 7, 2025
@GnomedDev
Copy link
Member

Why remove StaticU8? I'm fine with it, as it's a minor performance opt, but I just want the reason written down somewhere.

@mkrasnitski
Copy link
Collaborator Author

The CreateButton and CreateInputText structs have a kind field of type ComponentType already, so this is an inconsistency that I wanted to resolve. Also, ComponentType is a fake enum since it uses the enum_number! macro, meaning it's actually a newtype around u8, same as StaticU8. I'll make a follow-up PR removing the kind fields entirely and just inserting it at serialization time, since it doesn't serve any other purpose.

@DPlayer234
Copy link
Contributor

Wasn't that the point of StaticU8? It was a ZST that would serialize an integer but not take up any memory at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builder Related to the `builder` module. collector Related to the `collector` module. model Related to the `model` module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants