Skip to content

gpui: Add grid repeat min content API#44973

Merged
smitbarmase merged 1 commit intomainfrom
add-grid-repeat-min-content
Dec 16, 2025
Merged

gpui: Add grid repeat min content API#44973
smitbarmase merged 1 commit intomainfrom
add-grid-repeat-min-content

Conversation

@smitbarmase
Copy link
Member

@smitbarmase smitbarmase commented Dec 16, 2025

Required for #44712

We started using grid for Markdown tables instead of flex (#42674). This resulted in tables having a width of 0 inside popovers, since popovers are laid out using AvailableSpace::MinContent.

One way to fix this is to lay out popovers using MaxContent instead. But that would affect all Markdown rendered in popovers and could change how popovers look, or regress things.

The other option is to fix it where the problem actually is: repeat(count, vec![minmax(length(0.0), fr(1.0))]). Since the minimum width here is 0, laying things out with MinContent causes the Markdown table to shrink completely. What we want instead is for the minimum width to be the min-content size, but only for Markdown rendered inside popovers.

This PR does exactly that, without interfering with the grid_cols API, which intentionally follows a TailwindCSS-like convention. See #44368 for context.

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 16, 2025
@smitbarmase smitbarmase merged commit f358b95 into main Dec 16, 2025
24 checks passed
@smitbarmase smitbarmase deleted the add-grid-repeat-min-content branch December 16, 2025 11:39
smitbarmase added a commit that referenced this pull request Dec 16, 2025
Closes #44306

This PR makes two changes:
- Uses the new `grid_cols_min_content` API. See more here:
#44973.
- Changes Markdown table rendering to use a single grid instead of
creating a new grid per row, so column widths stay consistent across
rows.

Release Notes:

- Fixed an issue where Markdown tables wouldn't render in the hover
popover.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant