Skip to content

feat(ui): add loading/disabled state to TokenField component - #221

Open
mdiniz97 wants to merge 1 commit into
trycompai:mainfrom
mdiniz97:fix-token-field-loading
Open

mdiniz97 wants to merge 1 commit into
trycompai:mainfrom
mdiniz97:fix-token-field-loading

Conversation

@mdiniz97

@mdiniz97 mdiniz97 commented Sep 14, 2026

Copy link
Copy Markdown

Added disabled prop and ARIA attributes to TokenField, TokenFieldItem, and TokenFieldAction components:

  • TokenField: disabled prop, aria-disabled, aria-busy attributes
  • TokenFieldItem: aria-disabled attribute
  • TokenFieldAction: disabled prop passed to Button

Improves UX by allowing disabled states and enhances accessibility for screen readers.

Fixes #220


Summary by cubic

Adds disabled and loading states to the TokenField component so forms can indicate when token editing is unavailable or pending.

TokenField now accepts a disabled prop and forwards aria-disabled and aria-busy to the root element. TokenFieldItem and TokenFieldAction also support the disabled state, giving users and screen readers clear feedback. Fixes #220.

Written for commit 0deb4da. Summary will update on new commits.

Review in cubic

Added disabled prop and ARIA attributes to TokenField, TokenFieldItem, and TokenFieldAction components:
- TokenField: disabled prop, aria-disabled, aria-busy attributes
- TokenFieldItem: aria-disabled attribute
- TokenFieldAction: disabled prop passed to Button

Improves UX by allowing disabled states and enhances accessibility for screen readers.

Fixes trycompai#220
@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown

@mdiniz97 is attempting to deploy a commit to the Comp AI - PoC Team on Vercel.

A member of the Team first needs to authorize it.

@cubic-dev-ai cubic-dev-ai Bot 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.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/ui/src/components/token-field.tsx">

<violation number="1" location="packages/ui/src/components/token-field.tsx:20">
P2: When a consumer uses the new `TokenField disabled` prop, the field remains interactive because `aria-disabled` does not disable editing or descendant buttons. Propagate the disabled state to editable descendants and actions, or provide a shared state mechanism that those children consume.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

<div
data-slot="token-field"
role="group"
aria-disabled={ariaDisabled ?? disabled}

@cubic-dev-ai cubic-dev-ai Bot Sep 14, 2026

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.

P2: When a consumer uses the new TokenField disabled prop, the field remains interactive because aria-disabled does not disable editing or descendant buttons. Propagate the disabled state to editable descendants and actions, or provide a shared state mechanism that those children consume.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/ui/src/components/token-field.tsx, line 20:

<comment>When a consumer uses the new `TokenField disabled` prop, the field remains interactive because `aria-disabled` does not disable editing or descendant buttons. Propagate the disabled state to editable descendants and actions, or provide a shared state mechanism that those children consume.</comment>

<file context>
@@ -2,13 +2,25 @@ import { Button } from "@crm/ui/components/button";
 		<div
 			data-slot="token-field"
 			role="group"
+			aria-disabled={ariaDisabled ?? disabled}
+			aria-busy={ariaBusy}
 			className={cn(
</file context>
Fix with cubic

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