You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dropdown no longer composes Compass Button. The trigger is its own <button type="button">, so padding, hover, active, focus, and disabled live only on .dropdown and no longer tie a quaternary medium Button.
Public props are unchanged: size, padding, appearance, isOpen, leadingIcon, disabled, and button attributes including aria-*. The repeated-class overrides, the --button-fg overrides, and the display: contents rule that undid Button's label wrapper are gone.
Default markup changes. The trigger no longer has Button's classes or the button__label wrapper. Consumer updates are separate; this PR does not touch mattermost-plugin-agents#1231.
The Dropdown guideline puts the Anatomy and Inverted labels in expressions ({'design'}) so MDX does not wrap them in a <p>. A label on its own line was becoming a paragraph, and the docs prose margin showed up inside those triggers.
Why
Dropdown rendered Compass Button at emphasis="quaternary" and size="medium", then overrode almost everything Button provides: padding, hover, active, focus, colour, and the button__label wrapper. Both class sets sat on the same element at equal specificity. When the Button stylesheet loaded after Dropdown's, a large Dropdown picked up Button's medium padding (var(--spacing-s) var(--spacing-xl), 12px 24px) and the quaternary link-coloured hover and active wash, instead of Dropdown's own padding and the center-channel wash.
Repeating the dropdown class three times already beat Button for --button-fg and the inverted hover, and the same trick would have covered size padding and the default hover. That still leaves Dropdown coupled to Button's DOM and to whichever Button styles land next. Rendering the trigger as its own button removes the tie.
Screenshots / demo video (required)
N/A for a new visual treatment. The padding, hover, active, focus, and disabled values are the same rules as before. They now belong to the Dropdown button instead of competing with a Button stylesheet.
Test plan
Dropdown.test.tsx: the root is a button type="button" with Dropdown classes, aria-expanded, aria-haspopup, and no button--* class or button__label wrapper. disabled, isOpen, and leadingIcon still apply.
stylelint and eslint on the changed files
npm test --workspace=@mattermost/compass-ui (635 tests)
Compiled dropdown.guideline.mdx: Anatomy and Inverted labels are strings, not <p> children.
Change Impact: 🟡 Medium
Changes Breakdown:
+11 -27 Production Changes (51%)
+37 -0 Test Changes (49%)
Regression Risk: The Dropdown trigger changes from a Compass Button composition to a native <button>, and the label wrapper and --button-fg overrides are removed. Default markup and cascade change for all consumers, while the new tests check rendering and ARIA state only, so visual regressions and selectors that target Button classes or button__label are not covered.
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
Dropdown now renders its trigger as a native button instead of the shared Button component. Its existing button attributes and contents remain. The stylesheet removes Button-specific colour overrides and the direct-child span display rule.
Changes: Dropdown trigger
Layer / File(s)
Summary
Native trigger rendering and styling packages/compass-ui/src/components/Dropdown/Dropdown.tsx, packages/compass-ui/src/components/Dropdown/Dropdown.module.scss
Dropdown renders a native button with its existing type, disabled state, ARIA attributes, forwarded props, and content. The stylesheet removes Button-specific colour overrides and the direct-child span display rule.
Rendering coverage and supporting text packages/compass-ui/src/components/Dropdown/Dropdown.test.tsx, packages/compass-ui/CHANGELOG.md, src/guidelines/components/dropdown/dropdown.guideline.mdx
Tests check the trigger’s classes, accessible label, listbox attributes, child content, disabled and open states, and leading icon. The changelog records the markup and styling changes. Guideline examples wrap string children in braces.
mattermost/compass-design#155: This PR changes Dropdown label-colour styling and notes a planned follow-up to make Dropdown a standalone button.
mattermost/compass-design#174: This PR changes Dropdown padding and label truncation, and updates a Button label-wrapper selector.
Suggested labels:compass-ui
Merge Risk: Low · up to a44ad
Dropdown now renders its own native button, so the default markup no longer includes Button classes or the label wrapper. Consumers whose selectors depend on the old structure may break until they are updated. The change is small and reversible, so merge risk is low, but the consumer updates should be tracked.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "Render Dropdown as its own button" names the main change. The changeset stops Dropdown from composing Compass Button and renders a native button for the trigger. The title is specific and c…
Description check
The description covers the summary, the reason for the change, the test plan, and the required screenshot section. It marks the screenshot section as N/A and gives a reason, which the template allows …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "Render Dropdown as its own button" names the main change. The changeset stops Dropdown from composing Compass Button and renders a native button for the trigger. The title is specific and concise, and it matches the objectives.
Full details: Description check
Explanation
The description covers the summary, the reason for the change, the test plan, and the required screenshot section. It marks the screenshot section as N/A and gives a reason, which the template allows for non-visual changes. The author also states that the default markup changes and that consumer updates are separate. The Downstream section is omitted, but the template says to delete it when consumers are not affected. Some sections use the Cursor agent wrapper and footer. The description still contains enough detail to review the change.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Essentials
Run ID: 3b9e752b-12fd-477f-aa8b-ad4f0edf7643
Commits
Reviewing files that changed from the base of the PR and between 96b4cde and a44ad47.
Limit details: You’ve used all 2 included reviews currently available. Your 57 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.
Files skipped from review as they are similar to previous changes: 1
packages/compass-ui/CHANGELOG.md
Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.
Dropdown renders a quaternary medium Button, so size padding and the
default hover and active wash tied Button's rules. A later Button
stylesheet then painted Button's padding and the link-coloured wash.
Repeat the dropdown class, the same way --button-fg and inverted hover
already do, so Dropdown wins whichever sheet loads last.
Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>
pathname keeps percent-encoding, so a checkout path with a space would
make the suite fail while compiling the stylesheets.
Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>
Stop composing Compass Button, so padding, hover, active, focus, and
disabled live only on .dropdown. Drop the repeated-class overrides,
--button-fg, and the label-wrapper display:contents rule. The trigger
no longer has Button classes or a button__label span.
Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>
MDX treats a label on its own line as a paragraph, and the docs prose
margin then shows inside the trigger. Expressions stay strings.
Co-authored-by: Matthew Birtch <mattbirtch@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
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
Dropdownno longer composes CompassButton. The trigger is its own<button type="button">, so padding, hover, active, focus, and disabled live only on.dropdownand no longer tie a quaternary medium Button.Public props are unchanged:
size,padding,appearance,isOpen,leadingIcon,disabled, and button attributes includingaria-*. The repeated-class overrides, the--button-fgoverrides, and thedisplay: contentsrule that undid Button's label wrapper are gone.Default markup changes. The trigger no longer has Button's classes or the
button__labelwrapper. Consumer updates are separate; this PR does not touch mattermost-plugin-agents#1231.The Dropdown guideline puts the Anatomy and Inverted labels in expressions (
{'design'}) so MDX does not wrap them in a<p>. A label on its own line was becoming a paragraph, and the docs prose margin showed up inside those triggers.Why
Dropdownrendered CompassButtonatemphasis="quaternary"andsize="medium", then overrode almost everything Button provides: padding, hover, active, focus, colour, and thebutton__labelwrapper. Both class sets sat on the same element at equal specificity. When the Button stylesheet loaded after Dropdown's, a large Dropdown picked up Button's medium padding (var(--spacing-s) var(--spacing-xl), 12px 24px) and the quaternary link-coloured hover and active wash, instead of Dropdown's own padding and the center-channel wash.Repeating the dropdown class three times already beat Button for
--button-fgand the inverted hover, and the same trick would have covered size padding and the default hover. That still leaves Dropdown coupled to Button's DOM and to whichever Button styles land next. Rendering the trigger as its own button removes the tie.Screenshots / demo video (required)
N/A for a new visual treatment. The padding, hover, active, focus, and disabled values are the same rules as before. They now belong to the Dropdown button instead of competing with a Button stylesheet.
Test plan
Dropdown.test.tsx: the root is abutton type="button"with Dropdown classes,aria-expanded,aria-haspopup, and nobutton--*class orbutton__labelwrapper.disabled,isOpen, andleadingIconstill apply.npm test --workspace=@mattermost/compass-ui(635 tests)dropdown.guideline.mdx: Anatomy and Inverted labels are strings, not<p>children.Change Impact: 🟡 Medium
Changes Breakdown:
+11 -27 Production Changes (51%)
+37 -0 Test Changes (49%)
Regression Risk: The Dropdown trigger changes from a Compass
Buttoncomposition to a native<button>, and the label wrapper and--button-fgoverrides are removed. Default markup and cascade change for all consumers, while the new tests check rendering and ARIA state only, so visual regressions and selectors that target Button classes orbutton__labelare not covered.Generated by CodeRabbitAI