清理排查过程的非必需改动:移除 onActive 保活与 H5 console 调试转发

定位 touch→mouse 时序为真因后,清理排查途中加入但最终非必需的代码:
- 移除 onActive/notifyShown(基于"ArkWeb 未激活态暂停动画"的误判;实测页面本就 active/visible,无需)。
  含 WebSlot.notifyShown + setup 调用 + BridgeGameContainer NavDestination.onShown。
- 移除 onConsole H5 console→hilog 调试转发(三容器 + webConsoleOn 字段 + logWebConsole + 多余 AppEnv 引入)。
保留:touch→mouse shim(真正修复)、expandSafeArea(白边修复)、debug 版 setWebDebuggingAccess。
(合成保活、SYNC_RENDER 已于 0caf385 移除。)devecocli build 通过、真机正常启动。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
lanterngamescn
2026-06-27 00:48:50 +08:00
co-authored by Claude Opus 4.8
parent 0caf3853af
commit 4b291396bc
3 changed files with 1 additions and 49 deletions
@@ -39,8 +39,6 @@ export struct BridgeGameContainer {
@State private sharePanelVisible: boolean = false;
/** 当前分享面板的一次性回投事件名(用户选定平台后 emit 回 ShareProvider)。 */
private shareResultEvent: string = '';
/** H5 console 转发开关(构造期固化为编译期 DEBUG 常量;release 下 onConsole 仅一次字段读取即返回,零日志开销)。 */
private readonly webConsoleOn: boolean = AppEnv.isDebug();
aboutToAppear(): void {
if (AppEnv.isDebug()) {
@@ -205,15 +203,6 @@ export struct BridgeGameContainer {
return this.params.entryUrl !== '' ? this.params.entryUrl : $rawfile('test_echo.html');
}
/** 转发 H5 console 到 hilogdebug 限定,带角色/级别/来源行,便于排查 H5 报错)。tag=WebConsole。 */
private logWebConsole(role: string, event: OnConsoleEvent): void {
if (!this.webConsoleOn) {
return;
}
const m: ConsoleMessage = event.message;
Logger.tag('WebConsole').i(`[${role}][lv${m.getMessageLevel()}] ${m.getMessage()} @${m.getSourceId()}:${m.getLineNumber()}`);
}
build() {
NavDestination() {
Stack() {
@@ -235,10 +224,6 @@ export struct BridgeGameContainer {
this.slotL?.onFirstProgress();
}
})
.onConsole((event: OnConsoleEvent) => {
this.logWebConsole('lobby', event);
return false;
})
.onRenderExited((event: OnRenderExitedEvent) => this.slotL?.onRenderExited(event.renderExitReason))
// 子游戏 Web(临时,subgameUrl 非空时存在)
@@ -258,10 +243,6 @@ export struct BridgeGameContainer {
this.slotS?.onFirstProgress();
}
})
.onConsole((event: OnConsoleEvent) => {
this.logWebConsole('subgame', event);
return false;
})
.onRenderExited((event: OnRenderExitedEvent) => this.slotS?.onRenderExited(event.renderExitReason))
}
@@ -273,8 +254,6 @@ export struct BridgeGameContainer {
.width('100%').height('100%')
}
.hideTitleBar(true)
// 页面(重新)可见时激活当前槽的 Web 引擎,恢复 CSS 动画/rAF(首次进大厅 + 从通用网页返回)
.onShown(() => this.activeSlot()?.notifyShown())
.onBackPressed(() => {
// 分享面板打开时,返回键关闭面板并按取消回投(对齐 Android 点空白关闭)
if (this.sharePanelVisible) {