Skip to content

feat(ui): 自定义玻璃态下拉组件 + 设置选项卡滚动到顶部#222

Closed
Xavier-Trump wants to merge 59 commits into
dev/delicious233from
dev/trump
Closed

feat(ui): 自定义玻璃态下拉组件 + 设置选项卡滚动到顶部#222
Xavier-Trump wants to merge 59 commits into
dev/delicious233from
dev/trump

Conversation

@Xavier-Trump
Copy link
Copy Markdown
Collaborator

Summary

  • 新建共享 Select 组件替代所有原生 <select>(portal下拉面板、键盘导航、点击外部关闭)
  • 玻璃态主题样式,支持日间/夜间切换
  • 设置选项卡切换时右侧内容自动滚动回顶部

Files

文件 变更
app/shared/src/ui/Select.tsx 新建,共享下拉组件
app/shared/src/ui/Select.module.css 新建,玻璃态主题样式
app/shared/src/ui/index.ts 导出 Select
app/desktop/src/components/settings/primitives/SelectControl.tsx 使用新 Select
app/desktop/src/components/settings/settingsShared.tsx 使用新 Select
app/desktop/src/components/SettingsPage.tsx 使用新 Select + 选项卡切换滚动到顶部
app/desktop/src/components/IM/IMContactList.tsx Hub联系人选择器使用新Select

Test plan

  • 手动验证设置页面所有下拉样式(日间/夜间)
  • 手动验证IM联系人选择器
  • 手动验证选项卡切换滚动到顶部
  • 运行 typecheck 和 test(预存问题待修复)

DeliciousBuding and others added 30 commits May 25, 2026 02:26
# Conflicts:
#	app/web/README.md
# Conflicts:
#	app/shared/src/types.ts
Xavier-Trump and others added 21 commits May 25, 2026 20:49
…tion

feat(desktop): 规划桌面端登录入口
…nctions

feat(desktop): 接通桌面聊天闭环
…ct-alignment

feat(frontend): 对齐前端接口契约
…ct-closeout

feat(frontend): 收口前端接口契约
…nd-smoke

feat(frontend): 收口契约文档与冒烟状态
…oseout

feat(desktop): 收口IM操作与状态契约
…d-surface-alignment

feat(web): 对齐桌面标准工作台布局
…pass13

fix(frontend): 对齐 master 前端接口契约
…38 lines)

Extract 27 settings sections, 12 primitives, 13 domain cards, and shared
utilities from the monolithic SettingsPage.tsx into a modular directory
structure under `src/components/settings/`.

Pure file split — no logic, CSS, or behavior changes.
Desktop conflicts resolved per review:
- theirs: tauri.conf.json, AgentList, AuthPage, LoginForm, API layer (hubAuth/hubClient/edgeClient/useAuth), App.tsx
- ours: SettingsPage split, App.module.css, test files, i18n, shared types
- fix: duplicate useCreateThread in threadQueries
Resolved conflicts in .gitignore, AGENTS.md, pnpm-workspace.yaml, app/web/README.md.
Strategy: accepted dev/delicious233 (source of truth) for most; merged both sides for pnpm-workspace.yaml (mobile package + onlyBuiltDependencies).
30 files across api/, app/web/, app/shared/, edge-server/, .github/ had
lingering conflict markers. Resolved by adopting dev/delicious233 content
except shared/package.json which preserves HEAD's hubEvents, hubClient,
surfaceMetadata, and workbenchState exports.
Resolved conflicts in IM/types.ts, SettingsPage.tsx, useIMChat.ts by
adopting dev/delicious233 (source of truth).
- 新建共享Select组件(portal下拉面板、键盘导航、点击外部关闭)
- 主题感知玻璃态样式(日间/夜间)
- 替换Settings中3个SelectControl及IMContactList中的原生select
- 设置选项卡切换时右侧内容自动滚动回顶部
Copy link
Copy Markdown
Collaborator

