🐛 修复脚本设置缺少 context-menu 运行时机 - #1652
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 / 检查清单
背景
@run-at context-menu的运行能力已在 #1442 中实现,但脚本设置页的“运行时机”下拉框没有提供该选项。用户因此无法通过自定义元数据将订阅脚本切换为手动执行,只能直接改写脚本源码。本次改动
context-menu。early-start覆盖,并写入run-at: ["context-menu"]。ScriptEditor内 5 条已被相邻交互测试覆盖或仅做属性直出的低价值测试,不改变生产行为。建议审查重点
context-menu是否作为普通run-at值保存,而不会进入early-start的特殊分支。selfMetadata保存,不需要改写订阅脚本源码。关联
Closes #1649
Related: #1038, #1442
验证
pnpm exec vitest run --no-coverage --reporter=verbose <5 个受影响测试文件>— 5 个测试文件、82 个测试通过。pnpm exec vitest run --no-coverage --reporter=verbose src/pages/options/routes/ScriptEditor— 11 个测试文件、128 个测试通过。pnpm run lint— 通过,包括 Prettier、TypeScript、i18n、Issue 模板及 ESLint 检查。pnpm test— 311 个测试文件、3496 个测试全部通过。首次全量运行中scripts/check-issue-templates.test.mjs在并行负载下发生一次 340ms 超时;该文件单独重跑 18/18 通过(目标用例 155ms),随后原样全量重跑 3496/3496 通过,未修改无关测试或超时配置。Screenshots / 截图
N/A — 仅补齐现有下拉框中的受支持选项,未修改布局、样式或主题;交互行为由组件测试覆盖。