The plain elements of buttons, selects and modals (Effect's
effect/chat/ChatUi).
These are what goes on the wire, into ChatTest and into storage: every
element is a schema class and every value in one is already a string.
chat_interaction holds the typed definitions that build them and
receive their clicks; a consumer that routes clicks itself builds them
directly.
postandedittake a flat list ofActionbeside the Markdown, and the adapter lays out the rows.- Text in a modal is plain, not Markdown: a Slack modal cannot hold a
markdownblock.
Values#
| Attribute | Type | Description |
|---|---|---|
BUTTON_STYLE | LiteralsSchema[Literal['default', 'primary', 'danger']] | |
ACTION | S.Bottom[Action] | |
MODAL_ELEMENT | S.Bottom[ModalElement] |
Types#
| Type | Definition | Description |
|---|---|---|
ButtonStyle | type ButtonStyle = Literal['default', 'primary', 'danger'] | |
Action | type Action = Button | LinkButton | Select | What |
ModalElement | type ModalElement = TextInput | SelectInput | Text | One element of a modal. |
Classes#
Functions#
link_button#
link_button(*, label, url) -> LinkButtonA button that opens url, to put a link beside a message's
buttons. It is the one element with no definition in
chat_interaction, since it produces no click.
| Parameter | Type | Description |
|---|---|---|
label | str | |
url | str |
Returns LinkButton
def link_button(*, label: str, url: str) -> LinkButton:
"""A button that opens ``url``, to put a link beside a message's
buttons. It is the one element with no definition in
``chat_interaction``, since it produces no click."""
return LinkButton(label=label, url=url)