Skip to content

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

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

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

@ripgrim ripgrim 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.

Review result: rewrite from current main.

  • aria-disabled does not disable content editing.
  • Parent state does not disable descendant actions.
  • The branch removes the current placeholder focus fix.
  • The change adds no loading indicator.
  • The change adds no behavioral tests.

Use shared compound-component state for disabled and loading behavior.

@ripgrim ripgrim 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.

Superseded by the corrected review above.

@ripgrim

ripgrim commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

This branch is stale and conflicts with the current TokenField placeholder fix. The state API needs a current-main compound-component rewrite.

@ripgrim ripgrim closed this Oct 22, 2026
snayyar00 added a commit to snayyar00/crm that referenced this pull request Nov 3, 2026
Takes upstream as the base for every file the fork only carried as an
early copy of an upstream PR (trycompai#142, trycompai#194, trycompai#212, trycompai#213, trycompai#216, trycompai#219, trycompai#221),
then re-applies the fork's own changes on top:

- obligations: completing a RECHECK_DUE task spawns the next re-check
  inside the same transaction (new spec covers spawn, re-open, deliverable)
- deals: winning a deal asks for the engagement type
- auth: forced Google consent kept; hd hint withheld when several sign-in
  domains are allowed (spec added); primaryWorkspaceDomain back to upstream
- nav: Calendar and Crons & Syncs re-homed into the Neo workspace nav
- brand: WebAbility strings re-applied to upstream copies
- agent: document agent ported to eve 0.69 (sandbox + dynamic model)
- docker: bun 1.4.0 to match the pinned packageManager and new lockfile

Removes leftover take files the upstream versions replaced (csv-parse,
task-window, viewer-day, task-edit.spec).

check-types 15/15, lint 11/11, lint:slop clean, app build ok,
tests: api 447, agent 416, app 260, auth 69, db 115, telemetry 61,
mcp 12, env 17, validation 8 (0 fail, 0 skip).
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.

2 participants