Fix markdown table rendering in the agent panel (#52864)

This PR reverts part of
https://github.com/zed-industries/zed/pull/50839, as it was causing bad
clipping in the agent panel

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2026-03-31 17:10:29 -07:00 committed by GitHub
parent a12601f863
commit 20b140664d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1609,23 +1609,18 @@ impl Element for MarkdownElement {
builder.table.start(alignments.clone());
let column_count = alignments.len();
builder.push_div(
div().flex().flex_col().items_start(),
range,
markdown_end,
);
builder.push_div(
div()
.id(("table", range.start))
.min_w_0()
.grid()
.grid_cols(column_count as u16)
.when(self.style.table_columns_min_size, |this| {
this.grid_cols_min_content(column_count as u16)
})
.when(!self.style.table_columns_min_size, |this| {
this.grid_cols_max_content(column_count as u16)
this.grid_cols(column_count as u16)
})
.w_full()
.mb_2()
.border(px(1.5))
.border_color(cx.theme().colors().border)
@ -1770,7 +1765,6 @@ impl Element for MarkdownElement {
}
}
MarkdownTagEnd::Table => {
builder.pop_div();
builder.pop_div();
builder.table.end();
}