Skip to content

feat(desktop): 启动超过 30 秒时显示已等待时间和日志目录 - #241

Merged
freedomkk-qfeng merged 9 commits into
ECNU:mainfrom
wf0229:pr/startup-slow-hint
Nov 15, 2026
Merged

freedomkk-qfeng merged 9 commits into
ECNU:mainfrom
wf0229:pr/startup-slow-hint

Conversation

@wf0229

@wf0229 wf0229 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

问题

插件可能让 Host 启动等上几分钟,例如轮询扫码登录的插件,或网络不通时的请求。这期间启动页(BootPage)一直只转圈,用户分不清是卡住了还是在等待,也不知道该把什么发给管理员。

改动

  • 新增 dsh-electron/src/boot-hint-preload.cjs:
    • 构建时追加到 preload-app.ts,和已有的 boot-brand-preload.cjs 一样,只在 dsh-app://app 的主框架中运行。

    • 启动页([data-dsh-boot])存在超过 30 秒后,在页面底部显示:

      已等待 N 秒。可能有插件在等待扫码或网络。如长时间无进展,请退出后把日志发给管理员:<日志目录>

    • 启动页消失时,提示随之移除,定时器也会停止。

  • 主进程新增同步 IPC eduwork:boot-hint,返回 desktopStartupHint()。
    • 只接受主窗口主框架的请求,校验方式与 eduwork:boot-brand 相同。
    • 返回内容只有固定文案和本机日志目录,不含 Host 状态。
    • 出错时返回空字符串,提示不显示,不影响启动。
  • build-shell.mjs:把这个 preload 加入适配器哈希记录,把 startup-hint.mjs 加入复制列表。

测试

  • 新增 dsh-electron/tests/startup-hint.test.mjs,在 VM 中运行这个 preload,覆盖三种情况:
    • 不到 30 秒时不显示;
    • 超过 30 秒后显示已等待时间和日志目录;
    • 启动页消失后提示被移除,定时器停止。
  • node --test dsh-electron/tests/*.test.mjs:257 通过,0 失败。
  • source-receipt.json 已刷新(保留 createdAt),audit-eduwork-distribution --verify-receipt 无错误,check-source-docs 无问题。

🤖 Generated with Claude Code

wf0229 and others added 2 commits October 26, 2026 08:10
插件(例如轮询扫码登录的插件)可能让 Host 等待几分钟,启动页一直只转圈,
用户分不清是卡住还是在等。超过 30 秒后,在启动页底部显示已等待的秒数、
可能的原因和本机日志目录,启动页消失时提示随之移除。

提示文字由主进程通过 eduwork:boot-hint 同步返回,只接受主窗口主框架的
请求,内容只有固定文案和日志目录,不含 Host 状态。

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@wf0229 wf0229 closed this Oct 26, 2026
@wf0229 wf0229 reopened this Oct 26, 2026
@freedomkk-qfeng
freedomkk-qfeng merged commit 507f561 into ECNU:main Nov 15, 2026
10 checks passed
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.

2 participants