Repository navigation
fix: 同路径导航跳过离场快照,并锁定节点上限边界 - #60
Open
cursor[bot] wants to merge 1 commit into
Open
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Co-authored-by: zilorn <[email protected]>
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.
解决的问题 / Problem
Fixes #56
跟进 PR #57 审查。该审查判定原改动可以合并、无阻塞问题,并提了三处非阻塞发现。原头部分支
codex/animation-performance已不在远程,因此本分支从该 PR 的提交816b8bb接出,对 main 的差分包含原动画性能改动和下面的跟进。跟进的两处:
useBeforeLeave仍会在路径 effect 空转前执行cloneNode。直接切换路径仍提前调用
finishTransition(),不等待waitPageReady。瞬态页的旧画面只存在于快照中,没有快照时等待也遮不住新页的 Suspense 占位,因此保持与减少动态效果相同的直接切换。超长页进入首次加载的懒加载路由时,加载画面仍会露出来。改动后的行为 / Resulting behavior
原 PR 的行为保持不变:超过 1200 个节点的离场页不再整页快照,滚动条、开关、进度条、折页和分段控件改走合成属性。
本次追加:
?q=、#hash以及相对 query / hash)时,先清掉过期快照标志,再直接返回,不再cloneNode。history delta(数字)仍按换页处理。shouldSnapshot。不超过 1200 仍生成快照,1201 及以上直接切换。注释写明上限来自 Chromium 153、视口 390×844 的一次测量。验证 / Validation
pnpm exec tsc --noEmit通过。pnpm run i18n:check通过。pnpm build通过。node scripts/exit-snapshot-test.mjs通过(1200 仍快照、1201 直接切换;同路径 query / hash 跳过,换路径与 history delta 不跳过)。数据与兼容性 / Data and compatibility
不涉及数据库 schema、
user_version、迁移或持久化格式。无新增依赖。保活页状态、滚动位置、阅读进度不受影响。提交前检查 / Checklist