Explorar o código

WIP: 修复新建操作常驻选中样式

[gstack-context]
Decisions: 新建聊天和新建群聊默认透明且使用常规字重,仅 hover/focus/active 提供反馈
Remaining: 全量测试、重载 8800、真实页面复验
Skill: /investigate
[/gstack-context]
samien hai 2 meses
pai
achega
e6fca491c2
Modificáronse 2 ficheiros con 10 adicións e 3 borrados
  1. 6 3
      src/client/components/app/WorkspaceShell.vue
  2. 4 0
      tests/e2e/workspace.spec.ts

+ 6 - 3
src/client/components/app/WorkspaceShell.vue

@@ -493,13 +493,16 @@ onBeforeUnmount(() => {
   padding: 0 11px;
   border: 0;
   border-radius: 10px;
-  background: var(--surface-soft);
+  background: transparent;
   color: var(--text-primary);
   cursor: pointer;
   font-size: 13px;
-  font-weight: 650;
+  font-weight: 580;
 }
-.sidebar-primary-action :deep(button:hover) { background: var(--surface-hover); }
+.sidebar-primary-action :deep(button:hover),
+.sidebar-primary-action :deep(button:focus-visible) { background: var(--surface-soft); }
+.sidebar-primary-action :deep(button:focus-visible) { outline: 0; box-shadow: inset 0 0 0 1px var(--line-strong); }
+.sidebar-primary-action :deep(button:active) { background: var(--surface-hover); }
 .sidebar-primary-action :deep(button > span) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
 
 .sidebar-feature-nav { display: flex; flex-direction: column; gap: 1px; padding: 0 0 9px; }

+ 4 - 0
tests/e2e/workspace.spec.ts

@@ -24,6 +24,8 @@ test('navigates every 9119 workspace without blank transitions', async ({ page }
   await expect(page.getByRole('button', { name: '文件库', exact: true })).toHaveCount(0)
   await expect(page.getByRole('button', { name: '产物', exact: true })).toHaveCount(0)
   await expect(page.getByRole('button', { name: '新建群聊' })).toBeVisible()
+  await expect(page.getByRole('button', { name: '新建群聊' })).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
+  await expect(page.getByRole('button', { name: '新建群聊' })).toHaveCSS('font-weight', '580')
   await expect(page.getByRole('button', { name: '管理群聊' })).toBeVisible()
   await expect(page.getByRole('button', { name: '发送消息' })).toBeVisible()
 
@@ -243,6 +245,8 @@ test('uses the unified Grok-style sidebar, search trigger, and persistent collap
   await expect(sidebar.locator('.sidebar-account-switcher')).toHaveCount(1)
   await expect(page.getByRole('button', { name: '搜索', exact: true })).toBeVisible()
   await expect(page.getByRole('button', { name: '新建聊天', exact: true })).toBeVisible()
+  await expect(page.getByRole('button', { name: '新建聊天', exact: true })).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
+  await expect(page.getByRole('button', { name: '新建聊天', exact: true })).toHaveCSS('font-weight', '580')
   await expect(sidebar.getByText('历史记录', { exact: true })).toBeVisible()
 
   const searchTrigger = page.getByRole('button', { name: '搜索', exact: true })