Skip to content

fix(oneko): ClientRouter 换页后重建像素猫 - #117

Merged
wutongyuonce merged 3 commits into
mainfrom
fix/oneko-survive-view-transitions
Oct 17, 2026
Merged

wutongyuonce merged 3 commits into
mainfrom
fix/oneko-survive-view-transitions

Conversation

@wutongyuonce

Copy link
Copy Markdown
Owner

摘要

  • 修复 Oneko 在 Astro View Transitions(ClientRouter)站内跳转后消失的问题:换页会移除挂在 body、未标 transition:persist 的猫节点,而旧的 __yublogOnekoBooted 仍阻止再次挂载。
  • 改为 CDN createOneko,并在每次 astro:page-load 上若猫缺失则 destroy 旧句柄并重建;页脚 data-oneko-toggle 仍由引擎同步。
  • 更新 docs/Oneko 像素猫.md、相关索引文档与 CHANGELOG「未发布」修复条目。

测试

  • pnpm exec tsc --noEmit 通过
  • 人工:站内跳转后猫仍在,且不会出现第二只;页脚「隐藏小猫」重建后仍可用

请用户合并;本 PR 不自动合并。

ClientRouter swaps body DOM and drops the body-mounted Oneko nodes
without transition:persist. Replace the one-shot __yublogOnekoBooted
boot with createOneko + ensure on every astro:page-load when the cat
is missing. Update Oneko docs and CHANGELOG.
@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
wutong-yu-blog Ready Ready Preview Oct 17, 2026 4:34pm UTC

Format BaseLayout for CI. Register astro:page-load once via
__yublogOnekoEnsureBound, and serialize recreate with an inflight
promise so concurrent ensureOneko calls cannot mount duplicate cats.
Add a brief comment in the destroy catch so ESLint no-empty passes,
matching nearby storage/theme catch style.
@wutongyuonce
wutongyuonce merged commit 80b4fb3 into main Oct 17, 2026
3 checks passed
@wutongyuonce
wutongyuonce deleted the fix/oneko-survive-view-transitions branch October 17, 2026 16:47

This branch was successfully deployed

1 active deployment
Preview — 038852c0 Deployed Oct 17, 2026 by vercel[bot]
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