Skip to content

fix: don't render an empty selected-count badge in combobox - #3853

Open
GiantRobots wants to merge 2 commits into
mainfrom
alexthomsen/ui-130-fix-the-weird-dot-next-to-select-a-namespace-in-the-d12d
Open

fix: don't render an empty selected-count badge in combobox#3853
GiantRobots wants to merge 2 commits into
mainfrom
alexthomsen/ui-130-fix-the-weird-dot-next-to-select-a-namespace-in-the-d12d

Conversation

@GiantRobots

@GiantRobots GiantRobots commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Description & motivation 💭

In multiselect mode with displayChips off, the combobox always rendered a Badge for the selected count:

<Badge>{numberOfItemsSelectedLabel(value.length)}</Badge>

If a consumer supplies a numberOfItemsSelectedLabel that returns an empty string — reasonable when the count is already shown elsewhere on the page — the badge has no content. Badge is a div with p-1, rounded-sm and a light bg-slate-100 fill, so with nothing inside it collapses to roughly an 8×8 light square. That is the stray dot reported between the leading search icon and the "Select a namespace" placeholder.

This skips the badge when the label is empty. The default label is never empty, so existing consumers see no change.

Screenshots (if applicable) 📸

None — no browser was available in this environment. The artifact was confirmed from the rendered DOM instead.

Design Considerations 🎨

The guard lives in the shared Holocene component rather than at the call site, so any screen that opts out of the in-field count is protected.

Testing 🧪

How was this tested 👻

  • Manual testing
  • Unit tests added
  • E2E tests added

Two stories added under Combobox:

  • Multiselect Without Count Label — blank label with a selection; asserts no badge element is rendered. This is the regression case.
  • Multiselect With Count Label — same setup with the default label; asserts "1 option selected" still shows.

Verified locally by mounting the combobox and inspecting the DOM in those states. Before the fix the blank-label case emits <div class="… rounded-sm p-1 … bg-slate-100"></div> — the artifact; after, that element is gone.

Storybook builds and both stories register in the index. I could not execute the play functions here: pnpm stories:test needs a chromium binary and the Playwright CDN is unreachable from this environment, so the assertions are unverified by a real run — worth a glance when CI picks them up.

pnpm lint and pnpm check are clean; the existing unit suite passes unchanged (232 files, 3026 tests).

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

pnpm stories:dev

Open Combobox → Multiselect Without Count Label. There should be no small light square between the search icon and the placeholder. Checking out main and reloading shows the dot.

Checklists

Draft Checklist

  • Confirm the Cloud UI namespace picker is in fact passing an empty numberOfItemsSelectedLabel. The Cloud UI repo wasn't reachable from this environment, so that last link is unverified — the empty Badge is the only element in this component that renders as a small featureless light box in that position (an empty Chip is ruled out, since it always draws a close X).

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview Aug 21, 2026 8:52pm

Request Review

In multiselect mode with displayChips off, the combobox always rendered a
Badge for the selected count. When a consumer supplies a
numberOfItemsSelectedLabel that returns an empty string, the badge has no
content and collapses to a small light square, which shows up as a stray
dot between the leading icon and the placeholder.

Skip the badge when the label is empty. The default label is never empty,
so existing consumers are unaffected.

Generated with [Linear](https://linear.app/temporal/issue/UI-130/fix-the-weird-dot-next-to-select-a-namespace-in-the-async-combo-picker#agent-session-e4e193e9)

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
@GiantRobots
GiantRobots force-pushed the alexthomsen/ui-130-fix-the-weird-dot-next-to-select-a-namespace-in-the-d12d branch from b9d6322 to 8827f1c Compare August 20, 2026 21:00
Two stories for the multiselect count badge: one with a blank
numberOfItemsSelectedLabel asserting no empty badge is rendered, and one
with the default label asserting the count still shows.

Generated with [Linear](https://linear.app/temporal/issue/UI-130/fix-the-weird-dot-next-to-select-a-namespace-in-the-async-combo-picker#agent-session-e4e193e9)

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
@GiantRobots
GiantRobots marked this pull request as ready for review August 21, 2026 21:11
@GiantRobots
GiantRobots requested a review from a team as a code owner August 21, 2026 21:11
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.

1 participant