From 33bcf654eb0ac0ff9d3ad029872753a6ad933f90 Mon Sep 17 00:00:00 2001 From: paisley <8197966+su8su@users.noreply.github.com> Date: Thu, 16 Jul 2026 11:51:09 +0800 Subject: [PATCH] fix(chat): hide disabled workspace selector border (#1174) --- src/pages/Chat/ChatInput.tsx | 8 ++++---- tests/e2e/chat-workspace-context.spec.ts | 1 + tests/unit/chat-input.test.tsx | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pages/Chat/ChatInput.tsx b/src/pages/Chat/ChatInput.tsx index 9082b7a7..de15de4a 100644 --- a/src/pages/Chat/ChatInput.tsx +++ b/src/pages/Chat/ChatInput.tsx @@ -1177,11 +1177,11 @@ export function ChatInput({ tabIndex={workspaceSelectorDisabled ? -1 : undefined} onClick={workspaceSelectorDisabled ? undefined : handleWorkspaceButtonClick} className={cn( - 'inline-flex min-w-0 max-w-[260px] items-center gap-1 rounded-full border border-black/10 px-2 py-0.5', - 'bg-black/[0.02] text-tiny font-medium text-foreground/75 transition-colors dark:border-white/10 dark:bg-white/[0.04]', + 'inline-flex min-w-0 max-w-[260px] items-center gap-1 rounded-full border px-2 py-0.5', + 'bg-black/[0.02] text-tiny font-medium text-foreground/75 transition-colors dark:bg-white/[0.04]', workspaceSelectorDisabled - ? 'cursor-default opacity-80' - : 'hover:bg-black/5 hover:text-foreground dark:hover:bg-white/10', + ? 'cursor-default border-transparent opacity-80' + : 'border-black/10 hover:bg-black/5 hover:text-foreground dark:border-white/10 dark:hover:bg-white/10', )} > diff --git a/tests/e2e/chat-workspace-context.spec.ts b/tests/e2e/chat-workspace-context.spec.ts index d47e4194..1d61e932 100644 --- a/tests/e2e/chat-workspace-context.spec.ts +++ b/tests/e2e/chat-workspace-context.spec.ts @@ -194,6 +194,7 @@ test.describe('ClawX chat workspace context', () => { await expect(workspaceSelector).toHaveText(SESSION_WORKSPACE_LABEL); await expect(workspaceSelector).toHaveAttribute('title', SESSION_WORKSPACE); await expect(workspaceSelector).toHaveAttribute('aria-disabled', 'true'); + await expect(workspaceSelector).toHaveClass(/border-transparent/); const sidebar = page.getByTestId('sidebar'); const workspaceGroup = sidebar.getByTestId(workspaceSessionGroupTestId(SESSION_WORKSPACE)); diff --git a/tests/unit/chat-input.test.tsx b/tests/unit/chat-input.test.tsx index d4101651..7430009e 100644 --- a/tests/unit/chat-input.test.tsx +++ b/tests/unit/chat-input.test.tsx @@ -302,6 +302,8 @@ describe('ChatInput agent targeting', () => { const button = screen.getByTestId('chat-workspace-selector'); expect(button).toHaveTextContent('默认工作空间'); expect(button).toHaveAttribute('aria-disabled', 'true'); + expect(button).toHaveClass('border-transparent'); + expect(button).not.toHaveClass('border-black/10'); fireEvent.click(button);