Files
msime-windows/engine/contracts/webview
Lu Fan(SonnyCalcr) 85edddc988 feat(server): 设置页支持把水杉设为默认输入法 (#802)
帮助页新增「默认输入法」卡片:显示当前是否为默认,提供「设为默认」和
「系统设置」两个按钮。设置走 input.dll 的 InstallLayoutOrTip /
SetDefaultLayoutOrTip,完成后按 HKCU International\User Profile 复核;
EnumEnabledLayoutOrTip 在 Windows 10/11 上对 TSF 输入法返回空列表,
因此状态直接读注册表。只在用户点击时执行,不在启动或升级时改写。

新增 defaultImeRequest / defaultImeResponse WebView 契约并同步 ui-html。

同时在帮助页加入 Wiki 与 FAQ 链接,在关于页加入官网 msime.app。
2026-10-11 02:22:01 +08:00
..

WebView messages

messages.json owns the message envelope, payload shape, and allowed sender windows. Change it here, run python3 generate.py, and re-sync the copy under ui-html/ in the same commit. The generated TypeScript union and embedded C++ schema must pass generate.py --check. runtime.js and validator.h implement the documented schema subset and run the same fixtures.json compatibility cases. The standalone CMake test requires Boost.JSON; the input engine itself does not acquire that dependency.

New messages carry protocolVersion: 1. A missing version is accepted as legacy v1 for existing skins; an explicit unknown version, unknown message, invalid payload, or message sent from the wrong window is rejected before dispatch. This is envelope validation, not a replacement for domain checks such as dictionary key validation, allowed configuration values, or the host's HTTPS URL policy.

ui-html/scripts/sync-contracts.py materializes these bindings into ui-html/webview2/shared and checks byte equality; CI runs it with --check, which now compares against this directory directly rather than against a pinned submodule. Settings imports the typed serializer and checks incoming messages. Classic candidate, toolbar and menu pages load the same runtime from the host's https://msime-contracts/ virtual mapping; packaging must include webview2/shared.

Server-to-page candidate rendering currently uses the existing view functions; this contract covers WebMessage actions and settings responses. Candidate view model ownership is documented separately from transport envelopes.