Skip to content

[0986] 首选项 AI 子标签页提升为主标签页(排转换右侧) - #4571

Open
PinkMagicFly wants to merge 2 commits into
mainfrom
pigmagicfly/0986/preferences-ai-top-tab
Open

PinkMagicFly wants to merge 2 commits into
mainfrom
pigmagicfly/0986/preferences-ai-top-tab

Conversation

@PinkMagicFly

Copy link
Copy Markdown
Contributor

概要

把「编辑 → 首选项 → 转换」下的 AI 子标签页(#4568 引入)提升为与「转换」同级的主标签页,排在「转换」右侧:General / Keyboard / Mathematics / Convert / AI / Other。社区版仍整体不注册该 tab(沿用 community-stem? 惯例)。

实现

  • preferences-qml-metapreferences-widgets.scm):主 tab 列表外层包 list-filter … identity(与 Convert 子 tab 列表同一模式),AI 主 tab 以 (if (community-stem?) #f (list "ai" …)) 插在 convert 与 other 之间;Convert 子 tab 恒为 html/latex/bibtex/verbatim/pdf/image 6 项。
  • 首选项 QML facade 完全由 meta 数据树驱动,QML(Preferences.qml 仅头注释)与 C++ bridge 零功能改动。
  • 命名随位收敛:preferences-qml-convert-ai-fieldspreferences-qml-ai-fields;pref-keys 访问器 pref-convert-ai-actions-bar / pref-convert-ai-translate-targetpref-ai-actions-bar / pref-ai-translate-target(偏好键字符串与存储不变,零迁移风险),pref-keys.scm 分节头 Convert / AI tabAI tab
  • 测试:preferences-widgets-test.scm 主 tab 数/顺序改为同一期望 key 列表派生(社区版 5 / 企业版 6,ai 钉在 convert 右侧)、convert 恒 6 子 tab、test-ai-subtab-fields 更名 test-ai-tab-fields 改按主 tab 查找;2044.scm tab 结构断言同步(该文件 keyboard/other 字段数期望此前已陈旧,与本次无关未动)。
  • 设计稿 ai-docs/qml/qml-dialog.html 的 #panel-preferences 补 AI 主 tab 按钮与面板(设计稿此前未收录 AI 子 tab,本次直接按主 tab 收录)。

验证

  • xmake b stem 社区版与企业版(xmake f --is_community=n --yes)两种配置构建通过;
  • xmake r preferences-widgets-test:社区版 438 correct / 0 failed(5 主 tab、无 AI);企业版 470 correct / 0 failed(含 AI 主 tab 顺序、字段契约 + set-field 往返);rebase 到最新 main(fbf0c49f9)后复跑通过;
  • 格式化:本机 gf 18.11.33 与上游 18.11.34 输出不一致(会重排未改动区域,见 [0986] AI 操作栏居中、按选择方向定位、cmd/ctrl+j 接入对话 #4566 rebase 说明),未整体跑 gf fmt;全部触及 hunk 已用 gf 临时副本实测与 gf 输出逐字节一致。

手动验证步骤(企业版构建)

  1. xmake f --is_community=n --yes && xmake b stem,启动应用;
  2. 编辑 → 首选项:主 tab 行出现「AI」且在「转换」右侧,内容为「AI 操作栏」开关 +「翻译目标语言」下拉(与原子 tab 一致);
  3. 社区版构建下无 AI 主 tab;选中文字的悬窗操作栏行为不变(悬窗仅企业版可用,[0987] 首选项转换页新增 AI 子标签页(AI 操作栏开关 + 翻译目标语言) #4568 起社区版被 is_community_stem() 门控)。

🤖 Generated with Claude Code

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.

1 participant