Skip to content

Add component formatting support with Table class#113

Open
chrisdedman wants to merge 5 commits into
mainfrom
component-formatting-class
Open

Add component formatting support with Table class#113
chrisdedman wants to merge 5 commits into
mainfrom
component-formatting-class

Conversation

@chrisdedman

Copy link
Copy Markdown
Contributor

Description

Added a new Table component for structured message rendering and support for sending component-formatted messages in Room and Context. This will improve the messaging capabilities by allowing more organized and visually appealing message formats.

Type of Change

  • Feature
  • Refactor
  • Bug fix
  • Documentation
  • Other: ___

Pre-merge Checklist

  • Run tests: pytest
  • Run type check: mypy
  • Run formatting: black .

@chrisdedman chrisdedman added the feature A new feature label Jul 9, 2026
@chrisdedman chrisdedman requested a review from PenguinBoi12 July 9, 2026 00:05
@chrisdedman chrisdedman self-assigned this Jul 9, 2026
Comment thread matrix/component.py

rows += f"<tr>{''.join(row_cells)}</tr>"

return f"""<blockquote>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we still need the blockquote?

@PenguinBoi12 PenguinBoi12 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's mostly good for me, the only thing I don't like is the html formatting. While we don't use anything else; write raw html, I think it's worth doing something like https://github.com/Code-Society-Lab/ada/blob/bc56c97b129e8c53d63cd1418f520caa0f802d21/bot/extensions/moderation/kick_extension.py#L10

You also forgot tests

Comment thread matrix/room.py
self,
content: str | None = None,
*,
component: Component | None = None,

@PenguinBoi12 PenguinBoi12 Jul 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would prefer this to be after file in the list of parameters/keep raw and notice the 2 first after the *

Same for context.

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

Labels

feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants