-
Notifications
You must be signed in to change notification settings - Fork 183
feat💥: add support for new features in modals #1784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: breaking
Are you sure you want to change the base?
Conversation
6c7bc2d to
e0893d7
Compare
|
Retooled this PR to be a catch-all for new modal features, since each phase tends to build upon the last. |
Many attempts have been made to make this non-breaking - this means the UX is a little bit off. Also, as title says, untested.
This requires breaking the assumption that responses always has string keys. That being said, since this is Discord breaking things, not us, this should be fine for a non-breaking release.
Signed-off-by: Astrea <25420078+AstreaTSS@users.noreply.github.com>
939cb8a to
b136375
Compare
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## breaking #1784 +/- ##
============================================
- Coverage 46.66% 46.51% -0.15%
============================================
Files 149 149
Lines 16602 16672 +70
============================================
+ Hits 7747 7755 +8
- Misses 8855 8917 +62 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Totally forgot Discord did this, oops.
Apparently this has been possible for a while now.
Pull Request Type
Description
This PR adds support for using new features in components related to
LabelComponent. This includesLabelComponentitself as well as select menus and file uploads.To use select menus or file uploads, users must use the new
LabelComponent, which also allows adding more flexible labels to questions.requiredvalue to control if they are required or not.FileUploadComponent, which is rather self-explanatory in terms of functionality.To get the values the user selects from these new options,
responsesinModalContexthas been changed to bedict[str, Any]as opposed todict[str, str]. This is a breaking change, but it shouldn't be considered a feature that cannot be merged until v6 because:InputTextstill returns a string, as expected. This only potentially breaks things if one were iterating throughresponses.Changes
LabelComponent.Modalto be able to handleLabelComponent.responsesforModalContextdict[str, Any].dict[str, str | list]- Discord plans on adding more components that break this assumption, though.ModalContextable to handleLabelComponentand the new options.FileUploadComponent.Related Issues
Test Scenarios
Python Compatibility
3.10.x3.11.xChecklist
pre-commitcode linter over all edited files