Files
msime-windows/engine/contracts/webview/fixtures.json
T
fanlusky 426bb9d544 feat(server): WebView2 候选窗口支持滚轮翻页,并加上开关
PR #351 只给 D2D 候选窗口加了滚轮翻页,WebView2 后端还没有。

网页端只上报一个以 WHEEL_DELTA 为单位的原始 delta,notch 累加仍然
交给 CandidateWheel::ConsumeWheelDelta,两个宿主最终都汇聚到
WM_PAGE_CANDIDATE,翻页逻辑一份不重复。Chromium 的 wheelDeltaY 本身
就是 ±120/格,正是原生累加器期望的单位,deltaY 作标准回退。

同时把滚轮翻页做成可配置的 general.paging_mouse_wheel,默认关闭:
候选宿主是 NOACTIVATE 且从不获得焦点,滚轮只有在 Windows「当我悬停
在非活动窗口上方时滚动它们」开启时才会送达,无法无条件承诺,所以设为
opt-in,设置页里也写明了这个前提。开关只在 WM_PAGE_CANDIDATE 一处
判断;D2D 那边在 WM_MOUSEWHEEL 顶部提前返回 false,关闭时消息照旧
交给 DefWindowProc,与功能加入前一致。
2026-09-13 01:02:02 +08:00

451 lines
8.5 KiB
JSON

