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 2 commits 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 2 commits 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 23, 2026 7:38pm

Request Review

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 94.74% (🎯 83%)
🟰 ±0%
20627 / 21770
🟢 Statements 94.74% (🎯 83%)
🟰 ±0%
20627 / 21770
🟢 Functions 93.58% (🎯 74%)
🟰 ±0%
919 / 982
🟢 Branches 88.74% (🎯 81%)
🟰 ±0%
3768 / 4246
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/ui/input-group.tsx 96.47%
🟰 ±0%
90%
🟰 ±0%
87.5%
🟰 ±0%
96.47%
🟰 ±0%
56-60
Generated in workflow #808 for commit d9694c6 by the Vitest Coverage Report Action

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a styling regression in the InputGroup shadcn primitive where the group container was being greyed-out whenever any disabled descendant existed (e.g., a disabled submit button), even if the actual input control was enabled—impacting the AI chat prompt input.

Changes:

  • Scope InputGroup “disabled” background/opacity styling to only trigger when the input-group-control (input/textarea) itself is disabled.
  • Extend a single Vitest test timeout in the Zephyr Storybook sync test suite (likely to reduce flakiness from ts-morph parsing cost).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/components/ui/input-group.tsx Narrows :has(:disabled)-style selectors to [data-slot=input-group-control]:disabled so disabled addon buttons don’t grey the whole control.
scripts/zephyr/__tests__/sync-storybook-zephyr.test.ts Increases timeout for one duplicate-ID parsing test to 15s.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

4 participants