grid_cols_max_contentfor content-based column widths (#50839)
Summary Add a new grid_cols_max_content GPUI styling API that uses minmax(0, max-content) for grid column sizing. This allows columns to automatically size based on their content width while remaining responsive when the container shrinks. Applied the fix to both markdown preview (markdown_renderer.rs) and agent panel (markdown.rs) table rendering. Table borders now wrap tightly around content instead of stretching to full container width. Fixes #50044 Approach A new grid_cols_max_content API is added (as discussed with @MikaylaMaki): style.rs — New grid_cols_max_content: Option<u16> field styled.rs — New .grid_cols_max_content(cols) builder method taffy.rs — New to_grid_repeat_max_content() using minmax(0, max-content) markdown_renderer.rs — Swapped .grid_cols() → .grid_cols_max_content(), moved border to grid div, wrapped in v_flex().items_start() so border hugs content markdown.rs — Applied same fix for agent panel tables: grid_cols_max_content, border on grid div, wrapped in div().flex().flex_col().items_start() container Screenshots Before (equal-width columns, border stretches full width): <img width="1386" height="890" alt="Screenshot 2026-03-06 at 2 17 54 PM" src="https://github.com/user-attachments/assets/42cf76c4-6eba-4919-9b16-78c7fc823315" /> <img width="2555" height="1308" alt="original issue" src="https://github.com/user-attachments/assets/22b0fc02-5203-48bb-8f03-7aa8255197cc" /> After — Markdown Preview and Agent Panel <img width="2554" height="1317" alt="Screenshot 2026-03-07 at 2 29 28 PM" src="https://github.com/user-attachments/assets/8849988e-9ba8-4388-9c29-a255e0ecc52b" /> Before you mark this PR as ready for review, make sure that you have: Added a solid test coverage and/or screenshots from doing manual testing Done a self-review taking into account security and performance aspects Aligned any UI changes with the UI checklist Release Notes: Fixed markdown table columns to use content-based auto-width instead of equal-width distribution in both markdown preview and agent panel (#50044). --------- Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).
Other platforms are not yet available:
- Web (tracking issue)
Developing Zed
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.
Sponsorship
Zed is developed by Zed Industries, Inc., a for-profit company.
If you’d like to financially support the project, you can do so via GitHub Sponsors. Sponsorships go directly to Zed Industries and are used as general company revenue. There are no perks or entitlements associated with sponsorship.