Repository navigation
Conversation
Co-authored-by: Fábio Neves <fabio.neves@clickhouse.com>
Co-authored-by: Fábio Neves <fabio.neves@clickhouse.com>
Co-authored-by: Fábio Neves <fabio.neves@clickhouse.com>
Co-authored-by: Fábio Neves <fabio.neves@clickhouse.com>
Co-authored-by: Fábio Neves <fabio.neves@clickhouse.com>
Co-authored-by: Fábio Neves <fabio.neves@clickhouse.com>
…g it Co-authored-by: Fábio Neves <fabio.neves@clickhouse.com>
🦋 Changeset detectedLatest commit: ca3b277 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 |
|
|
Collapsed alerts stay capped by maxHeight. Expanded alerts lift that cap, grow to the parent, and scroll the text when it still overflows. Co-authored-by: Fábio Neves <fabio.neves@clickhouse.com>
The expanded alert now fills its container, so the expanded captures are taller and show the text scrollbar. Co-authored-by: Fábio Neves <fabio.neves@clickhouse.com>
Storybook Preview Deployed✅ Preview URL: https://click-2nxh1p2g4-clickhouse.vercel.app Built from commit: |
Chromatic Storybook
Built from commit: Statuses as of the end of the run. The build link shows the live review state. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ca3b277. Configure here.
| min-height: 0; | ||
| max-height: none; | ||
| flex: 1 1 auto; | ||
| } |
There was a problem hiding this comment.
Expanding drops the height cap
High Severity
Expanding applies alert_expanded, which sets max-height to none. If the parent has no definite height, height: 100% and flex: 1 1 auto do nothing, so the alert grows with the text. Overflow then measures as false, the Show less toggle unmounts, and the expanded layout cannot be collapsed.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit ca3b277. Configure here.


Description
Alerttakes four new optional props. Long alert or error text can now be capped, so a long message no longer shifts the layout around it. This follow-up was agreed in #1277.maxHeight?: number | stringcaps the collapsed alert, toggle included. A number is px; a string is any CSS length ('12lh','100%'). When the text overflows, a Show more / Show less toggle appears.onExpandedChange?: (expanded: boolean) => voidfires when the user toggles. It only fires whenmaxHeightis set.expandLabel/collapseLabel(strings) default to'Show more'/'Show less'.WarningAlert,DangerAlert,InfoAlertandSuccessAlertpass the props through.Behaviour:
maxHeight, fades out at the bottom (mask-image, which works on any background), and shows the toggle.keyto reset it.maxHeight, nothing changes. No new class, custom property, observer or DOM.Links and tickets
Good to know
expanded/defaultExpanded, and opening the text in a modal.AlertPropsdoesn't extendHTMLAttributes, and there is noforwardRef.useAlertOverflow, in the Alert folder. It is not exported, anduseIsTruncatedis untouched. Observers are created once per mount and not rebuilt on toggle.--click-container-space-smand--click-container-gap-xxs.-webkit-mask-imagesits besidemask-imageunder a scoped stylelint disable, because the browserslist targets include Chrome below 120 and the build has no autoprefixer.MaxHeightBoundedstory: the alert sits in a 240px column. Collapsed height stays atmaxHeight. Expanded height fills the column and the text scrolls.MaxHeightKeyboardstory: once expanded, the scroll region is one Shift+Tab back from the toggle, because the DOM order is title, text, toggle.eslint-suppressions.jsonis unchanged.Checklist
minor.maxHeightis set. Collapsed snapshots are unchanged. The four expanded snapshots were regenerated because the expanded alert now fills its container.Contribution
buildandbuild-storybookwork locallyAccessibility
<button>(Enter / Space), and focus stays on it after both actions. While expanded and scrollable, the text area is focusable, so arrow keys scroll it. Tabbing onto a link inside clipped text expands the alert. Esc doesn't apply.aria-expandedandaria-controls. When a title exists, the scroll region isrole="region", named by the title.--click-global-color-outline-default. The fade is removed in forced-colors mode. The text toggle is under 24 px tall and relies on the WCAG 2.5.8 spacing exception (it sits alone on its row).WCAG 2.2 criteria checked: 1.4.3 Contrast (the toggle inherits the alert text colour), 2.1.1 Keyboard, 2.4.3 Focus Order, 2.4.7 Focus Visible, 2.5.3 Label in Name, 4.1.2 Name, Role, Value. In the Storybook Accessibility panel, axe shows no new violations on the new stories. The existing colour-contrast findings on info-state alerts also appear on the current
StateInfostory. Not tested with a real screen reader.Screencast
Collapsed, then expanded (the alert fills the container and the text scrolls), then collapsed.
Note
Low Risk
Additive optional API on a display component with no change when maxHeight is omitted; moderate complexity in overflow measurement and a11y but heavily tested.
Reviewed by Cursor Bugbot for commit ca3b277. Bugbot is set up for automated code reviews on this repo. Configure here.