fix(components): align multi-select ListBox checkbox to the primary line - #1958
Draft
sruthykumar wants to merge 2 commits into
Draft
fix(components): align multi-select ListBox checkbox to the primary line#1958sruthykumar wants to merge 2 commits into
sruthykumar wants to merge 2 commits into
Conversation
Co-Authored-By: skumar@launchdarkly.com <sruthy@gmail.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
🦋 Changeset detectedLatest commit: c3fc03d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Co-Authored-By: skumar@launchdarkly.com <sruthy@gmail.com>
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
DSYS-271.
ListBoxIteminheritsalign-items: centerfrom the shared Menu item rule, so in multi-select items with a stacked label/description the selection checkbox floats between the two lines. Per design review the checkbox should sit with the primary (label) line.styles/ListBox.module.cssnow top-aligns the row only when the item renders a selection checkbox, and gives that checkboxheight: 1lhwith centered content — the same patternCheckbox.module.css.containeralready uses to align a checkbox to the first line of its label:ListBox.tsxpasses the new class throughcheckboxStyles({ className: styles.checkbox }). The:has()/ descendant selectors are deliberate:.itemcomposes the Menu item class, so a bare.item { align-items: start }loses the cascade toMenu.module.cssin the built bundle.Single-select and non-selectable items keep their current centering, and Menu items are untouched.
Screenshots (if appropriate):
LaunchPad Storybook —
Components/Collections/ListBox → DescriptionswithselectionMode: multiple.Before:
After:
Single-line multi-select and icon items are unaffected:
Product consumers (gonfalon Storybook, built package linked in)
ContextKindSelector(multi-select, kinds with descriptions) — the ticket's case:Before:
After:
ResourceSelector(metric picker):Before:
After:
Single-line consumers are pixel-identical before/after (
ContextKindSelectorwithout descriptions,ContextKindSelect), and the product-analyticsMultiSelectis built onMenu, so it is unchanged by this PR.Testing approaches
@launchpad-ui/componentslinked intonode_modules, comparingmainvs this branch; verified computed styles (align-items: start, checkbox box height1lh) and pixel-diffed each story.pnpm vitest run packages/components/__tests__/ListBox.spec.tsx,biome checkon the changed files.Link to Devin session: https://app.devin.ai/sessions/1d0c64cb604f49c4aa269f1c9313411a
Requested by: @sruthykumar