@DeliciousBuding DeliciousBuding left a comment

Choose a reason for hiding this comment

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

综合审查——3 个 agent 并行审查结论

Xavier,方向完全正确。Select 组件填补了一个真实的缺口,portal 方案和键盘导航都写得不错。但合并前需要处理以下问题:

阻塞项(BLOCKED — 必须修)

1. Rebase 到最新 dev/delicious233
当前 base 是旧 dev/trump,与已合并的 #219(SettingsPage 拆分)、#220(IM 增强)、#221(Web 页面)冲突。需要:

git fetch origin
git rebase origin/dev/delicious233

SettingsPage.tsx 在 #219 中已拆分为 67 个文件,你的 scroll-to-top 和 SelectControl 改动需要适配新的拆分结构。

2. 新增 Select.test.tsx + Select.stories.tsx
AGENTS.md 明确规定:共享 UI 组件测试放在 app/shared/src/ui/*.test.tsx。新组件必须有测试 + Storybook story。
参考文件:app/shared/src/ui/Card.test.tsxapp/shared/src/ui/Button.stories.tsx

3. 用 OKLCH 设计 tokens 替换硬编码颜色
AGENTS.md 明确禁止硬编码颜色值。Select.module.css 中 ~80% 的颜色用了 rgba(),应替换为已有 tokens:

  • rgba(0,0,0,0.08)var(--border)
  • rgba(255,255,255,0.48)var(--card)
  • rgba(246,247,250,0.92)var(--popover)
    等。全局 tokens 定义在 app/desktop/src/styles/themes.css

Bug(必须修)

4. CSS 拼写错误[data-theme='dark'] .chevon.chevron(Select.module.css 末行)
5. z-index 过低var(--z-dropdown, 1100) 实际解析为 10(tokens.css 已定义此变量),下拉菜单会被 sticky header 和浮层遮挡。

建议改进(可后续 PR)

  • aria-activedescendant 关联当前选中项
  • Home/End 键导航
  • disabled prop
  • 合并两个 SelectControl wrapper(primitives/SelectControl.tsx 和 settingsShared.tsx 各有一个)

总结

代码质量 OK,架构方向正确。主要是合规性问题——三个阻塞项修完后就可以合。

DeliciousBuding added a commit that referenced this pull request May 28, 2026
feat(shared): 玻璃态 Select 组件——PR #222 修复版
@DeliciousBuding
Copy link
Copy Markdown
Collaborator

已通过 #223 提交了修复版并合并——

修复内容:

  • ✅ 所有 rgba() 替换为 OKLCH 设计 tokens
  • ✅ 新增 Select.test.tsx(6 测试)
  • ✅ Rebase 到最新 dev/delicious233(零冲突)
  • ✅ 修复 .chevon.chevron CSS 拼写
  • ✅ 修复 z-index 使用 --z-overlay(30)

你的 Select 组件已经进主线了,作者署名保留。这个 PR 帮你关了,后续新 PR 记得:

  1. base 设为 dev/delicious233 ✅(这次对了)
  2. 用 OKLCH tokens 代替 rgba()(参考 themes.css)
  3. 新组件带测试文件

@DeliciousBuding
Copy link
Copy Markdown
Collaborator

已通过 #223 合并 Select 组件(修复版)。作者署名保留。

DeliciousBuding pushed a commit to DeliciousBuding/AgentHub that referenced this pull request Jun 4, 2026
从 PR TokenDanceLab#222 提取并修复:
- 所有 rgba() 替换为 OKLCH 设计 tokens(--border/--card/--popover/--ring)
- 修复 .chevon → .chevron CSS 拼写
- 修复 z-index 使用 --z-overlay(30) 替代 --z-dropdown(10)
- 新增 Select.test.tsx(6 测试:渲染、键盘导航、onChange)
- 添加到 shared/ui 导出

Co-Authored-By: Xavier-Trump <2933243959@qq.com>
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