收紧桌面图片拖拽坐标

桌面壳发送图片拖拽事件前将坐标归一为非负整数

桌面壳配置检查反查拖拽坐标归一和单测边界

共享决策记录补充桌面拖拽坐标边界约定
This commit is contained in:
2026-06-20 15:40:26 +08:00
parent e2433ec02f
commit cf01ba3097
3 changed files with 22 additions and 1 deletions
@@ -16,6 +16,14 @@
---
## 2026-06-20 桌面图片拖拽坐标非负边界
- 背景:Tauri 桌面壳通过系统拖拽事件向 H5 发送 `file.imageDropped`,拖拽坐标来自窗口事件;窗口边缘或平台差异可能产生负数或小数坐标,H5 只负责校验有限 number,不负责裁剪桌面系统坐标。
- 决策:桌面壳在发送图片拖拽 HostBridge 事件前,必须把拖拽坐标 round 成整数并裁剪到非负值,再组装 import image payload;配置检查反查坐标归一 helper 和对应 Rust 单测。
- 影响范围:`apps/desktop-shell/src-tauri/src/shell/file_drop.rs``apps/desktop-shell/scripts/check-config.mjs`
- 验证方式:`npm run desktop-shell:test -- file_drop``npm run desktop-shell:typecheck``npm run check:native-shells``npm run check:encoding``git diff --check`
- 关联文档:`docs/【前端架构】ExpoReactNative与Tauri宿主壳方案-2026-06-17.md``docs/【前端架构】宿主壳能力统一协议-2026-06-17.md`
## 2026-06-20 移动扫码权限异步取消边界
- 背景:Expo 移动壳 `scanner.scanQrCode` 会打开真实相机权限请求和扫码 overlay;如果用户在系统权限 Promise 返回前关闭扫码,旧权限结果不能重新激活 CameraView,也不能完成已经取消的 HostBridge 请求。