Skip to content

feat(ohos): window-ignore-cursor-events + adapter tests + print/https-scheme fixes - #71

Open
ljy9812 wants to merge 1 commit into
Eulogizethesun:ohdevfrom
ljy9812:ohdev
Open

feat(ohos): window-ignore-cursor-events + adapter tests + print/https-scheme fixes#71
ljy9812 wants to merge 1 commit into
Eulogizethesun:ohdevfrom
ljy9812:ohdev

Conversation

@ljy9812

@ljy9812 ljy9812 commented Aug 6, 2026

Copy link
Copy Markdown

Summary

window-ignore-cursor-events (verified, archived)

  • Full openspec change (proposal/design/specs/tasks + plan)
  • set_ignore_cursor_eventsset_window_touchable(!ignore) via TSFN
  • TestRunner button + ohos-adapter test wiring (was never imported)
  • manual_tests.md ch.28 + chapter numbering fix
  • ohos-constraints.md §1.5 (ExternalError conversion constraint)

ACL fix

  • create_ohos_test_webview was rejected by ACL — added to app_manifest + run-app.json

Print fix (ohos-webview-print)

  • print.js injection for OHOS (was macOS/iOS only)
  • ohos.permission.PRINT in module.json5 templates
  • manualOhosPrint calls window.print() (shim) not getCurrentWebview().print()

HTTPS scheme fix (ohos-webview-https-scheme)

  • tauri-runtime-wry OHOS branch forwards with_https_scheme (was missing)
  • Init script auto-checks isSecureContext + crypto.subtle

drag_drop_overlay API (3-layer, cfg-gated)

  • tauri-runtime + tauri + tauri-runtime-wry: drag_drop_overlay field + builder + OHOS passthrough
  • #[cfg(target_env = "ohos")] gates the API surface so non-OHOS platforms have no such field (6 sites)
  • cmd.rs create_ohos_test_webview call site wrapped in cfg + let _ = suppressor on other platforms

webview file drag-drop — COMPLETE (device-verified 2026-08-07) [NEW COMMIT]

  • onLoadIntercept file:// interception (DefaultWebview.ets, WebBuilder + EmbeddedWebBuilder): ArkWeb consumes OS file drops by navigating to file://<dropped file> → ERR_ACCESS_DENIED → white screen (a kernel behavior desktop Tauri webviews do not have). The Web-level .onDrop fires unreliably (ArkWeb preempts it) and setResult(DRAG_SUCCESSFUL) is ineffective on the Web component. Resolution: a file:// branch in onLoadIntercept returns true to cancel the navigation (no white screen) and forwards the path via the drag-drop pipe drop|<path>|0,0. Whole webview becomes a drop zone, touch not blocked. Safe: Tauri OHOS loads via custom protocol (tauri:// / https://<proto>.localhost) or inline html, never file://.
  • openspec wire format: corrected paths_csv (comma) → paths_nul (\0-separated) so paths containing commas survive; both specs + plans updated with the device-verified result.
  • openspec change archived to openspec/changes/archive/2026-08-07-ohos-webview-drag-drop/.
  • Companion PR: Eulogizethesun/openharmony-ability chore(deps): replace cross-repo path deps with git deps #43 (drag.rs entity, DefaultWebview.ets onLoadIntercept + buildDragPipe).

openspec

  • 4 specs flagged with verification-status notes
  • ohos-dialog-error + ohos-window-ignore-cursor-events + ohos-webview-drag-drop archived

Real-device verification (API 23 desktop)

Feature Result
monitor ✅ PASS (3120×2080)
clipboard flag ✅ PASS
zoom flag ✅ PASS
ignore-cursor-events ✅ PASS
dialog error ✅ PASS
print ✅ PASS
https-scheme ✅ PASS (isSecureContext=true)
RunEvent::Resumed ❌ known (not firing)
drag-drop (onLoadIntercept) ✅ PASS (no white screen, path received, frontend displays it)

Test plan

  • cargo check (ohos target) + Windows host cargo check (no cross-platform pollution)
  • Full build + deploy + autotest (250 tests)
  • Real-device manual verification (9/10 PASS — drag-drop now passing)
  • No cross-platform pollution (cfg target_env=ohos)
  • Rebased on upstream/ohdev latest (bd3b803)

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Package Changes Through e4ddd4e