[
{
"name": "legacy settings",
"message": {
"type": "configRequest"
},
"valid": true,
"surface": "settings",
"direction": "client"
},
{
"name": "versioned settings",
"message": {
"type": "configRequest",
"protocolVersion": 1
},
"valid": true,
"surface": "settings",
"direction": "client"
},
{
"name": "unknown version",
"message": {
"type": "configRequest",
"protocolVersion": 2
},
"valid": false,
"surface": "settings",
"direction": "client"
},
{
"name": "string version",
"message": {
"type": "configRequest",
"protocolVersion": "1"
},
"valid": false,
"surface": "settings",
"direction": "client"
},
{
"name": "unknown message",
"message": {
"type": "snapLayout"
},
"valid": false,
"surface": "settings",
"direction": "client"
},
{
"name": "extra envelope field",
"message": {
"type": "configRequest",
"surprise": true
},
"valid": false,
"surface": "settings",
"direction": "client"
},
{
"name": "wrong surface",
"message": {
"type": "configRequest"
},
"valid": false,
"surface": "candidate",
"direction": "client"
},
{
"name": "candidate 1",
"message": {
"type": "candidate",
"data": 1
},
"valid": true,
"surface": "candidate",
"direction": "client"
},
{
"name": "candidate 9",
"message": {
"type": "candidate",
"data": 9
},
"valid": true,
"surface": "candidate",
"direction": "client"
},
{
"name": "invalid candidate 0",
"message": {
"type": "candidate",
"data": 0
},
"valid": false,
"surface": "candidate",
"direction": "client"
},
{
"name": "candidate 10 by mouse",
"message": {
"type": "candidate",
"data": 10
},
"valid": true,
"surface": "candidate",
"direction": "client"
},
{
"name": "invalid candidate 1.2",
"message": {
"type": "candidate",
"data": 1.2
},
"valid": false,
"surface": "candidate",
"direction": "client"
},
{
"name": "invalid candidate 1",
"message": {
"type": "candidate",
"data": "1"
},
"valid": false,
"surface": "candidate",
"direction": "client"
},
{
"name": "invalid candidate None",
"message": {
"type": "candidate",
"data": null
},
"valid": false,
"surface": "candidate",
"direction": "client"
},
{
"name": "candidate wheel one notch down",
"message": {
"type": "candidateWheel",
"data": -120
},
"valid": true,
"surface": "candidate",
"direction": "client"
},
{
"name": "candidate wheel high precision remainder",
"message": {
"type": "candidateWheel",
"data": 24
},
"valid": true,
"surface": "candidate",
"direction": "client"
},
{
"name": "invalid candidate wheel fractional",
"message": {
"type": "candidateWheel",
"data": 1.5
},
"valid": false,
"surface": "candidate",
"direction": "client"
},
{
"name": "invalid candidate wheel from settings",
"message": {
"type": "candidateWheel",
"data": -120
},
"valid": false,
"surface": "settings",
"direction": "client"
},
{
"name": "resize corner",
"message": {
"type": "resizeStart",
"data": "left-top"
},
"valid": true,
"surface": "settings",
"direction": "client"
},
{
"name": "unknown corner",
"message": {
"type": "resizeStart",
"data": "topLeft"
},
"valid": false,
"surface": "settings",
"direction": "client"
},
{
"name": "config scalar",
"message": {
"type": "configUpdate",
"data": {
"path": "input.mode",
"value": "cn"
}
},
"valid": true,
"surface": "settings",
"direction": "client"
},
{
"name": "config missing value",
"message": {
"type": "configUpdate",
"data": {
"path": "input.mode"
}
},
"valid": false,
"surface": "settings",
"direction": "client"
},
{
"name": "config wrong shape",
"message": {
"type": "configUpdate",
"data": []
},
"valid": false,
"surface": "settings",
"direction": "client"
},
{
"name": "dictionary import",
"message": {
"type": "dictionaryRequest",
"data": {
"requestId": "dict-1",
"dictionary": "quanpin",
"action": "import",
"content": "ni'hao\t你好\t10"
}
},
"valid": true,
"surface": "settings",
"direction": "client"
},
{
"name": "dictionary request unknown action",
"message": {
"type": "dictionaryRequest",
"data": {
"requestId": "1",
"dictionary": "quanpin",
"action": "eval"
}
},
"valid": false,
"surface": "settings",
"direction": "client"
},
{
"name": "negative context size",
"message": {
"type": "contextMenuResize",
"data": {
"width": -1,
"height": 100
}
},
"valid": false,
"surface": "candidate",
"direction": "client"
},
{
"name": "context overflow",
"message": {
"type": "contextMenuResize",
"data": {
"width": 65536,
"height": 100
}
},
"valid": false,
"surface": "candidate",
"direction": "client"
},
{
"name": "truncation diagnostics",
"message": {
"type": "contentTruncated",
"data": {
"surface": "cand",
"width": 100,
"height": 40,
"viewportWidth": 80
}
},
"valid": true,
"surface": "candidate",
"direction": "client"
},
{
"name": "window state",
"message": {
"type": "windowState",
"protocolVersion": 1,
"data": {
"isMaximized": true
}
},
"valid": true,
"surface": "settings",
"direction": "server"
},
{
"name": "wrong window state",
"message": {
"type": "windowState",
"data": {
"isMaximized": "true"
}
},
"valid": false,
"surface": "settings",
"direction": "server"
},
{
"name": "dictionary response",
"message": {
"type": "dictionaryResponse",
"requestId": "dict-1",
"ok": true,
"message": "成功",
"rows": [
{
"word": "你好",
"code": "ni'hao",
"weight": 10
}
]
},
"valid": true,
"surface": "settings",
"direction": "server"
},
{
"name": "malformed dictionary row",
"message": {
"type": "dictionaryResponse",
"requestId": "dict-1",
"ok": true,
"message": "成功",
"rows": [
{
"weight": 10
}
]
},
"valid": false,
"surface": "settings",
"direction": "server"
},
{
"name": "malformed root",
"message": [],
"valid": false,
"surface": "settings",
"direction": "client"
},
{
"name": "candidate 11 rejected",
"message": {
"type": "candidate",
"data": 11
},
"valid": false,
"surface": "candidate",
"direction": "client"
},
{
"name": "paged query",
"message": {
"type": "dictionaryRequest",
"data": {
"requestId": "dict-page",
"dictionary": "english",
"action": "query",
"word": "a",
"offset": 200,
"limit": 200
}
},
"direction": "client",
"surface": "settings",
"valid": true
},
{
"name": "negative offset",
"message": {
"type": "dictionaryRequest",
"data": {
"requestId": "dict-page",
"dictionary": "english",
"action": "query",
"word": "a",
"offset": -1,
"limit": 200
}
},
"direction": "client",
"surface": "settings",
"valid": false
},
{
"name": "unbounded page",
"message": {
"type": "dictionaryRequest",
"data": {
"requestId": "dict-page",
"dictionary": "english",
"action": "query",
"word": "a",
"offset": 200,
"limit": 201
}
},
"direction": "client",
"surface": "settings",
"valid": false
},
{
"name": "empty page",
"message": {
"type": "dictionaryRequest",
"data": {
"requestId": "dict-page",
"dictionary": "english",
"action": "query",
"word": "a",
"offset": 200,
"limit": 0
}
},
"direction": "client",
"surface": "settings",
"valid": false
}
]