Skip to content

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

Open
cookieark7 wants to merge 1 commit into
ClickHouse:mainfrom
cookieark7:refactor/span-truncation-selectors
Open

cookieark7 wants to merge 1 commit 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

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: e5379a8

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

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

None yet

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

1 participant