Skip to content

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

Merged
owilliams-tetrascience merged 3 commits into
mainfrom
SW-2072-input-group-disabled-scope
Jun 24, 2026
Merged

fix: SW-2072 chat input grey by default — scope input-group disabled greying to the control#143
owilliams-tetrascience merged 3 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 24, 2026 2:36pm

Request Review

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.

Restore scripts/zephyr/__tests__/sync-storybook-zephyr.test.ts to the
main version; this PR should not modify Zephyr tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@owilliams-tetrascience owilliams-tetrascience left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 🚀

@owilliams-tetrascience owilliams-tetrascience merged commit 65e7e73 into main Jun 24, 2026
12 checks passed
@owilliams-tetrascience owilliams-tetrascience deleted the SW-2072-input-group-disabled-scope branch June 24, 2026 18:06
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.

5 participants