Repository navigation
docs(research): 29 · 距离 Electron 还差哪些 + JS/DOM 事件覆盖核对 - #70
Merged
Merged
Conversation
新增研究报告 29(联网核实 Electron 模块面 + MDN DOM 事件全集,仓库代码实证现状)。 两个核心问题: - **距 Electron**:先分层——架构层(原生场景树 vs Chromium/webview,无 HTML/npm/ DevTools/IPC)是**路线选择非缺口**;真缺口在**桌面外壳集成**(窗口属性控制、 应用菜单、系统托盘、原生对话框/通知、全局快捷键、OS 文件拖入、深链、自动更新), 多数是"引 crate(muda/tray-icon/rfd/notify-rust/global-hotkey/opener)+ 转发 winit 事件"的工程活,不动内核。多窗体本轮(run_multi)已补。 - **JS 事件是否全覆盖**:否但桌面高频交互已覆盖大半——模板 12 个 on* 属性 (含本轮 oncontextmenu/onpointermove)+ 完整 IME/剪贴板/编辑/五段键盘。缺口: dblclick/auxclick/pointer over-out-capture/change-beforeinput/**拖放**/**触屏**/ 原始 wheel;animation/transition/fullscreen 等 Web 独有项原生无对应也不需要。 逐类事件矩阵 + 优先级补法在文内。 顺带:docs/README 两语索引 + CLAUDE.md/根 README 计数 28→29。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cyaim
added a commit
that referenced
this pull request
Jul 26, 2026
复核 7-24/7-25 成果(#55–#70)全绿后,推进报告 29 事件面第 2 优先级: 把 sv-ui 本已有的 on_pointer_down/up(原只内部接 :active)在 codegen 暴露为 `onpointerdown`/`onpointerup` 模板属性。sv-ui 存储/setter/getter/shell 派发全 就绪,零内核改动、ViewNode 不增重。 - 与 :active 共存靠**合成一次设入**(照 :hover↔onpointerenter/leave 的 __ue/__ul 范式):同元素既有 :active 又有 onpointerdown 时,set_on_pointer_down 只发一次, 闭包先记按压态 __ac 再调用户回调 __ud;纯 :active(无用户回调)保持原简形。 - 禁用门同点击(pointer_down/up_handler getter 收口,disabled 节点取不到)。 - 白名单/错误串补 onpointerdown/onpointerup/onkeyup(onkeyup 有真 arm、原串漏列)。 **修一处方法论坑 + 孪生 bug**:合成路径首版 syn::parse 金样全绿,却被 multiclosure-check 真编译逮出 E0382——合成块里 __ud/__uu 各 move 同一非 Copy plain,只一份块级克隆份不够。修法每侧单独套 with_captured_plain。**同构的 :hover↔onpointerenter/leave 也有同款潜伏 bug**(:hover+捕 String 在真实代码更常见), 一并改为逐侧捕获。纯伪类退简形 move || __hv.set(..),wide 金样 -36/+4(等价简化)。 守卫:onpointerdown_onpointerup_compile + onpointerdown_composes_with_active_pseudo (sv-compiler);multiclosure-check(Check.svelte)加 :active/:hover × down/up/enter/leave × 捕 label 的真编译守卫。全仓 595 测试绿、clippy 净。 顺带复核发现回填报告 29:§2.1/§2.2 pointerdown/up 转 ✅;§3 #2 标完成;并订正 #1「OS 文件拖入」——winit DroppedFile **不带光标坐标**,非"转发即可",是清单里 唯一有平台能力坑的一项(下一步优先转 #3 onwheel/ondblclick,无平台坑更顺手)。 Co-authored-by: Psyche <review@local> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
新增研究报告 #29(联网核实 Electron 模块面 + MDN DOM 事件全集,仓库代码实证现状)。回应「调研距离 Electron 还差哪些 + JS 事件是否全覆盖」。
两个核心结论
距 Electron —— 先分层,否则把"路线选择"误当"缺口":
run_multi)已补;但窗口属性控制、应用菜单、系统托盘、原生对话框/通知、全局快捷键、OS 文件拖入、深链、自动更新基本全空。多数是"引成熟 crate(muda/tray-icon/rfd/notify-rust/global-hotkey/opener)+ 转发 winit 既有事件"的工程活,不动内核。JS 事件是否全覆盖 —— 否,但桌面高频交互已覆盖大半:
on*(onclick/onkeydown/onkeyup/onfocus/onblur/onpointerenter/leave/oninput/onsubmit/onscroll/oncontextmenu/onpointermove)+ 内部完整 IME/剪贴板/文本编辑/五段键盘路由。dblclick/auxclick(中键)、pointerover/out/cancel/capture、change/beforeinput/select(作事件)、拖放(drag-and-drop)、触屏(touch)、原始onwheel、mouseover/mouseout。animation*/transition*/fullscreenchange/scrollsnap*)在编译期 CSS + 原生动画模型下无 1:1 对应也不需要。文内含逐类事件覆盖矩阵(mouse/pointer/keyboard/focus/form/clipboard/IME/scroll/drag/touch)+ 逐 Electron 模块对照表 + 优先级补法(按性价比排序,窗口属性暴露成本最低回报最高)。
方法
Electron 模块与 DOM 事件全集联网核实(electronjs.org/docs、MDN Element、W3C UIEvents,2026-07);svelte-rs 现状仓库代码实证(codegen 事件白名单、ViewNode/InputState、sv-shell window_event/run_multi)。
顺带更新 docs/README 两语索引 + CLAUDE.md/根 README 研究计数 28→29。
🤖 Generated with Claude Code