35 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 3a7adb6f1a feat(server): 日期时间混入候选,混输查询合并到同一条线程
- 新增 MixedCandidates(src/mixed/):英文、emoji、颜文字、日期时间共用一条后台线程,
  按一次输入查完、一次回调交回任务线程合并,候选窗每个按键最多因混输刷新一次。
  删除 EmojiIme / KaomojiIme;EnglishIme 只保留英文状态、Shift+Y 和候选译文
- 日期时间混入候选:全拼 / 双拼下整串是 rq / riqi / date、sj / shijian / time、
  xq / xingqi / week(双拼按方案换算后的整拼也算)时,首个格式排在首个中文候选之后、
  云 / 英文 / emoji 之前,其余追加在末尾;选中直接上屏,不调频、不能固定或删除
- 新增 utility.mixed_candidates(候选混输总开关,默认开)与 utility.date_time_candidates
  (默认关);总开关关掉后英文、emoji、颜文字、快捷短语、日期时间都不混入,各自的值保留。
  两份配置模板与两个设置宿主同步读写
2026-10-02 03:39:23 +08:00
fanlusky a8c10a63a6 feat(settings): add a restart-server button under the UI backend setting
界面渲染 only takes effect at Server startup, so the setting already told the
user to restart the IME process but offered no way to do it outside the
Ctrl+Shift+Alt+R developer shortcut. Add a 重启 button in the same section.

Settings runs in its own process, so the request travels the Aux pipe — the
supported cross-integrity control path the config notifications already use —
and the Server exits with the Watchdog restart code. The shortcut and the
button now share RestartServerProcess().
2026-09-12 16:41:13 +08:00
fanlusky a7779d2b05 refactor(engine): 将 engine 从 submodule 内嵌为仓内一等组件
`vendor/MetasequoiaImeEngine` submodule 改为 `engine/` 目录,导入的是
product-lock.json 原本钉住的提交 c810d201,逐文件核对过 blob,因此这是一次
搬迁而不是引擎升级。引擎自己的嵌套 submodule(googlepinyinime-rev、utfcpp、
miniaudio)按各自 gitlink 一并展开,来源与提交见 engine/UPSTREAM.md。

Windows 专门化裁掉了不属于本产品的部分:whisper.cpp 与本地推理 provider、
macOS 示例宿主、整个 dictionary/ 建库流水线、上游 CI 与 release-please 配置。
词库仍按 product-lock.json 在构建时取发布产物。

引擎不再进 product-lock.json:没有 gitlink 就没有可比对的东西,锁里写一个上游
commit 等于宣称这棵树仍等于上游,而第一个 Windows 专门化改动落地时这句话就假了。
verify-contracts / verify-checkout 随之移除,verify-published 保留。

CI 与工具链:引擎源码并入根 scripts/format.sh(删掉引擎自己的那份,避免两套排除
列表分叉);引擎 voice.yml 里的 silero_vad.onnx 摘要校验移到本仓 lock job;
engine-bump-triage 工作流与其测试删除;gitsubmodule 的 dependabot 频率由 daily
改为 monthly。

README、README.en、AGENTS.md、CONTRIBUTING、docs/product-release.md 及各子目录
文档同步说明新的位置与边界。
2026-09-12 03:40:48 +08:00
Evan Hu 807a098f33 docs(server): 补齐合仓后的隔离开发数据和页面准备 2026-09-06 09:42:53 +09:00
Evan Hu 98a5e590c2 test(build): verify manifest arguments and stop on embedding failure 2026-09-06 09:02:13 +09:00
Evan Hu 8b5205db96 chore(server): pin merged shared voice provider implementation 2026-09-06 04:37:29 +09:00
Evan Hu 5f8d75d79e fix(installer): use Engine tables in the local monorepo layout 2026-09-06 04:16:19 +09:00
Evan Hu 05036a763d docs: describe one repository instead of six
The product README was under windows/ after the move, but it was never a component readme: it is the download page, the feature guide and the contribution guide for the whole product, so it goes back to the root and windows/ gets a real component readme.

