✨ popup 脚本列表展开数量改为可配置,与菜单展开数量分开 - #1645
Open
CodFrm wants to merge 1 commit into
Open
Conversation
设置里的「展开数量」只作用于脚本行下的 GM 注册菜单项,popup 脚本列表的 折叠数一直写死为 5,两者又都是 5,用户按字面理解调大后列表毫无变化。 - 新增 script_list_expand_num(默认 5,0 表示不折叠),放在「弹窗布局」组 - 原设置改名「菜单展开数量」,两条描述都写清作用对象与 0 的含义 - 搜索框阈值跟随新设置,不再与列表折叠数各说各话 Close #1558
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 / 检查清单
背景
close #1558
用户把设置里的「展开数量」调到 21,popup 脚本列表仍然只展开 5 条。核实后是两个问题叠加:
menu_expand_num只作用于脚本行下 GM 注册菜单项 的截断(src/pages/popup/App.tsx的ScriptRow),且消费方只有 popup 一条链,浏览器右键菜单并不使用它。const EXPAND_LIMIT = 5(src/pages/popup/usePopupData.ts),任何设置都改不动。文案「展开数量 / 超过此数量时自动折叠」既没写作用对象,两处折叠数又都是 5,必然被误读。issue 里报告者与维护者都确认了这一点。
本次改动
新增设置:
script_list_expand_num(默认 5,0 表示不折叠),位于「弹窗布局」组,替换写死的EXPAND_LIMIT。文案拆分,两条描述现在都写明作用范围,与上方「显示右键菜单 / 在浏览器右键菜单中显示脚本菜单」形成清晰边界:
10 个语言包同步更新;新 key 已加入
config_sections.ts的备份「外观」分类。实现考虑
slice(0, -n)反而从尾部截断。min={0}与aria-label;菜单设置的兜底值由?? 0改为?? 5(配置未加载完时回显真实默认值,0 在该设置里另有含义)。已知限制
menu_expand_num行为一致,本次未改)。建议审查重点
usePopupData.ts中expandThreshold/expandLimit的区分是否表达清楚(前者管搜索框,后者管截断)。terminology-<locale>.md。验证
pnpm run test:ci—— 311 files / 3500 tests passed(含新增 10 条:popup hook 7 条 + 设置页 3 条,均先红后绿)pnpm run lint—— 全绿(prettier / tsc / check:i18n / check:issue-templates / eslint)e2e/scratch/,一次性验证脚本,未并入正式套件)5/5 通过:install、keep-alive×2、subscribe-lifecycle)在基线提交13ddf857重新构建后单跑同样失败,与本改动无关(keep-alive 在找英文标签而本机浏览器为中文 UI;install/subscribe 卡在等待安装页close事件)。Screenshots / 截图
截图未上传(本地验证记录在
test-results/verify/issue-1558-expand-num/,该目录 git-ignored)。设置页改动可由上表的文案对照复现;popup 行为差异见上面的 e2e 结论。