8000 fix(pwa): replace blank navigation wait with local boot shell by InfinityPacer · Pull Request #78 · InfinityPacer/meterleaf · GitHub
[go: up one dir, main page]

Skip to content

fix(pwa): replace blank navigation wait with local boot shell - #78

Merged
InfinityPacer merged 2 commits into
mainfrom
fix/pwa-boot-shell
Nov 11, 2026
Merged

InfinityPacer merged 2 commits into
mainfrom
fix/pwa-boot-shell

Conversation

@InfinityPacer
Copy link
Copy Markdown
Owner

背景与变更

独立窗口冷启动或移动网络切换导致旧连接挂住时,原本 public/sw.js 会等待满 8 秒导航超时后才回退离线页,期间浏览器尚未收到任何页面字节,窗口会持续停在空白白屏,且在弱网下点击离线页重连按钮直接触发 location.reload() 也会再次白屏。

  • 在 public/sw.js 将首次未确认导航的快速回退阈值收紧到 350 毫秒,超时未拿到首包时立即返回本地预缓存的过渡壳,同时对登录回调与过渡壳探活确认后的一次性重载保留完整 8 秒导航窗口,并将上游 502、503、504 导航回退至离线自动重试页
  • 重做 public/offline.html,首帧前同步恢复 meterleaf-theme 与 meterleaf-palette 深浅色及三套强调色,联网状态下先展示与 index.html 一致的启动加载提示,后台立即探活并在连上后握手重载进入账本,挂住超过宽限期或断网失败时再原地平滑切为离线提示,重连按钮改为原地探活反馈,不再直接刷白页面
  • 在 index.html 对齐三套强调色下的启动转圈配色,在 src/server/app.ts 为 /offline.html 设置 Cache-Control 为 no-cache,同步更新 docs/deployment.md
  • 在 tests/pwa.test.ts、tests/static-assets.test.ts 与 tests/pwa.browser.ts 覆盖 350 毫秒快速回退、8 秒确认重载与认证回调放行、网关错误回退、缓存头及断网原地重连场景

验证

  • bun run typecheck 与 bun run build 通过
  • bun test tests(85 个测试文件共 626 项测试全部通过)
  • tests/pwa.browser.ts 端到端通过,并在真实 Chromium 下完成移动端(390x844)与桌面端(1280x800)、浅色与深色、三套强调色、减少动态效果模式,以及 TCP 挂死黑洞(约 430 毫秒内绘出本地连接提示、约 2.7 秒原地切离线提示、点击重连原地转圈不白屏)和 850 毫秒高延迟慢网无循环进入账本的实测验收
  • bunx prettier --check 与 git diff --check 通过

@InfinityPacer
InfinityPacer merged commit 143ad1e into main Nov 11, 2026
2 checks passed
@InfinityPacer
InfinityPacer deleted the fix/pwa-boot-shell branch November 11, 2026 03:22
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

0