AGENTS.md at the root now carries the repository map, the component boundaries that used to be cross-repository rules, and the release process, since the scripts that process drives live at the root. The component files keep what is genuinely theirs and say which paths they are relative to. References that named sibling repositories now name sibling directories, and the lock documentation records that Server, the pages, the GUI framework and the installer are no longer inputs to pin.
2026-09-06 02:40:51 +09:00
Evan 261035a33c chore: consume the engine as a library and stop prepare_env clobbering the build (#14)
* chore: consume the engine as a library and stop prepare_env clobbering the build

The engine submodule was pinned at a197746, eight commits behind the engine's
main branch and older than the commit that first gave the engine a CMakeLists
of its own. That is why this repository listed the engine's translation units
by hand: at the pinned commit there was no target to link against. There is
one now, and Apple and Linux already consume it, so do the same here.

- advance the engine submodule from a197746 to 8cc306c
- add_subdirectory the engine and link MetasequoiaIme::Engine from the server,
  the dictionary replay tool and the settings executable, dropping the two
  hand-maintained source lists
- point the engine and msimeui submodule URLs at MSIME-Engine and MSIME-UI,
  and update the README, which still used the pre-rename repository names

prepare_env.py, which the README tells every new contributor to run first,
overwrote four tracked build files from templates under scripts/config_files
that had fallen years behind:

- CMakeLists.txt was replaced by a 147-line copy of what is now a 400-line
  build, dropping opencc, cpp-pinyin, msimeui, settings and the panels
- tests/CMakeLists.txt was replaced by an unrelated generic WinCppTemplate
- CMakePresets.json lost the vcpkg-release preset that llaunch-release.ps1
  needs

Running the documented first build step therefore broke the build. The script
now only writes the two files that are genuinely generated, and rewrites
CMakePresets.json in place instead of copying a stale template over it.

The .clangd generation addressed template lines by index and the indices had
drifted: the Boost path was written over the WebView2 include and the Sciter
path over a comment, leaving clangd unable to resolve the WebView2 headers.
The template now carries named placeholders, and the script fails loudly if
any are left unsubstituted.

Also remove src/sciter. It is a third candidate window backend that no
CMakeLists has referenced for some time; the shipped backends are d2d and
webview2, and those are the only two ui_backend accepts.

* docs: keep the historical checkout directory names in the build steps

The clone URLs had to change, since the old ones only resolved through
GitHub's rename redirect, but cloning without an explicit target would also
have renamed the working directories. MSIME-Windows's AGENTS.md records that
the historical directory names are deliberate: msime-installer's
Prepare-PackageFiles.ps1 expects siblings called MetasequoiaImeServer and
MetasequoiaImeDict, and the release workflow checks the current repositories
out into exactly those paths. Clone into them explicitly instead.

* chore: re-pin the engine at the WIN32_LEAN_AND_MEAN fix

Moves the submodule from 8cc306c to f91cd20. That carries metasequoiaime/MSIME-Engine#14,
which stops the engine exporting WIN32_LEAN_AND_MEAN as a PUBLIC compile definition and so
unblocks MetasequoiaImeSettings, whose WebView2.h include failed with 101 instances of C2146
against the trimmed Windows.h the definition forced on every consumer.

The range also picks up the two dependabot merges the engine took in the meantime: #12 bumps
utfcpp and #13 bumps the pinned action SHAs.

* build(tests): link the engine target instead of listing its sources

The test executable hand-listed the same 41 engine translation units the root
CMakeLists.txt did, and compiled them without NOMINMAX. That went unnoticed
while the pinned engine predated core/key_event.h; now that the engine headers
pull in Windows.h, the min and max macros collide with std::max and the build
fails with C2589 in quanpin_query.cpp.

Linking MetasequoiaIme::Engine fixes it at the source: NOMINMAX is one of the
definitions the engine exports PUBLIC precisely because it changes the declared
API surface.

* docs(agents): correct the tests wiring and describe the new prepare_env

Two sections went stale or were inaccurate.

The tests section said the root CMakeLists.txt does not reference tests/ at
all. It does: include(CTest) at :8 defaults BUILD_TESTING to ON and :411
add_subdirectory(tests) picks it up, so the test target is configured and
compiled on every CI run. This PR proved it from the other side, by breaking
the test target's build with a NOMINMAX regression that CI caught. The real
gap is narrower and still worth the warning: ci.yml has no ctest step, so the
executable is built and never run.

The generated-files section described prepare_env.py copying templates over
CMakeLists.txt and CMakePresets.json by fixed line index. This PR removes that
behaviour, so the section now describes what the script actually does.
2026-09-05 19:02:43 +09:00
fanlusky 8bbb73f27d Rename data folder to metasequoiaime 2026-07-21 23:12:17 +08:00
fanlusky 6385c73e7a Add a watchdog program to keep the server alive. 2026-07-20 17:02:47 +08:00
fanlusky df6002c03e Add preliminary support for Chinese-English mixed input. 2026-07-14 19:00:09 +08:00
fanlusky fe1cc4a1e1 Add support for the Wubi input method. 2026-07-13 18:35:52 +08:00
fanlusky 1d5f8fcd31 docs 2026-06-20 22:50:51 +08:00
fanlusky 3dbe168da1 Start to support new-version engine 2026-06-19 23:01:50 +08:00
fanlumaster 94891e6b99 update submodule 2026-03-17 16:26:33 +08:00
fanlumaster 32afc26f4a docs 2026-02-28 15:09:40 +08:00
fanlumaster 28d11c0d9f [config]: Read toml config file from appdata location 2026-01-30 12:27:23 +08:00
fanlumaster 4ca63687a6 [chore]: Repo name 2025-11-08 01:20:26 +08:00
fanlumaster b26fed121d [docs]: change some project info 2025-10-31 16:36:02 +08:00
fanlumaster 31793e59ea [docs]: some info 2025-10-31 16:14:47 +08:00
fanlumaster 026eb95a68 [docs]: chore 2025-09-16 21:26:49 +08:00
fanlumaster 6656e5cca1 [chore]: Docs and Env 2025-06-25 16:20:36 +08:00
fanlumaster 7cda62430f [docs]: New screenshot 2025-06-20 00:15:05 +08:00
fanlumaster 7fd0e24475 [Project]: Rename IME name 2025-06-10 17:18:22 +08:00
fanlumaster 9afb644a0c [docs]: More screenshots 2025-06-02 21:27:59 +08:00
fanlumaster 00b6866951 [chore]: docs 2025-06-01 02:22:39 +08:00
fanlumaster 6f7998c6fa [docs]: Supplement some build info 2025-05-31 21:38:50 +08:00
fanlumaster 9ccc81d6a3 [docs]: Build steps 2025-05-31 21:02:18 +08:00
fanlumaster f76d15eaca [docs]: Update screenshots 2025-05-31 08:44:34 +08:00
fanlumaster 6408084aa2 [chore]: Project info 2025-04-27 17:42:37 +08:00
fanlumaster 9decef9160 [UI]: Remove wasted space of vertical candidate window 2025-04-24 06:07:43 +08:00
fanlumaster 5e1ed5d439 [chore]: Project info 2025-04-16 17:00:09 +08:00
fanlumaster abff7464e0 first commit 2025-03-25 15:27:42 +08:00