Skip to content

feat: General enhancements for views#3093

Open
NeloBlivion wants to merge 149 commits intoPycord-Development:masterfrom
NeloBlivion:view_additions
Open

feat: General enhancements for views#3093
NeloBlivion wants to merge 149 commits intoPycord-Development:masterfrom
NeloBlivion:view_additions

Conversation

@NeloBlivion
Copy link
Copy Markdown
Member

@NeloBlivion NeloBlivion commented Feb 7, 2026

Summary

  • replace_item added to DesignerView, ActionRow, Section, Container, and MediaGallery
  • add_item supports positioning with parameters before, after, and index
  • get_item supports getting items by any attribute instead of just id and custom_id
  • Implements Message.get_view to retrieve a stored view or generate a new view
  • Implements len(View) to get the true item count in a view
  • Implements all add_x variants on DesignerView
  • Implements add_text and add_label on DesignerModal
  • Implements DesignerModal.from_dict
  • Added read, save, and to_file to UnfurledMediaItem
  • Added easy conversions for MediaGallery
  • Fixed up some typing

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

@NeloBlivion NeloBlivion requested review from a team and Paillat-dev March 22, 2026 21:41
Lumabots
Lumabots previously approved these changes Mar 25, 2026
Copy link
Copy Markdown
Contributor

@Lumabots Lumabots left a comment

Choose a reason for hiding this comment

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

lgtm, tested on my bot for weeks and no issue to declare

for item in custom_view.children:
self.add_item(item)

def clear_items(self) -> Self:
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.

So not sure this is necessary after my other fix but doesn't hurt to keep it in tbh.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

if there have been no issues with your fix, it may be better for me to revert this

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.

Up to you to decide what is better. I'll double check that the issue is still fixed too later

@Lulalaby Lulalaby requested a review from a team March 25, 2026 11:38
NeloBlivion and others added 16 commits March 27, 2026 18:17
Co-authored-by: Paillat <jeremiecotti@ik.me>
Signed-off-by: Nelo <41271523+NeloBlivion@users.noreply.github.com>
Co-authored-by: Paillat <jeremiecotti@ik.me>
Signed-off-by: Nelo <41271523+NeloBlivion@users.noreply.github.com>
Co-authored-by: Paillat <jeremiecotti@ik.me>
Signed-off-by: Nelo <41271523+NeloBlivion@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

components Related to discord components (Views + Modals) feature Implements a feature

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Overloads for DesignerView etc

6 participants