Skip to content

Conversation

NeloBlivion
Copy link
Member

@NeloBlivion NeloBlivion commented Sep 3, 2025

Summary

  • View and Modal now only support original components (Button / Select, InputText) - assume behavior from <=2.6.1
  • New components are now used in DesignerView and DesignerModal (names not finalised idk)
  • Usage is basically the same as rc1, with some differences
    • DesignerView and Container do not support Button, @button, Select and @select directly; use ActionRow instead.
    • Section still supports Button as accessory and the button decorator
    • DesignerModal does not support InputText and Select directly; use Label instead. TextDisplay still works as a top-level component.
    • InputText.description, Select.label and Select.description are removed as they are part of the Label component
  • DesignerView can still be used for v1 messages (supporting content and embeds) if you want to migrate to ActionRow for any reason.
  • Attempting to add ActionRow to a View will add the row's children instead
  • Item has been split into ViewItem and ModalItem
    • InputText and Label now inherit ModalItem
    • All View-based items now inherit ViewItem
    • Select and TextDisplay inherit both ViewItem and ModalItem (even though Select is not a top-level modal item, i believe it still fits)

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 added this to the v2.7 milestone Sep 3, 2025
@NeloBlivion NeloBlivion self-assigned this Sep 3, 2025
@NeloBlivion NeloBlivion changed the title fix: general issues with views feat: ui.ActionRow Sep 3, 2025
@NeloBlivion
Copy link
Member Author

changing this to a general feature pr teehee

@NeloBlivion NeloBlivion changed the title feat: ui.ActionRow feat: redo CV2 and New Modal implementation Sep 16, 2025
@NeloBlivion NeloBlivion mentioned this pull request Sep 18, 2025
9 tasks
@Soheab
Copy link
Contributor

Soheab commented Oct 4, 2025

Needs to update ext.pages too.

Copy link
Member

@Paillat-dev Paillat-dev left a comment

Choose a reason for hiding this comment

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

The provided example code's /modaltest command is all broken.

Traceback (most recent call last):
  File "C:\Users\jerem\Documents\pycord\pycord\discord\bot.py", line 1154, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "C:\Users\jerem\Documents\pycord\pycord\discord\commands\core.py", line 435, in invoke
    await injected(ctx)
  File "C:\Users\jerem\Documents\pycord\pycord\discord\commands\core.py", line 146, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: InputText.__init__() got an unexpected keyword argument 'description'

removing the description kwarg causes additional errors

@NeloBlivion
Copy link
Member Author

The provided example code's /modaltest command is all broken.

Did you update? I already tested this example and it works fine

@Paillat-dev
Copy link
Member

Idk what I was thinking, I used the FileUpload pr example code for some reason 💀

@Paillat-dev Paillat-dev linked an issue Oct 5, 2025 that may be closed by this pull request
3 tasks
@Paillat-dev
Copy link
Member

Nevermind

Traceback (most recent call last):
  File "C:\Users\jerem\Documents\pycord\pycord\discord\commands\core.py", line 138, in wrapped
    ret = await coro(arg)
          ^^^^^^^^^^^^^^^
  File "C:\Users\jerem\Documents\pycord\pycord\discord\commands\core.py", line 1106, in _invoke
    await self.callback(ctx, **kwargs)
  File "C:\Users\jerem\Documents\pycord\pycord\test_model3.py", line 93, in show_view
    await ctx.respond(view=MyView(ctx.author), files=[file])
  File "C:\Users\jerem\Documents\pycord\pycord\discord\interactions.py", line 713, in respond
    return await self.response.send_message(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jerem\Documents\pycord\pycord\discord\interactions.py", line 1036, in send_message
    payload["components"] = view.to_components()
                            ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jerem\Documents\pycord\pycord\discord\ui\core.py", line 112, in to_components
    return [item.to_component_dict() for item in self.children]
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jerem\Documents\pycord\pycord\discord\ui\action_row.py", line 391, in to_component_dict
    self._set_components(self.items)
                         ^^^^^^^^^^
AttributeError: 'MyRow' object has no attribute 'items'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\jerem\Documents\pycord\pycord\discord\bot.py", line 1154, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "C:\Users\jerem\Documents\pycord\pycord\discord\commands\core.py", line 435, in invoke
    await injected(ctx)
  File "C:\Users\jerem\Documents\pycord\pycord\discord\commands\core.py", line 146, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'MyRow' object has no attribute 'items'

@NeloBlivion
Copy link
Member Author

ok actually fixed

Copy link
Member

@Paillat-dev Paillat-dev left a comment

Choose a reason for hiding this comment

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

Works now, minor mishap

Traceback (most recent call last):
  File "C:\Users\jerem\Documents\pycord\pycord\test_model3.py", line 78, in on_timeout
    await self.parent.edit(view=self)
          ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'edit'

Paillat-dev
Paillat-dev previously approved these changes Oct 6, 2025
Copy link
Member

@Paillat-dev Paillat-dev left a comment

Choose a reason for hiding this comment

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

Nah whatever this is fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button Behaviour Inconsitency when using rows parameter
6 participants