Repository navigation
Add a badges slot to DataTable columns - #225
Open
andrewhuhh wants to merge 3 commits into
Open
andrewhuhh wants to merge 3 commits into
andrewhuhh wants to merge 3 commits into
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
💬 Discussion in Slack: #pr-review-cipher-225-add-a-badges-slot-to-datatable-columns Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel. |
[Medium impact] The PR appears safe to merge.
|
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This branch has not been deployed
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.
A DataTable cell ellipsizes plain text, but a value with something after it (a status badge, or an info icon with a tooltip) needs a flex row. Each table built that row by hand, with inline
overflow,text-overflowandflex-shrinkstyles, and a cell that missed one of them clipped its icon or lost its name.DataTableColumnnow takesbadges: (row, index) => ReactNode, rendered right after the value throughNameLine. Under pressure, badges withcollapseshrink first. Then a long value truncates with an ellipsis down to a 12-character floor, and only then do the badges clip. The value'stexttitle and the cell's mono and wrap options work as before.The table page's narrow-cells example now uses the slot instead of its own flex row and
truncateclass. Desktop baselines are unchanged. At 390px the name column is only 64px wide, so the long imported row keeps its name and drops the badge, where before it showed the clipped badge and no name: