Skip to content

fix: SW-2072 chat input grey by default — scope input-group disabled greying to the control#143

Open
boramyi-ts wants to merge 1 commit into
mainfrom
SW-2072-input-group-disabled-scope
Open

fix: SW-2072 chat input grey by default — scope input-group disabled greying to the control#143
boramyi-ts wants to merge 1 commit into
mainfrom
SW-2072-input-group-disabled-scope

Conversation

@boramyi-ts

@boramyi-ts boramyi-ts commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

SW-2072 — the AI chat element rendered grey by default; it should be white when available and grey only when unavailable.

Root cause

The InputGroup greys itself (has-disabled:bg-input/50 + has-disabled:opacity-50) whenever it contains any disabled descendant. In the chat, the submit button is disabled while the input is empty, so :has(:disabled) matched and the whole field went grey — even though the textarea is enabled and the chat is usable.

Fix

Scope the disabled styling to the control rather than any descendant — input-group.tsx:15:

- has-disabled:bg-input/50  has-disabled:opacity-50  …  dark:has-disabled:bg-input/80
+ has-[[data-slot=input-group-control]:disabled]:bg-input/50  …:opacity-50  …  dark:…:bg-input/80

Now only a disabled input/textarea greys the field. Also fixes the same latent issue for any InputGroup with a disabled addon button (clear/submit/etc.).

Before / after

Before: disabled submit greys the available chat · After (available): white · After (unavailable, control disabled): still grey, as intended.

SW-2072 before/after

📄 Interactive: sw-2072-chat-grey-before-after.html · download raw

Verification

  • Empty chat (submit disabled, control enabled) → field is now transparent/white (was bg-input/50).
  • Standalone test of the compiled rule with a disabled [data-slot=input-group-control]bg-input/50 (grey) — the unavailable state still works.
  • yarn lint + yarn typecheck pass.

🤖 Generated with Claude Code

…t is disabled

The InputGroup greyed itself (bg-input/50 + opacity-50) whenever it
contained ANY disabled descendant via has-disabled. In the AI chat the
submit button is disabled while the input is empty, so the whole field
went grey even though it was available to type in.

Scope the disabled styling to the control itself
(has-[[data-slot=input-group-control]:disabled]) so only a disabled
input/textarea greys the field — white when available, grey when the
control is genuinely unavailable. Also fixes the same issue for any
InputGroup with a disabled addon button.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@boramyi-ts boramyi-ts requested review from a team as code owners June 18, 2026 18:52
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
ts-lib-ui-kit-storybook Ready Ready Preview, Comment Jun 20, 2026 5:56pm

Request Review

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