Files
FreeCADWasmDev/docs/current/start-first-start-general-settings-20260923
wangdequan 789e18ca3e
Some checks failed
FreeCAD master CI / Prepare (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
FreeCAD master CI / Pixi (push) Has been cancelled
FreeCAD master CI / Ubuntu (push) Has been cancelled
FreeCAD master CI / Windows (push) Has been cancelled
FreeCAD master CI / Lint (push) Has been cancelled
FreeCAD master CI / WrapUp (push) Has been cancelled
Stale Issues / stale (push) Has been cancelled
CodeQL Advanced (c-cpp) / Analyze (c-cpp) (push) Has been cancelled
Push Crowdin Translations / update-crowdin (push) Has been cancelled
Fetch Crowdin Translations / update-crowdin (push) Has been cancelled
Build Release / upload_src (push) Has been cancelled
Build Release / build (10.13, macos-15-intel, osx-64) (push) Has been cancelled
Build Release / build (11.0, macos-latest, osx-arm64) (push) Has been cancelled
Build Release / build (15.0, macos-latest, osx-arm64) (push) Has been cancelled
Build Release / build (ubuntu-22.04, linux-64) (push) Has been cancelled
Build Release / build (ubuntu-22.04-arm, linux-arm64) (push) Has been cancelled
Build Release / build (windows-latest, win-64) (push) Has been cancelled
Monthly issue metrics / issue metrics (push) Has been cancelled
Continue FreeCAD Web UI parity repairs
2026-09-23 14:03:56 +08:00
..

Start 首次启动常规设置补漏

状态:已实现,未验证;复用既有 Start 包,不新增孤立任务。

具体修复

桌面依据 freecad-source/src/Mod/Start/Gui/GeneralSettingsWidget.cpp:首次启动页面中的 Language、Unit System、Navigation Style 会立即写入 General、Units.UserSchema 和 View.NavigationStyle,并与 ThemeSelector 一起作用。Web 原先只有 StartPreferencesEditor 的后置偏好页,StartLaunchPanel 首次启动区只有 Theme、ShowExamples、CustomFolder 和 closeStart,导致首次设置入口漏掉三项常规设置;并且 UserSchema 数值被当成 String 发给参数桥。

本轮复用并集中修复:

  • web/src/start-preferences.tsx 新增 readStartGeneral、saveStartGeneral 和 FirstStartGeneralSettings,从已有 PartBox 参数所有者读取并立即保存 Language、UserSchema、NavigationStyle、Theme;UserSchema 使用原生 Int 类型,保存失败保留错误提示和可恢复当前值。
  • applyStartTheme 统一写入 data-theme、color-scheme,并广播 freecad-theme-changed;既有后置 General settings 复用同一个控件和原生桥,不再保留两份行为不同的实现。
  • web/src/start-launch-panel.tsx 的 First start setup 挂载同一 General settings 控件,保留原有 FirstStart2024、ShowExamples、CustomFolder、closeStart、Done、Reload、Dismiss 生命周期;主题不再只写 localStorage,而由共享控件实时应用。

参数路径与桌面语义:

  • User parameter:BaseApp/Preferences/General/Language
  • User parameter:BaseApp/Preferences/Units/UserSchema(Int)
  • User parameter:BaseApp/Preferences/View/NavigationStyle
  • Web shell theme via document.documentElement.dataset.theme and colorScheme

复用与边界

复用 startParameters、requestOwnerParameters、navigationStyles、PartBox/DocumentProbe 参数持久化和现有 StartPreferencesEditor;不新建文档、不改变 Start 文件打开/新建/示例/自定义目录流程,不改 OCCT 或 Three.js。

语言选择写入原生 General 参数,并广播设置刷新事件;当前仓库没有独立 Web 翻译目录/运行时 locale loader,本轮保留已有静态 shell 文案机制,未虚构桌面 Qt 的即时翻译能力。后续若加入实际 locale loader,应复用该事件和参数 owner,而不是重新添加第二套首次启动页面。

构建

  • 修改:web/src/start-preferences.tsx、web/src/start-launch-panel.tsx。
  • 必要前端构建:python3 tools/build_web_frontend.py。
  • 日志:docs/current/start-first-start-general-settings-20260923/build.log,退出码 0,built in 1.64s。
  • 未运行测试、类型检查、浏览器、截图、烟测或验收;没有原生源码变化,无原生构建。
处理模块 对标项 源码落点 路由入口 OCCT 边界 状态 结论
Start 首次启动语言/单位/导航/主题 start-launch-panel.tsx;start-preferences.tsx Start_Start → FirstStartGeneralSettings → requestOwnerParameters 仅原生偏好,无几何算法 已补漏(未验证) 保留