Conversation
Compute and vpc measure tag labels with a canvas to decide how many badges fit a column and collapse the rest into a "+N" badge (TagOverflowList); teams does the same by count for permission codes (PermissionBadges). BadgeGroup covers both: `maxVisible` limits by count, `maxWidth` measures the labels against the available width, and the overflow badge is a focusable button whose tooltip lists the hidden labels, with the complete list kept in an sr-only span.
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.
Summary
Compute and vpc (
TagOverflowList) measure tag labels with a canvas to decide how many badges fit a table column and collapse the rest into a "+N" badge; teams (PermissionBadges) does the same by count.BadgeGroup(new): rendersitemsas badges.maxVisiblelimits by count,maxWidthmeasures the labels (canvas + ResizeObserver, re-measured once fonts load) to fit the available width. Hidden items collapse into a focusable "+N" badge whose tooltip lists them (itemsPerTooltipLine, orrenderOverflowfor custom content); the full label list stays in ansr-onlyspan.overflowLabel(count)localises the button name;variant/size/leftIconpass through toBadge.Test plan
maxVisiblecollapse + tooltip, sr-only full list, custom label and overflow content, empty items, unmeasurable width falls back to all, axenpx vitest run lib/components/BadgeGroup, lint, types, prettierBadgeGroup(count-limited and width-limited rows)