[codex] Fix markdown table column layout#2202
Open
suxiaoshao wants to merge 1 commit intolongbridge:mainfrom
Open
[codex] Fix markdown table column layout#2202suxiaoshao wants to merge 1 commit intolongbridge:mainfrom
suxiaoshao wants to merge 1 commit intolongbridge:mainfrom
Conversation
Member
|
It seems the implementation direction might be wrong, as it uses a lot of GPUI basic layout text APIs, which shouldn't be so complicated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2197
Description
This PR fixes markdown table cells overflowing or wrapping incorrectly in
TextView::markdown(...).The previous table renderer approximated column widths with content length and then relied on flex layout. That diverged from browser table layout behavior in two important ways:
The fix follows the browser
table-layout: automodel more closely:preferredwidth from actual shaped textmin-contentwidth from the longest unbreakable segment in its cellsThis keeps short columns stable, allows long columns to wrap first, and matches browser table behavior much more closely for both two-column and multi-column markdown tables.
This work was investigated and implemented with assistance from Codex GPT-5.4.
Screenshot
How to Test
Validated locally with:
cargo test -p gpui-component table_cell_segments --libcargo test -p gpui-component allocate_widths --libChecklist
cargo runfor story tests related to the changes.