Skip to content

refactor(ui): 收敛设计 token 并迁移到 shadcn/Tailwind — 基于 #118 rebase - #119

Merged
ACCSCI merged 1 commit into
masterfrom
codex/ui-shadcn-refactor
Jul 20, 2026
Merged

refactor(ui): 收敛设计 token 并迁移到 shadcn/Tailwind — 基于 #118 rebase#119
ACCSCI merged 1 commit into
masterfrom
codex/ui-shadcn-refactor

Conversation

@ACCSCI

@ACCSCI ACCSCI commented Jul 19, 2026

Copy link
Copy Markdown
Owner

背景

基于 #118 (修复单实例生命周期并清理旧架构测试) rebase 的 UI 重构 PR。#118 已独立修复了端口恢复逻辑;本 PR 聚焦于视觉体系收敛

设计 token 收敛

  • globals.css: 删除双 :root 死代码与 dark 块 --color-* 硬编码重定义;写入最终色板(primary #C62A45 / destructive #D92D20 / info #356AE6 / canvas #F6F7F9),补全 success/warning/destructive/info 的 -bg/-text/-border 变体(light+dark)。
  • @theme inline@theme,修复 dark 下 --color-card 冻结为浅色的问题。
  • 新增 shadcn 组件: alert-dialog / badge / context-menu / dialog / dropdown-menu / input / tooltip。

修复的 bug

Bug 根因 修复
深色 Session 卡片发白 硬编码 #fff heatmap 遮罩 var(--card)
所有按钮无 padding globals.css 无 layer 的 *{margin:0;padding:0} 覆盖 Tailwind utilities 删除该 reset
两个 session 共用 :30000 portPool 纯内存态,重启后丢失已分配端口 syncProject 时 restoreSession 回填
"重新分配端口"无效 release 误释放其他 session 共享的端口 release 改引用计数语义
首页重叠/左侧窄缝 居中限宽留缝 grid 居中 + 留白
设置页端口输入竖排错乱 Input w-full 换行 一行两输入框
目录浏览器路径破碎 每段独立按钮 连续等高路径条
配置页 Execution mode 破损 内边距过小 segmented control
CustomTitleBar isMac 类冲突 h-8 + h-7 并存 h-8 移入 else
DirBrowserModal triggerRef 焦点不生效 硬编码 capturedTriggerRef 统一 effectiveTriggerRef

组件迁移

标题栏、TabBar、IconSidebar、SessionSidebar、工作区信息条、终端面板/设置栏、配置编辑器、目录浏览器、HookErrorModal、OrphanCleanModal、FilePicker、TodoDropdown、ErrorBoundary 全部迁到 Tailwind+shadcn。终端 "+" 菜单迁到 Radix DropdownMenu(键盘可达)。

端口修复说明

本 PR 的 port-pool release 引用计数 + restoreSession 保留,因为 #118 的 release 无引用计数存在共享端口误释放风险(单测已验证)。

验证

  • 浅色/深色/窄窗口真实 Electron 截图逐张对比
  • 端口分配 3 个单测(连续分配唯一 / restore 后不重复 / reassign 不回流)
  • 4 个 review thread 已全部 resolve
  • E2E 测试:ui-visual-audit + ui-targeted-shots 通过

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 19, 2026 14:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a comprehensive UI/UX refactoring of the AgentDock frontend to align with the "Operator Console" design system. It integrates Tailwind CSS, Radix UI primitives, and Sonner toasts, replacing several legacy custom components and styling sheets. It also introduces robust E2E testing suites for accessibility (axe-core), visual regression, and targeted UI fixes. However, a few issues remain: the terminal add menu in TerminalManager.tsx has not been fully migrated to a Radix DropdownMenu (causing a regression test failure), some inputs in ConfigEditor.tsx lack accessible labels, a Tailwind class conflict exists in CustomTitleBar.tsx, and DirBrowserModal.tsx fails to utilize the effectiveTriggerRef for focus restoration.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/components/TerminalManager.tsx Outdated
Comment thread src/components/ConfigEditor.tsx Outdated
Comment thread src/components/CustomTitleBar.tsx Outdated
Comment thread src/components/DirBrowserModal.tsx Outdated
@ACCSCI
ACCSCI force-pushed the codex/ui-shadcn-refactor branch from c6477c3 to d6f8e4e Compare July 20, 2026 12:32
@ACCSCI
ACCSCI force-pushed the codex/ui-shadcn-refactor branch from d6f8e4e to a37e6a5 Compare July 20, 2026 12:47
@ACCSCI ACCSCI changed the title refactor(ui): 收敛设计 token 并迁移到 shadcn/Tailwind 统一视觉体系 refactor(ui): 收敛设计 token 并迁移到 shadcn/Tailwind — 基于 #118 rebase Jul 20, 2026
@ACCSCI
ACCSCI merged commit df5a77d into master Jul 20, 2026
1 check passed
@ACCSCI
ACCSCI deleted the codex/ui-shadcn-refactor branch July 20, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants