Skip to content

markdown: Fix Markdown table not rendering in hover popover#44712

Merged
smitbarmase merged 3 commits intomainfrom
fix-markdown-grid
Dec 16, 2025
Merged

markdown: Fix Markdown table not rendering in hover popover#44712
smitbarmase merged 3 commits intomainfrom
fix-markdown-grid

Conversation

@smitbarmase
Copy link
Member

@smitbarmase smitbarmase commented Dec 12, 2025

Closes #44306

This PR makes two changes:

  • Uses the new grid_cols_min_content API. See more here: gpui: Add grid repeat min content API #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.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 12, 2025
@smitbarmase smitbarmase self-assigned this Dec 15, 2025
smitbarmase added a commit that referenced this pull request Dec 16, 2025
Required for #44712

We started using `grid` for Markdown tables instead of flex. 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
@smitbarmase smitbarmase merged commit 68295ba into main Dec 16, 2025
24 checks passed
@smitbarmase smitbarmase deleted the fix-markdown-grid branch December 16, 2025 12:41
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.

Glitch in context popup when hovering integer in Zig language

1 participant