Repository navigation
fix(pwa): replace blank navigation wait with local boot shell - #78
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cann
2E3C
ot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景与变更
独立窗口冷启动或移动网络切换导致旧连接挂住时,原本
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.mdtests/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通过