fix(settings): open the AI tab pickers as in-app menus - #410
Merged
Merged
Conversation
Settings → 全局 AI rendered the permission mode and the command shell as native `<select>` popups, so one Settings window mixed two picker implementations: the Appearance rows open the shared anchored menu, while these two opened a platform-drawn menu with OS chrome, no theme tokens, and no current-value marker. Add `SettingsMenuSelect` on top of the shared `AnchoredMenu` and use it for both rows. It reuses the Appearance picker styles in one definition, keeps host-unavailable command shells listed but disabled, and keeps the previous disabled treatment while a write is in flight. Specs and E2E: - 04-ux/06-settings-ia.md documents the control for both rows. - Adds E2E-SETTINGS-ai-tab-pickers-use-in-app-menus. - The AI tab source contract now asserts no native `<select>` remains. Refs vastsa#405
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #405。
设置 → 全局 AI 的「权限模式」和「命令 Shell」此前用原生
<select>渲染,弹层由操作系统绘制——方角、系统默认高亮、不跟随主题、没有当前项标记——和同一个设置窗口「常规」页的主题/语言选择器明显不是一套东西。本 PR 新增SettingsMenuSelect(基于仓库已有的AnchoredMenu),把这两行切到共享的应用内菜单:外观、键盘行为(方向键循环、Escape 与外部点击关闭并归还焦点)与读屏语义都与外观页选择器一致。不可用的命令 Shell 仍会列出并保持禁选,标签仍带「不可用」后缀;保存进行中触发器仍禁用。未改动持久化字段、IPC/RPC 契约、Plugin SDK 与权限逻辑。其余仍在使用原生
<Select>的位置(模型配置、供应商对话框、插件设置等约 11 处)不在本 PR 范围。同步文档:
04-ux/06-settings-ia.md中英两版写明这两行的控件形态;E2E 计划新增场景E2E-SETTINGS-ai-tab-pickers-use-in-app-menus;源码契约测试补上「AI 页不再出现原生<select>」的断言,fixed-dropdown-surfaces的表单加入新的菜单表面类名。截图
验证
pnpm build:jspnpm --filter @pi-desktop/desktop typecheckpnpm lintpnpm --filter @pi-desktop/desktop testpnpm -r --filter '!@pi-desktop/docs' --if-present testnode scripts/check-architecture.mjs --base origin/mainpnpm test:e2e:theme-surfaces真实 Chromium 加载生产 CSS 对比过:新触发器与外观页主题触发器的计算样式一致(高度 30px、圆角 full、同一 raised 背景与阴影),菜单为 fixed 定位、240px 宽、radius-lg 圆角与 elevation token,深浅两套主题均通过,页面上不存在
<select>元素。