fix(chat): hide disabled workspace selector border (#1174)

This commit is contained in:
paisley
2026-07-16 11:51:09 +08:00
committed by GitHub
parent 7774d89c66
commit 33bcf654eb
3 changed files with 7 additions and 4 deletions
+4 -4
View File
@@ -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',
)}
>
<FolderOpen className="h-3 w-3 shrink-0" />
+1
View File
@@ -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));
+2
View File
@@ -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);