There are 11 changes which include tauri with minor, @tauri-apps/api with minor, tauri-build with minor, tauri-macos-sign with patch, tauri-bundler with minor, @tauri-apps/cli with minor, tauri-cli with minor, tauri-runtime with minor, tauri-runtime-wry with minor, tauri-utils with minor, tauri-plugin with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.10.1 2.11.0
tauri-utils 2.8.3 2.9.0
tauri-macos-sign 2.3.3 2.3.4
tauri-bundler 2.8.1 2.9.0
tauri-runtime 2.10.1 2.11.0
tauri-runtime-wry 2.10.1 2.11.0
tauri-codegen 2.5.5 2.5.6
tauri-macros 2.5.5 2.5.6
tauri-plugin 2.5.4 2.6.0
tauri-build 2.5.6 2.6.0
tauri 2.10.3 2.11.0
@tauri-apps/cli 2.10.1 2.11.0
tauri-cli 2.10.1 2.11.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@ljy9812

ljy9812 commented Aug 6, 2026

Copy link
Copy Markdown
Author

Code Review (babysit)

Clean — 0 Blocker, 0 Major

  • cfg isolation: correct (target_env=ohos, no cross-platform pollution)
  • NAPI/TSFN: N/A (this repo has no TSFN code)
  • print.js injection: macOS/iOS cfg extended with OHOS (correct)
  • tungstenite unconditional dep: Minor (build.rs cfg limitation, documented)

2 Minor noted (non-blocking): tungstenite dep, drag_drop_overlay field on cross-platform struct (default false, harmless).

@ljy9812 ljy9812 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OHOS Code Review — tauri#71 (ohos-webview-drag-drop)

自审巡检(pr-babysit)。共 4 findings,0 🔴 Blocker,故为 COMMENT。

🔴 🟡 🔵 ℹ️
0 1 2 1
  • 🟡 F1 openspec/specs/ohos-webview-drag-drop/spec.md:49 wire format 矛盾(见 inline)— 真实 bug,建议修
  • 🔵 F2 changes/ 下 dialog-error 相关 change 未归档(proposal/tasks 缺失)
  • 🔵 F3 统计表标题与覆盖内容不一致
  • ℹ️ F4 proposal 归档标注不完整(部分 task 状态未同步)

F1 经对抗性验证确认(line 49 说用 , 连接 paths_nul,与 line 26 定义 + line 32 示例的 \0 矛盾;含逗号路径会被 wry 侧 split('\0') 破坏——恰是 line 26 设计要避免的故障)。其余为文档卫生问题。

Comment thread openspec/specs/ohos-webview-drag-drop/spec.md Outdated

@ljy9812 ljy9812 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

检视意见回复

已确认所有 4 个 findings 均已修复(commit a0bb8a6):

  • F1: wire format 矛盾 - spec.md:49 已修正为 \0,与 line 26 定义 + line 32 示例一致
  • F2: dialog-error 未归档 - ohos-dialog-error change 已归档至 openspec/changes/archive/2026-08-06-/
  • F3: 统计表标题不一致 - manual_tests.md 统计表已给予独立 section 标题
  • F4: proposal 归档标注不完整 - proposal.md 已添加状态+遗留项;tasks.md task 11 已标记 Deferred

无遗留问题,可以合并。

ljy9812 pushed a commit to ljy9812/tauri that referenced this pull request Aug 10, 2026
3-way merge of base (bd3b803) + PR head + upstream (c30d28b):
- build.rs: keep both create_ohos_test_webview (PR) and create_ui_ability_window* (upstream)
- run-app.json: keep both allow-create-ohos-test-webview and allow-create-ui-ability-window* permissions
- TestRunner.svelte: keep both ohosAdapterTests (PR) and windowOpsTests/manualCreateUIAbilityWindow (upstream)
- cmd.rs, lib.rs, core.ts, lib.rs(wry), webview_window.rs, module.json5, ohos-constraints.md: auto-merged

Co-Authored-By: Claude <noreply@anthropic.com>
@ljy9812
ljy9812 force-pushed the ohdev branch 2 times, most recently from e59b60d to 130b85d Compare August 10, 2026 12:46
…-scheme fixes

- window-ignore-cursor-events: tao set_ignore_cursor_events → openharmony_ability set_window_touchable bridge
- ohos-adapter tests: drag-drop overlay, webview file drag-drop, print fix, https-scheme fix
- create_ohos_test_webview command + manual test UI
- tungstenite moved to main deps (cfg(desktop) custom cfg unresolvable by Cargo)
- openspec change archives + specs

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant