6 Commits
Author SHA1 Message Date
Lu Fan(SonnyCalcr) 1b875267db refactor: 移除 WebView2,界面只保留 Direct2D (#1013)
* refactor(engine): 语音独立工具改用原生托盘菜单,移除 WebView2

托盘菜单改用 Win32 弹出菜单,设置项改为用关联编辑器打开 config.toml,关于页改为消息框。删除 window_webview2 与两份 HTML 资源,windows-app 特性不再依赖 webview2 端口。

* refactor(server): 移除 WebView2,候选窗、工具栏、托盘菜单与设置窗口只保留 Direct2D

删除 src/webview2 与 webview_utils,小窗口的置顶、皮肤重载和工具栏状态缓存移到 window/small_windows,presenter 成为唯一路径,D2D 下的置顶时序与 cloak 行为保持不变。设置进程去掉 WebView2 宿主、鼠标转发与启动图,只构建原生窗口;旧快捷方式传入的 --d2d / --webview2 被忽略。删除 appearance.ui_backend 与 appearance.settings_ui_backend(读取、写入、设置页下拉框与两份配置模板),升级时由模板合并丢弃旧值。设置窗口的图片资源移到 server/assets/settings,安装到数据目录的 assets\settings。不再链接 WebView2Loader,vcpkg 去掉 webview2 端口。

* build(installer): 打包与 CI 不再处理 WebView2 页面和运行时

Prepare-PackageFiles 去掉 -UiHtmlDirectory 与 html 暂存,改为暂存 server/assets/settings;安装器不再检查 WebView2 Runtime、不再创建 ProgramData 下的 WebView2 用户数据目录,升级和卸载时清理旧版留下的 webview2 / webview2-settings 与数据目录里的 html。CI 删除设置页构建、契约同步检查和候选窗 DOM 测试,release 的打包任务不再依赖网页产物;dependabot 去掉 npm。第三方声明去掉 WebView2Loader。

* refactor(ui-html): 删除 WebView2 页面与设置页前端工程

候选窗、工具栏、托盘菜单、设置页、主题和契约副本都已没有使用者;设置窗口用到的图片资源已移到 server/assets/settings。sync-contracts.py 与 pnpm/Vite/TypeScript 工程一并删除,契约仍以 engine/contracts/webview 为唯一来源。

* docs(server): 文档改为只描述 Direct2D 界面

仓库地图去掉 ui-html,组件边界、uiAccess 与置顶时序、设置窗口和配置读写的说明改写为 Direct2D 唯一界面;安装说明去掉 WebView2 Runtime 检查,打包命令去掉 -UiHtmlDirectory;engine/contracts/webview 的说明改为设置窗口是唯一使用者,名字是历史遗留。

* docs(skins): 皮肤说明不再区分 WebView2 与 D2D 渲染器

v2 字段去掉「仅 WebView2」,改为说明由 Direct2D 原生渲染、部分字段仍在补全;颜色必须带 # 改为清单格式约定。随包的 skins/niya-demo/skin.toml 不改,免得用户机器上的同名皮肤在升级时被当成已修改而改名备份。

* docs(ui): demo 说明文字不再提 WebView2
2026-10-17 02:48:02 +08:00
fanlusky 3b6b65020d perf(installer): 本地打包默认不含 PDB,另开带符号入口
本地跑 test-light.ps1 等很久,慢的大头不是编译而是 Inno Setup 在压 PDB:
包里 PDB 约 140 MB,而真正的 EXE/DLL 只有约 20 MB,msime_setup.iss 又是
Compression=lzma2 + SolidCompression=yes,整整一遍压下来轻量包要 58.7 秒。

Prepare-PackageFiles.ps1 新增 -IncludeSymbols,不带它就把 server_exe\ 和
tsf_dll\ 里的 PDB 全部剔除。校验逻辑没有放松:仍然要求 Release 构建产出同名
PDB,缺符号照样打包失败,只是「符号是否随包安装」变成了显式选择。
msime_setup.iss 的两条 *.pdb 加上 skipifsourcedoesntexist,同一份脚本在带
符号和不带符号两种暂存下都能编译。

正式发布行为不变:release.yml 的打包步骤显式传 -IncludeSymbols,发布的安装包
依旧携带与二进制匹配的符号。

test.ps1 和 test-light.ps1 原本是两份几乎逐行相同的拷贝,现在一起收进
Invoke-LocalTest.ps1,三个入口都是它的薄包装:

  test.ps1          含词库,不含 PDB
  test-light.ps1    不含词库,不含 PDB
  test-symbols.ps1  含 PDB,默认轻量,加 -Full 走完整包

轻量包 Inno Setup 耗时 58.7s -> 9.2s,安装包体积 33.4 MB -> 7.7 MB。
2026-09-13 03:56:58 +08:00
fanlusky 20e62f0a3c fix(installer): 打包写 .iss 用 LF,test/test-light 还原工作目录
Prepare-PackageFiles 回写 MyAppVersion 时把文件末尾换行强制为 CRLF,
与仓库 .gitattributes 的 eol=lf 冲突,导致 msime_setup.iss 在每次打包后
被 git 标记为已修改,但 git diff 看不到文本差异。改为输出 LF。

test.ps1 与 test-light.ps1 顶部 Set-Location $PSScriptRoot 改变进程工作目录
且从不还原,脚本结束后调用者的 shell 被留在 installer\。两者均改为
Push-Location + try/finally Pop-Location,运行中途报错也能还原到调用前目录
(各构建步骤已用绝对路径,不依赖进程 cwd)。
2026-09-11 23:11:47 +08:00
Evan Hu b2d736cd79 fix(build): finish local tooling migration to the monorepo 2026-09-06 09:02:13 +09:00
Evan Hu b48dc82652 fix(ci): resolve the pipe probe contracts from the repository, not the server
The probe took its include directory from $ServerRoot/MetasequoiaImeEngine/contracts, which is where the engine sat when it was a submodule of Server. It is a submodule of the repository now, so the path does not move with -ServerRoot. A missing include directory is not a configure error, so this surfaced minutes later as C1083 on a header nobody had moved; the script now checks and says so before building.

The local packaging rehearsals had the same stale assumption, looking for MetasequoiaImeTsf, MetasequoiaImeServer and MetasequoiaImeUiHtml beside the installer. Worse, they skipped the build when a neighbour was absent, which in this layout means every build is skipped and whatever binaries are lying around get packaged into an installer you then run on your own machine. The three components are directories of this repository, so a missing one is now a hard failure, and Prepare-PackageFiles.ps1 is passed the directory names it needs.

Both were missed because the sweep that moved the submodules read its own output through head, so a truncated list looked like a complete one. Re-checked by resolving every relative path literal in every tracked file with no filtering.
2026-09-06 03:28:13 +09:00
fanlusky 3145200331 Add light version of installer test. 2026-09-01 00:10:48 +08:00