Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🎯 a11y: Move Field and Focus Call Sites Onto the Control Roles (#16929)

Marco Berettab7da0e0f760f
diff --git a/client/src/components/Bookmarks/BookmarkForm.tsx b/client/src/components/Bookmarks/BookmarkForm.tsx
index 38384df4b6..2ccb062a8a 100644
--- a/client/src/components/Bookmarks/BookmarkForm.tsx
+++ b/client/src/components/Bookmarks/BookmarkForm.tsx
@@ -7,7 +7,7 @@ import type { TConversationTag, TConversationTagRequest } from 'librechat-data-p
import { useBookmarkContext } from '~/Providers/BookmarkContext';
import { useConversationTagMutation } from '~/data-provider';
import { useLocalize } from '~/hooks';
-import { cn, logger } from '~/utils';
+import { logger } from '~/utils';
type TBookmarkFormProps = {
tags?: string[];
@@ -138,12 +138,8 @@ const BookmarkForm = ({
id="bookmark-description"
disabled={false}
placeholder={localize('com_ui_enter_description')}
- className={cn(
- 'border-border-light min-h-[6.25rem] w-full resize-none rounded-lg border',
- 'text-text-primary bg-transparent px-3 py-2 text-sm',
- 'placeholder:text-text-tertiary',
- 'focus-visible:ring-border-heavy focus-visible:ring-1',
- )}
+ variant="field"
+ className="min-h-[6.25rem] resize-none"
aria-labelledby="bookmark-description-label"
aria-invalid={!!errors.description}
aria-describedby="bookmark-description-error"
diff --git a/client/src/components/Chat/Input/MCPConfigDialog.tsx b/client/src/components/Chat/Input/MCPConfigDialog.tsx
index 99c2a4f968..996293d964 100644
--- a/client/src/components/Chat/Input/MCPConfigDialog.tsx
+++ b/client/src/components/Chat/Input/MCPConfigDialog.tsx
@@ -87,7 +87,7 @@ export default function MCPConfigDialog({
render={({ field }) => {
const placeholder = localize('com_ui_mcp_enter_var', { 0: details.title });
const className =
- 'w-full rounded-md border-border-medium focus:border-border-heavy focus:ring-ring-primary sm:text-sm';
+ 'w-full rounded-md focus:border-border-heavy focus:ring-ring-primary sm:text-sm';
if (details.sensitive === false) {
return (
<Input
diff --git a/client/src/components/Chat/Menus/Presets/EditPresetDialog.tsx b/client/src/components/Chat/Menus/Presets/EditPresetDialog.tsx
index c610b9542b..8dd5d1cf8c 100644
--- a/client/src/components/Chat/Menus/Presets/EditPresetDialog.tsx
+++ b/client/src/components/Chat/Menus/Presets/EditPresetDialog.tsx
@@ -163,7 +163,7 @@ const EditPresetDialog = ({
value={(title as string | undefined) ?? ''}
onChange={onTitleChange}
placeholder={localize('com_endpoint_set_custom_name')}
- className="rounded-theme-control border-border-medium h-9 w-full"
+ className="rounded-theme-control h-9 w-full"
/>
</div>
<div className="flex w-full flex-col">
diff --git a/client/src/components/Chat/Messages/Content/ToolOutput/OutputRenderer.tsx b/client/src/components/Chat/Messages/Content/ToolOutput/OutputRenderer.tsx
index d7aaab4adf..bb2d2ffd9f 100644
--- a/client/src/components/Chat/Messages/Content/ToolOutput/OutputRenderer.tsx
+++ b/client/src/components/Chat/Messages/Content/ToolOutput/OutputRenderer.tsx
@@ -220,7 +220,7 @@ export default function OutputRenderer({
<Button
variant="link"
size="bare"
- className="text-text-secondary focus-visible:ring-border-heavy mt-1 block text-xs underline"
+ className="text-text-secondary mt-1 block text-xs underline"
onClick={() => setShowErrorDetails((prev) => !prev)}
>
{localize('com_ui_details')}
diff --git a/client/src/components/Chat/Messages/Feedback.tsx b/client/src/components/Chat/Messages/Feedback.tsx
index c2f3f8cb73..4543dda6f8 100644
--- a/client/src/components/Chat/Messages/Feedback.tsx
+++ b/client/src/components/Chat/Messages/Feedback.tsx
@@ -318,7 +318,7 @@ function Feedback({ isLast = false, handleFeedback, feedback: initialFeedback }:
{localize('com_ui_feedback_more_information')}
</OGDialogTitle>
<Textarea
- className="border-border-light h-auto w-full rounded-xl p-2"
+ className="h-auto w-full rounded-xl p-2"
value={feedback?.text || ''}
onChange={handleTextChange}
rows={4}
diff --git a/client/src/components/Endpoints/SaveAsPresetDialog.tsx b/client/src/components/Endpoints/SaveAsPresetDialog.tsx
index 9cb9467c9c..e43e142cb3 100644
--- a/client/src/components/Endpoints/SaveAsPresetDialog.tsx
+++ b/client/src/components/Endpoints/SaveAsPresetDialog.tsx
@@ -77,7 +77,7 @@ const SaveAsPresetDialog = ({ open, onOpenChange, preset }: TEditPresetProps) =>
value={title || ''}
onChange={(e) => setTitle(e.target.value || '')}
placeholder={localize('com_endpoint_preset_custom_name_placeholder')}
- className="rounded-theme-control border-border-medium flex h-10 max-h-10 w-full resize-none"
+ className="rounded-theme-control flex h-10 max-h-10 w-full resize-none"
/>
</div>
</form>
diff --git a/client/src/components/MCP/CustomUserVarsSection.tsx b/client/src/components/MCP/CustomUserVarsSection.tsx
index 02f67304f7..f2036c4aac 100644
--- a/client/src/components/MCP/CustomUserVarsSection.tsx
+++ b/client/src/components/MCP/CustomUserVarsSection.tsx
@@ -77,7 +77,7 @@ function AuthField({ name, config, hasValue, control, errors, autoFocus }: AuthF
const placeholder = hasValue
? localize('com_ui_mcp_update_var', { 0: config.title })
: localize('com_ui_mcp_enter_var', { 0: config.title });
- const className = 'w-full rounded border border-border-medium px-2 py-1 sm:text-sm';
+ const className = 'w-full rounded px-2 py-1 sm:text-sm';
// Prevent autofill: browser DOM mutations bypass React's synthetic
// onChange, silently emptying react-hook-form state on submit.
const sharedProps = {
diff --git a/client/src/components/Messages/Content/Mermaid/MermaidDialog.tsx b/client/src/components/Messages/Content/Mermaid/MermaidDialog.tsx
index 4218d0fa82..14007398b2 100644
--- a/client/src/components/Messages/Content/Mermaid/MermaidDialog.tsx
+++ b/client/src/components/Messages/Content/Mermaid/MermaidDialog.tsx
@@ -100,7 +100,7 @@ const MermaidDialog: React.FC<MermaidDialogProps> = memo(
variant="quiet"
size="sm"
aria-label={showCode ? localize('com_ui_hide_code') : localize('com_ui_show_code')}
- className="focus-visible:ring-border-heavy size-8 min-w-0 gap-1 rounded-sm p-0 text-xs focus-visible:ring-offset-0 sm:h-auto sm:w-auto sm:min-w-[6rem] sm:px-1 sm:py-0"
+ className="size-8 min-w-0 gap-1 rounded-sm p-0 text-xs focus-visible:ring-offset-0 sm:h-auto sm:w-auto sm:min-w-[6rem] sm:px-1 sm:py-0"
onClick={handleToggleCode}
>
<MorphIcon icon={showCode ? ChevronUp : ChevronDown} className="h-4 w-4" />
@@ -113,16 +113,13 @@ const MermaidDialog: React.FC<MermaidDialogProps> = memo(
variant="quiet"
size="sm"
aria-label={localize('com_ui_copy_code')}
- className="focus-visible:ring-border-heavy size-8 min-w-0 gap-1 rounded-sm p-0 text-xs focus-visible:ring-offset-0 sm:h-auto sm:w-auto sm:px-1 sm:py-0"
+ className="size-8 min-w-0 gap-1 rounded-sm p-0 text-xs focus-visible:ring-offset-0 sm:h-auto sm:w-auto sm:px-1 sm:py-0"
onClick={handleCopy}
>
<MorphIcon icon={isCopied ? Check : Copy} size="1.125rem" />
<span className="hidden sm:inline">{localize('com_ui_copy_code')}</span>
</Button>
- <OGDialogClose
- focusOutline="hidden"
- className="text-text-secondary hover:bg-surface-hover hover:text-text-primary focus-visible:ring-border-heavy rounded-sm p-1 focus-visible:ring-2"
- >
+ <OGDialogClose className="text-text-secondary hover:bg-surface-hover hover:text-text-primary rounded-sm p-1">
<X className="h-4 w-4" />
<span className="sr-only">{localize('com_ui_close')}</span>
</OGDialogClose>
diff --git a/client/src/components/Prompts/forms/CreatePromptForm.tsx b/client/src/components/Prompts/forms/CreatePromptForm.tsx
index 954244868c..4d9997bdb5 100644
--- a/client/src/components/Prompts/forms/CreatePromptForm.tsx
+++ b/client/src/components/Prompts/forms/CreatePromptForm.tsx
@@ -141,7 +141,7 @@ const CreatePromptForm = ({
{...field}
id="prompt-name"
type="text"
- className="peer border-border-medium text-text-primary mr-2 w-full p-2 text-2xl"
+ className="peer text-text-primary mr-2 w-full p-2 text-2xl"
placeholder=" "
tabIndex={0}
aria-label={localize('com_ui_prompt_name')}
diff --git a/client/src/components/SidePanel/Agents/ActionsInput.tsx b/client/src/components/SidePanel/Agents/ActionsInput.tsx
index d43177bb42..67abc26583 100644
--- a/client/src/components/SidePanel/Agents/ActionsInput.tsx
+++ b/client/src/components/SidePanel/Agents/ActionsInput.tsx
@@ -267,7 +267,7 @@ export default function ActionsInput({
onChange={handleInputChange}
spellCheck="false"
placeholder={localize('com_ui_enter_openapi_schema')}
- className="border-border-light focus-visible:border-border-heavy block min-h-[12rem] w-full resize-y p-3 font-mono text-xs leading-relaxed transition-colors focus-visible:ring-0"
+ className="focus-visible:border-border-heavy block min-h-[12rem] w-full resize-y p-3 font-mono text-xs leading-relaxed transition-colors focus-visible:ring-0"
/>
{validationError && (
<div className="text-text-destructive mt-1.5 text-xs">
@@ -313,7 +313,7 @@ export default function ActionsInput({
{localize('com_ui_enter_openapi_schema')}
</OGDialogDescription>
</OGDialogHeader>
- <div className="border-border-medium bg-surface-secondary focus-within:border-border-heavy flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border">
+ <div className="border-border-control bg-surface-secondary focus-within:border-border-heavy flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border">
<Textarea
variant="transparent"
value={inputValue}
diff --git a/client/src/components/SidePanel/Agents/Advanced/AgentList.tsx b/client/src/components/SidePanel/Agents/Advanced/AgentList.tsx
index 5ab2810c87..c462f334a6 100644
--- a/client/src/components/SidePanel/Agents/Advanced/AgentList.tsx
+++ b/client/src/components/SidePanel/Agents/Advanced/AgentList.tsx
@@ -126,7 +126,7 @@ export function AgentSelectInline({
items={options}
displayValue={displayValue}
SelectIcon={icon}
- className="border-border-light h-9 flex-1"
+ className="h-9 flex-1"
containerClassName="px-0"
/>
);
diff --git a/client/src/components/SidePanel/Memories/MemoryCreateDialog.tsx b/client/src/components/SidePanel/Memories/MemoryCreateDialog.tsx
index 575d9c2a21..7e24f46fb7 100644
--- a/client/src/components/SidePanel/Memories/MemoryCreateDialog.tsx
+++ b/client/src/components/SidePanel/Memories/MemoryCreateDialog.tsx
@@ -146,7 +146,7 @@ export default function MemoryCreateDialog({
onBlur={() => setTouched((prev) => ({ ...prev, value: true }))}
onKeyDown={handleKeyPress}
placeholder={localize('com_ui_enter_value')}
- className="border-border-light text-text-primary focus-visible:ring-border-heavy max-h-[45vh] min-h-[11.25rem] w-full resize-y py-2 focus-visible:ring-1"
+ className="text-text-primary max-h-[45vh] min-h-[11.25rem] w-full resize-y py-2"
rows={8}
aria-invalid={showValueError && valueError != null}
aria-describedby="memory-value-message"
diff --git a/client/src/components/SidePanel/Memories/MemoryEditDialog.tsx b/client/src/components/SidePanel/Memories/MemoryEditDialog.tsx
index 7ee155d69c..c19660fa6a 100644
--- a/client/src/components/SidePanel/Memories/MemoryEditDialog.tsx
+++ b/client/src/components/SidePanel/Memories/MemoryEditDialog.tsx
@@ -219,7 +219,7 @@ export default function MemoryEditDialog({
onBlur={() => setTouched((prev) => ({ ...prev, value: true }))}
onKeyDown={handleKeyPress}
placeholder={localize('com_ui_enter_value')}
- className="border-border-light text-text-primary focus-visible:ring-border-heavy max-h-[45vh] min-h-[11.25rem] w-full resize-y py-2 focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50"
+ className="text-text-primary max-h-[45vh] min-h-[11.25rem] w-full resize-y py-2 disabled:cursor-not-allowed disabled:opacity-50"
rows={8}
disabled={!hasUpdateAccess}
aria-invalid={showValueError && valueError != null}
diff --git a/client/src/components/SidePanel/Parameters/DynamicInput.tsx b/client/src/components/SidePanel/Parameters/DynamicInput.tsx
index 88f4745f52..ef26b04acf 100644
--- a/client/src/components/SidePanel/Parameters/DynamicInput.tsx
+++ b/client/src/components/SidePanel/Parameters/DynamicInput.tsx
@@ -197,7 +197,7 @@ function DynamicInput({
onBlur={handleInputBlur}
placeholder={placeholderText}
className={cn(
- 'border-border-light bg-surface-secondary flex h-9 max-h-9 w-full resize-none rounded-lg border px-3 py-2',
+ 'bg-surface-secondary flex h-9 max-h-9 w-full resize-none rounded-lg px-3 py-2',
)}
/>
</HoverCardTrigger>
diff --git a/client/src/components/Skills/dialogs/CreateSkillDialog.tsx b/client/src/components/Skills/dialogs/CreateSkillDialog.tsx
index b46176763c..7a0601d82f 100644
--- a/client/src/components/Skills/dialogs/CreateSkillDialog.tsx
+++ b/client/src/components/Skills/dialogs/CreateSkillDialog.tsx
@@ -178,7 +178,7 @@ export default function CreateSkillDialog({
placeholder={localize('com_ui_skill_name_placeholder')}
aria-invalid={errors.name ? 'true' : 'false'}
autoComplete="off"
- className="border-border-medium text-text-primary focus-visible:ring-ring-primary flex h-10 w-full rounded-xl"
+ className="text-text-primary focus-visible:ring-ring-primary flex h-10 w-full rounded-xl"
{...register('name', {
required: localize('com_ui_skill_name_required'),
pattern: {
diff --git a/client/src/components/Skills/forms/CreateSkillForm.tsx b/client/src/components/Skills/forms/CreateSkillForm.tsx
index b90a258eff..d549514adf 100644
--- a/client/src/components/Skills/forms/CreateSkillForm.tsx
+++ b/client/src/components/Skills/forms/CreateSkillForm.tsx
@@ -169,7 +169,7 @@ export default function CreateSkillForm({
{...field}
id="skill-name"
type="text"
- className="peer border-border-medium text-text-primary mr-2 w-full p-2 text-2xl"
+ className="peer text-text-primary mr-2 w-full p-2 text-2xl"
placeholder=" "
tabIndex={0}
aria-label={localize('com_ui_name')}
diff --git a/client/src/components/Skills/forms/SkillForm.tsx b/client/src/components/Skills/forms/SkillForm.tsx
index 0eb538178c..becbe41c09 100644
--- a/client/src/components/Skills/forms/SkillForm.tsx
+++ b/client/src/components/Skills/forms/SkillForm.tsx
@@ -196,7 +196,7 @@ export default function SkillForm({ skillId }: SkillFormProps) {
id="skill-name"
type="text"
readOnly={readOnly}
- className="peer border-border-medium text-text-primary mr-2 w-full p-2 text-2xl"
+ className="peer text-text-primary mr-2 w-full p-2 text-2xl"
placeholder=" "
tabIndex={0}
aria-label={localize('com_ui_name')}
diff --git a/client/src/components/Tools/AssistantToolsDialog.tsx b/client/src/components/Tools/AssistantToolsDialog.tsx
index 7c84eabdef..492da7b275 100644
--- a/client/src/components/Tools/AssistantToolsDialog.tsx
+++ b/client/src/components/Tools/AssistantToolsDialog.tsx
@@ -199,7 +199,7 @@ function AssistantToolsDialog({
onChange={handleSearch}
placeholder={localize('com_nav_tool_search')}
aria-label={localize('com_nav_tool_search')}
- className="border-border-medium max-w-64 min-w-0 flex-1 rounded border px-2 py-1"
+ className="max-w-64 min-w-0 flex-1 rounded px-2 py-1"
/>
</div>
<div
diff --git a/client/src/utils/index.ts b/client/src/utils/index.ts
index 4b7c29ed72..f49e2a70c2 100644
--- a/client/src/utils/index.ts
+++ b/client/src/utils/index.ts
@@ -105,7 +105,7 @@ export const cardStyle =
'transition-colors rounded-md min-w-[4.6875rem] border border-border-medium font-normal bg-surface-secondary hover:bg-surface-hover text-text-primary focus:outline-hidden data-[state=open]:bg-surface-hover';
export const defaultTextProps =
- 'rounded-md border border-border-light focus:border-border-heavy focus:bg-surface-secondary bg-transparent text-sm text-text-primary shadow-[0_0_0.625rem_rgba(0,0,0,0.05)] outline-hidden focus-within:placeholder:text-text-primary focus:placeholder:text-text-primary placeholder:text-text-secondary focus:outline-hidden focus:ring-text-primary/20 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50';
+ 'rounded-md border border-border-control focus:border-border-heavy focus:bg-surface-secondary bg-transparent text-sm text-text-primary shadow-[0_0_0.625rem_rgba(0,0,0,0.05)] outline-hidden focus-within:placeholder:text-text-primary focus:placeholder:text-text-primary placeholder:text-text-secondary focus:outline-hidden focus:ring-text-primary/20 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50';
export const optionText =
'p-0 shadow-none text-right pr-1 h-8 border-transparent hover:bg-surface-hover transition-colors';
diff --git a/e2e/specs/mock/scenarios/control-border.spec.ts b/e2e/specs/mock/scenarios/control-border.spec.ts
index 52a83bbfec..df5ddcc62d 100644
--- a/e2e/specs/mock/scenarios/control-border.spec.ts
+++ b/e2e/specs/mock/scenarios/control-border.spec.ts
@@ -2,6 +2,7 @@ import { expect, test } from '@playwright/test';
import type { Page } from '@playwright/test';
import { clickHouseTheme } from '../../../../packages/client/src/theme/themes/clickhouse';
import { darkTheme } from '../../../../packages/client/src/theme/themes/dark';
+import { MOCK_ENDPOINTS, NEW_CHAT_PATH, selectMockEndpoint, sendMessage } from '../helpers';
import { openAgentBuilder } from '../agents.helpers';
import { themeValue } from './style.helpers';
@@ -235,4 +236,96 @@ test.describe('form control outline', () => {
expect(await themeValue(page, '--border-control')).toBe('70 90 110');
expect((await outlineAgainstSurface(page)).border).toBe('rgb(70, 90, 110)');
});
+
+ /** Each tag is written out whole: the runner finds a scenario by its literal tag. */
+ const BOOKMARK: Array<{ title: string; appearance: Appearance; definition?: unknown }> = [
+ {
+ appearance: 'light',
+ title:
+ 'a bookmark description takes the control outline and ring in stock light @scenario:bookmark-field-takes-control-roles-light',
+ },
+ {
+ appearance: 'dark',
+ title:
+ 'a bookmark description takes the control outline and ring in stock dark @scenario:bookmark-field-takes-control-roles-dark',
+ },
+ {
+ appearance: 'light',
+ definition: clickHouseTheme,
+ title:
+ 'a bookmark description takes the control outline and ring in ClickHouse light @scenario:bookmark-field-takes-control-roles-clickhouse-light',
+ },
+ {
+ appearance: 'dark',
+ definition: clickHouseTheme,
+ title:
+ 'a bookmark description takes the control outline and ring in ClickHouse dark @scenario:bookmark-field-takes-control-roles-clickhouse-dark',
+ },
+ ];
+
+ for (const { title, appearance, definition } of BOOKMARK) {
+ test(title, async ({ page }) => {
+ await installAppearance(page, appearance, definition);
+ await page.goto(NEW_CHAT_PATH, { timeout: 10000 });
+ await selectMockEndpoint(page, MOCK_ENDPOINTS[0]);
+ expect((await sendMessage(page, 'hello bookmark field')).ok()).toBeTruthy();
+ await expect(page).toHaveURL(/\/c\/(?!new)/, { timeout: 15000 });
+ const menu = page.locator('#bookmark-menu-button');
+ await expect(menu).toBeVisible({ timeout: 15000 });
+ await menu.click();
+ await page.getByRole('menuitem', { name: 'New Bookmark' }).click();
+
+ const dialog = page.getByRole('dialog');
+ const field = dialog.getByRole('textbox', { name: 'Description' });
+ await dialog.getByRole('textbox', { name: 'Title' }).click();
+
+ const toRgb = (channels: string) => `rgb(${channels.split(/\s+/).join(', ')})`;
+ const control = toRgb(await themeValue(page, '--border-control'));
+ /** `border-field-focus` follows `focus-control` unless the theme names it, and a theme
+ * that focuses fields by their edge (ClickHouse) also swaps the border to it. */
+ const focus = toRgb(await themeValue(page, '--border-field-focus'));
+ const edgeFocus =
+ (await page.locator('html').getAttribute('data-theme-field-focus')) === 'border';
+ /** The ring colour is read from the utility's own custom property: the dark stylesheet's
+ * outline rule outranks any outline utility, and the box shadow composes the ring. */
+ const paint = () =>
+ field.evaluate((node) => {
+ const style = getComputedStyle(node);
+ const channels = style.getPropertyValue('--tw-ring-color').match(/\d+/g) ?? [];
+ let surface = getComputedStyle(document.body).backgroundColor;
+ for (let el: Element | null = node.parentElement; el; el = el.parentElement) {
+ const background = getComputedStyle(el).backgroundColor;
+ if (background !== 'rgba(0, 0, 0, 0)' && background !== 'transparent') {
+ surface = background;
+ break;
+ }
+ }
+ return {
+ border: style.borderTopColor,
+ ring: `rgb(${channels.slice(0, 3).join(', ')})`,
+ shadow: style.boxShadow !== 'none',
+ surface,
+ };
+ });
+
+ const resting = await paint();
+ await page.keyboard.press('Tab');
+ await expect(field).toBeFocused();
+ const focused = await paint();
+
+ expect({
+ resting: resting.border,
+ border: focused.border,
+ ring: focused.ring,
+ shadow: focused.shadow,
+ ringClears: contrast(parseRgb(focused.ring), parseRgb(focused.surface)) >= WCAG_NON_TEXT,
+ }).toEqual({
+ resting: control,
+ border: edgeFocus ? focus : control,
+ ring: focus,
+ shadow: true,
+ ringClears: true,
+ });
+ });
+ }
});
diff --git a/eslint-suppressions.json b/eslint-suppressions.json
index a3da23d731..af58b19616 100644
--- a/eslint-suppressions.json
+++ b/eslint-suppressions.json
@@ -45,11 +45,6 @@
"count": 1
}
},
- "client/src/components/Bookmarks/BookmarkForm.tsx": {
- "shadcn/no-restyle": {
- "count": 11
- }
- },
"client/src/components/Chat/ChatView.tsx": {
"shadcn/no-restyle": {
"count": 1
@@ -132,7 +127,7 @@
},
"client/src/components/Chat/Input/MCPConfigDialog.tsx": {
"shadcn/no-restyle": {
- "count": 17
+ "count": 15
}
},
"client/src/components/Chat/Input/Mention.tsx": {
@@ -168,7 +163,7 @@
},
"client/src/components/Chat/Menus/Presets/EditPresetDialog.tsx": {
"shadcn/no-restyle": {
- "count": 3
+ "count": 2
}
},
"client/src/components/Chat/Menus/Presets/PresetItems.tsx": {
@@ -366,7 +361,7 @@
},
"client/src/components/Chat/Messages/Content/ToolOutput/OutputRenderer.tsx": {
"shadcn/no-restyle": {
- "count": 4
+ "count": 3
}
},
"client/src/components/Chat/Messages/Content/ToolOutput/ToolIcon.tsx": {
@@ -413,7 +408,7 @@
},
"client/src/components/Chat/Messages/Feedback.tsx": {
"shadcn/no-restyle": {
- "count": 11
+ "count": 10
},
"shadcn/require-static-classes": {
"count": 3
@@ -588,7 +583,7 @@
},
"client/src/components/Endpoints/SaveAsPresetDialog.tsx": {
"shadcn/no-restyle": {
- "count": 2
+ "count": 1
}
},
"client/src/components/Endpoints/Settings/Advanced.tsx": {
@@ -647,7 +642,7 @@
},
"client/src/components/MCP/CustomUserVarsSection.tsx": {
"shadcn/no-restyle": {
- "count": 12
+ "count": 8
}
},
"client/src/components/MCP/MCPServerMenuItem.tsx": {
@@ -702,7 +697,7 @@
"count": 1
},
"shadcn/no-restyle": {
- "count": 28
+ "count": 24
}
},
"client/src/components/Messages/Content/RunCode.tsx": {
@@ -883,7 +878,7 @@
},
"client/src/components/Prompts/forms/CreatePromptForm.tsx": {
"shadcn/no-restyle": {
- "count": 15
+ "count": 14
}
},
"client/src/components/Prompts/forms/PromptForm.tsx": {
@@ -958,7 +953,7 @@
"count": 1
},
"shadcn/no-restyle": {
- "count": 14
+ "count": 13
}
},
"client/src/components/SidePanel/Agents/Advanced/AdvancedPanel.tsx": {
@@ -973,7 +968,7 @@
},
"client/src/components/SidePanel/Agents/Advanced/AgentList.tsx": {
"shadcn/no-restyle": {
- "count": 8
+ "count": 7
}
},
"client/src/components/SidePanel/Agents/Advanced/ui.tsx": {
@@ -1149,12 +1144,12 @@
},
"client/src/components/SidePanel/Memories/MemoryCreateDialog.tsx": {
"shadcn/no-restyle": {
- "count": 5
+ "count": 2
}
},
"client/src/components/SidePanel/Memories/MemoryEditDialog.tsx": {
"shadcn/no-restyle": {
- "count": 6
+ "count": 3
}
},
"client/src/components/SidePanel/Memories/MemoryPanel.tsx": {
@@ -1169,7 +1164,7 @@
},
"client/src/components/SidePanel/Parameters/DynamicInput.tsx": {
"shadcn/no-restyle": {
- "count": 7
+ "count": 5
}
},
"client/src/components/SidePanel/Parameters/DynamicSlider.tsx": {
@@ -1207,7 +1202,7 @@
},
"client/src/components/Skills/dialogs/CreateSkillDialog.tsx": {
"shadcn/no-restyle": {
- "count": 10
+ "count": 9
}
},
"client/src/components/Skills/display/SkillDetail.tsx": {
@@ -1222,7 +1217,7 @@
},
"client/src/components/Skills/forms/CreateSkillForm.tsx": {
"shadcn/no-restyle": {
- "count": 6
+ "count": 5
}
},
"client/src/components/Skills/forms/SkillContentEditor.tsx": {
@@ -1232,7 +1227,7 @@
},
"client/src/components/Skills/forms/SkillForm.tsx": {
"shadcn/no-restyle": {
- "count": 6
+ "count": 5
}
},
"client/src/components/Skills/lists/SkillListItem.tsx": {
@@ -1258,7 +1253,7 @@
},
"client/src/components/Tools/AssistantToolsDialog.tsx": {
"shadcn/no-restyle": {
- "count": 5
+ "count": 3
}
},
"client/src/components/Tools/ToolItem.tsx": {
diff --git a/packages/client/src/components/Field.spec.tsx b/packages/client/src/components/Field.spec.tsx
index 822a7329ea..ff7b9a15c4 100644
--- a/packages/client/src/components/Field.spec.tsx
+++ b/packages/client/src/components/Field.spec.tsx
@@ -87,6 +87,17 @@ describe('field variants', () => {
expect(field.className).toBe(cn(fieldInvalid, 'resize-none'));
});
+ it('TextareaAutosize field takes the control outline and focus ring of a form field', () => {
+ render(<TextareaAutosize aria-label="draft" variant="field" className="resize-none" />);
+ expect(screen.getByLabelText('draft')).toHaveClass(
+ 'lc-field',
+ 'border-border-control',
+ 'focus-visible:ring-focus-control',
+ 'bg-transparent',
+ 'resize-none',
+ );
+ });
+
it('TextareaAutosize framed carries the bordered editor box exactly', () => {
render(<TextareaAutosize aria-label="draft" variant="framed" className="min-h-20" />);
const field = screen.getByLabelText('draft');
diff --git a/packages/client/src/components/InputNumber.tsx b/packages/client/src/components/InputNumber.tsx
index 2a3ede7d38..0a6084b631 100644
--- a/packages/client/src/components/InputNumber.tsx
+++ b/packages/client/src/components/InputNumber.tsx
@@ -32,7 +32,7 @@ const InputNumber: React.ForwardRefExoticComponent<
return (
<RCInputNumber
className={cn(
- 'border-border-medium text-text-primary placeholder:text-text-tertiary flex max-h-5 w-full rounded-md border bg-transparent px-3 py-2 text-sm focus:outline-hidden has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50',
+ 'border-border-control text-text-primary placeholder:text-text-tertiary flex max-h-5 w-full rounded-md border bg-transparent px-3 py-2 text-sm focus:outline-hidden has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50',
disabledWithinFillClasses,
INPUT_NUMBER_VARIANTS[variant],
className ?? '',
diff --git a/packages/client/src/components/TextareaAutosize.tsx b/packages/client/src/components/TextareaAutosize.tsx
index 62712206ad..719ffc45ab 100644
--- a/packages/client/src/components/TextareaAutosize.tsx
+++ b/packages/client/src/components/TextareaAutosize.tsx
@@ -9,19 +9,29 @@ import { useAtomValue } from 'jotai';
import ReactTextareaAutosize from 'react-textarea-autosize';
import type { TextareaAutosizeProps } from 'react-textarea-autosize';
import type { FocusOutline } from './Focus';
-import { FIELD_OWN_FOCUS, fieldEmbedded, fieldFlush, fieldInvalid } from './Field';
+import {
+ fieldBase,
+ fieldFlush,
+ fieldInvalid,
+ fieldEmbedded,
+ FIELD_OWN_FOCUS,
+ fieldFillTransparent,
+} from './Field';
import { focusOutlineVariants } from './Focus';
import { chatDirectionAtom } from '~/store';
import { cn } from '~/utils';
+import './Field.css';
/** A rounded editor box of its own, such as a prompt or message editor. */
const framed = `${FIELD_OWN_FOCUS} rounded-xl border border-border-medium bg-transparent text-text-primary placeholder:text-text-secondary focus-visible:ring-2 focus-visible:ring-focus-control`;
-/** The control is bare by default and the caller draws it. `framed` is the bordered, rounded
+/** The control is bare by default and the caller draws it. `field` is a form field like `Textarea`,
+ * with its outline and focus ring, that grows with its text. `framed` is the bordered, rounded
* editor box, `flush` draws no border or ring because the surrounding frame owns the indicator,
* and `embedded` fills a list or popover row edge to edge. */
-const AUTOSIZE_VARIANTS: Record<'default' | 'framed' | 'flush' | 'embedded', string> = {
+const AUTOSIZE_VARIANTS: Record<'default' | 'field' | 'framed' | 'flush' | 'embedded', string> = {
default: '',
+ field: `${fieldBase} ${fieldFillTransparent}`,
framed,
flush: `${FIELD_OWN_FOCUS} ${fieldFlush}`,
embedded: fieldEmbedded,