From 287d123ad97f79152e85048626406061114c11a0 Mon Sep 17 00:00:00 2001 From: Raman Yasel Date: Tue, 1 Dec 2026 19:18:03 +0300 Subject: [PATCH 1/2] Give every field a solid focus ring and clearer invalid, hover and read-only states Keyboard focus on Input, Textarea, a Select's trigger, InputGroup, the combobox's fields and a Bot form's native select is a solid ring in `ring`, drawn outside the field, as on buttons. The half-strength ring was under 3:1, and an invalid field's halo hid it. An invalid field has a destructive edge on a destructive/10 fill, a field's edge darkens under the pointer, and a read-only field is filled with muted. The combobox's chips field and the sidebar's searches take the field's corner. Menus are unchanged. The rules say so in docs/design-system.md and docs/app-guidelines.md; ui-primitives-look and contrast tests hold the ring and the new fills. Co-Authored-By: Claude Opus 5.5 --- app/src/components/app-sidebar/bots-panel.tsx | 2 +- .../app-sidebar/conversations-panel.tsx | 2 +- app/src/components/gallery/form.tsx | 2 +- app/src/components/ui/combobox.tsx | 2 +- app/src/components/ui/input-group.tsx | 6 +-- app/src/components/ui/input.tsx | 2 +- app/src/components/ui/select.tsx | 2 +- app/src/components/ui/textarea.tsx | 2 +- app/tests/ui-primitives-look.test.ts | 43 +++++++++++++++++++ docs/app-guidelines.md | 4 +- docs/design-system.md | 17 ++++++-- tokens/tests/contrast.test.ts | 32 +++++++++++--- 12 files changed, 96 insertions(+), 20 deletions(-) diff --git a/app/src/components/app-sidebar/bots-panel.tsx b/app/src/components/app-sidebar/bots-panel.tsx index 30460283aa..da8173eadb 100644 --- a/app/src/components/app-sidebar/bots-panel.tsx +++ b/app/src/components/app-sidebar/bots-panel.tsx @@ -348,7 +348,7 @@ export function BotsPanel({ hidden = false }: { hidden?: boolean }) { title="Bots" > - + setSearch(event.target.value)} diff --git a/app/src/components/app-sidebar/conversations-panel.tsx b/app/src/components/app-sidebar/conversations-panel.tsx index b8a9cce622..79a773d80a 100644 --- a/app/src/components/app-sidebar/conversations-panel.tsx +++ b/app/src/components/app-sidebar/conversations-panel.tsx @@ -422,7 +422,7 @@ export function ConversationsPanel({ hidden = false }: { hidden?: boolean }) { /> - + change(event.target.value)} > diff --git a/app/src/components/ui/combobox.tsx b/app/src/components/ui/combobox.tsx index ccc5fedc17..0a2c33859d 100644 --- a/app/src/components/ui/combobox.tsx +++ b/app/src/components/ui/combobox.tsx @@ -233,7 +233,7 @@ function ComboboxChips({ ) { data-slot="input-group" role="group" className={cn( - "group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input bg-card transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", + "group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input bg-card transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 hover:border-foreground/30 has-[[data-slot=input-group-control]:read-only:enabled]:bg-muted has-disabled:border-input has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:bg-destructive/10 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className, )} {...props} @@ -120,7 +120,7 @@ function InputGroupInput({ ) { type={type} data-slot="input" className={cn( - "h-9 w-full min-w-0 rounded-md border border-input bg-card px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm", + "h-9 w-full min-w-0 rounded-md border border-input bg-card px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground read-only:bg-muted hover:border-foreground/30 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:bg-destructive/10 md:text-sm", className, )} {...props} diff --git a/app/src/components/ui/select.tsx b/app/src/components/ui/select.tsx index 597cb5bf8d..61f16effbd 100644 --- a/app/src/components/ui/select.tsx +++ b/app/src/components/ui/select.tsx @@ -43,7 +43,7 @@ function SelectTrigger({ data-slot="select-trigger" data-size={size} className={cn( - "flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-card py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-7 data-[size=sm]:rounded-md *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", + "flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-card py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none hover:border-foreground/30 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring disabled:cursor-not-allowed disabled:border-input disabled:opacity-50 aria-invalid:border-destructive aria-invalid:bg-destructive/10 data-placeholder:text-muted-foreground data-readonly:bg-muted data-[size=default]:h-9 data-[size=sm]:h-7 data-[size=sm]:rounded-md *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className, )} {...props} diff --git a/app/src/components/ui/textarea.tsx b/app/src/components/ui/textarea.tsx index 790aa8d51a..70dfa1c93b 100644 --- a/app/src/components/ui/textarea.tsx +++ b/app/src/components/ui/textarea.tsx @@ -7,7 +7,7 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {