Repository navigation
降低首屏资源传输并按需启动卡片预览 - #66
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 cannot 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.
资源库打开时先展示封面。紧凑卡片通过「启动预览」按需加载 iframe,支持鼠标、键盘、触屏和失败重试。已进入的预览保留键盘焦点,离开视口且不再持有焦点时回收。八张较重的封面提供 480 / 960 像素 WebP 和明暗版本,保留 PNG 回退。
本地生产构建,gzip,每组冷启动 3 次取中位数。桌面 1440 × 1000。手机 390 × 844,约 1.6 Mbps、120 ms 延迟、4 倍 CPU 降速。传输量统计用户启动预览前的窗口。
慢网手机首张封面 2.79 → 2.58 秒。桌面样本为 0.19 → 0.21 秒。两条分支组合构建的主文档脚本为 189,975 字节 gzip,低于 190,000 字节预算。
npm run check(22 项单测)、最终生产构建和npm run test:dev通过。全量 Playwright 204 项通过,另两项更新启动方式或等待布局稳定后通过复测。最终产物额外通过 7 项触屏、封面、预算与跨浏览器流程用例。Closes #63