🐛 完善贡献者指南与编辑器未保存导航保护 - #1656
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.
Checklist / 检查清单
N/A — 本次改动没有关联的待关闭 Issue;人工审查项保留未勾选。
背景
贡献者文档、一次性扩展验证流程与 E2E harness 的职责边界需要收敛;同时脚本编辑器原有的
beforeunload保护无法覆盖扩展内部的 SPA 导航,未保存修改可能在页内切换时丢失。本次改动
实现考虑
useBlocker只拦截从/script/editor离开的页内导航;编辑器内部脚本切换继续沿用现有逻辑,浏览器刷新/关闭仍由beforeunload负责。建议审查重点
createHashRouter路由结构与原有 HashRouter 路由是否等价。验证
pnpm run lint— 通过(Prettier、TypeScript、i18n、Issue 模板、ESLint)。pnpm test -- --run src/pages/options/routes/ScriptEditor/index.test.tsx— 参数未成功收窄,实际全量运行;327 个测试文件、3680 个测试全部通过。pnpm exec vitest run --no-coverage --reporter=default src/pages/options/routes/ScriptEditor/index.test.tsx— 1 个测试文件、4 个测试全部通过;存在既有的 react-i18next 未初始化警告。git diff origin/main...HEAD --check— 通过。Screenshots / 截图
N/A — 导航保护复用现有确认对话框,没有新增视觉样式。