Skip to content

refactor(InputWrapper): target truncation by class instead of bare span - #1331

Open
cookieark7 wants to merge 4 commits into
ClickHouse:mainfrom
cookieark7:refactor/span-truncation-selectors
Open

cookieark7 wants to merge 4 commits into
ClickHouse:mainfrom
cookieark7:refactor/span-truncation-selectors

Conversation

@cookieark7

@cookieark7 cookieark7 commented Nov 28, 2026 •

Copy link
Copy Markdown

Description

Follow-up to #1302. The .wrapper span:first-of-type rule in InputWrapper and the .select-trigger span:first-of-type rule in Select matched every first span inside them, including icon wrappers since those became spans.

  • Remove both bare-span rules.
  • Give the date range value spans in DateRangePicker and DateTimeRangePicker a .date-input__value class with the same four declarations, so they keep the same computed styles.

Links and tickets

Closes #1303

Good to know

What I checked in Storybook before changing anything, across the forms-input-*, display-datepicker, display-daterangepicker, display-datetimerangepicker and display-autocomplete stories (up to 4 per family) plus the Select, MultiSelect and CheckboxMultiSelect stories:

  • The only elements these selectors matched were icon wrappers (inert) and the date range value spans.
  • The date range value spans are display: inline inside a block parent, so only white-space: nowrap has an effect on them today. I kept all four declarations on the new class to keep this a pure refactor.
  • After the change the date value spans have identical computed styles, and icon wrappers no longer get overflow: hidden.

One consumer-visible difference for the maintainers to weigh: a span passed as startContent or endContent to a field no longer gets truncation automatically. This is called out in the changeset. If that is not acceptable, a narrower selector on those two slots would keep it.

Checklist

  • Breaking changes? (add migration notes in changesets)
  • Visual changes? (specify in changesets) — none for Click UI components, noted in the changeset
  • Design review needed?

Contribution

  • Sufficient research before PR
  • Self-reviewed the PR
  • Manually tested the changes (when applies - visual confirmation in Storybook)
  • build and build-storybook work locally
  • Tests and Stories are aligned with the changes

Accessibility

CSS only, no markup or behavior change beyond a class name on existing spans. Not tested: manual keyboard pass and screen reader output, because nothing interactive changed.

Visual specs run locally in Docker, all passing with no snapshots regenerated: Select, MultiSelect, CheckboxMultiSelect, inputfield, TextField, PasswordField (4 timeouts on page load that passed on retry), SearchField, NumberField, DatePicker, daterangepicker, datetimerangepicker.

🤖 Generated with Claude Code


Note

Low Risk
CSS-only refactor with unchanged Click UI visuals; only custom startContent/endContent spans may need explicit truncation.

Overview
Removes the broad span:first-of-type ellipsis rules from InputWrapper and Select so icon wrappers and other first span children are no longer forced to truncate.

Date range pickers now apply a dedicated .date-input__value class on their value/placeholder spans, preserving the same truncation behavior for DateRangePicker and DateTimeRangePicker visuals.

For field APIs, a span passed as startContent or endContent will not auto-truncate anymore; consumers should use TextTruncate when ellipsis is needed.

Reviewed by Cursor Bugbot for commit daeb73f. Bugbot is set up for automated code reviews on this repo. Configure here.

The .wrapper and .select-trigger rules matched every first span, including
icon wrappers since they became spans. Remove them and give the date range
value spans their own class so DateRangePicker and DateTimeRangePicker keep
the same computed styles.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 40c8605

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clickhouse/click-ui Patch

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

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@cookieark7
cookieark7 requested a review from XOP November 30, 2026 17:58
@workflow-authentication-public

Copy link
Copy Markdown
Contributor

Chromatic Storybook

Check Status Link
Storybook ✅ 672 stories published Open Storybook
UI Tests ✅ 672 tests unchanged Open build

Built from commit: 40c86058b9a2991bae13597ff861cdc0de3ecf8c · Chromatic run

Statuses as of the end of the run. The build link shows the live review state.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace fragile bare-span truncation selectors in InputWrapper and Select with class-based targeting

2 participants