Commit a8c92c1
💄 更新页/安装页/编辑器体验修复,并修正被过期检查快照覆盖的更新记录 (#1677)
* 💄 更新页与安装页:即时反馈的状态机,去掉遮挡按钮的成功提示
批量更新页点「更新」后没有任何反应:页面串行等服务端整批跑完,中途不落任何
可见状态。改成行级状态机,点下去 40ms 内就进「更新中」,成功后停留约 450ms
再收拢离场,失败的行留在原地并带上失败原因。
安装页原来用 toast 报「安装成功」,恰好盖住刚点的按钮,而且页面随后就关掉,
提示等于没人看见。改成把确认状态放回按钮自身(安装 → 安装中… → 已安装),
成功提示不再飘窗;失败改为就地的错误条,让用户能看清原因再决定。
顺带把 toast 的取舍写进 docs/references/design-components.md:用户刚做过的
动作不再 toast,避免自证式提示。
* 🐛 更新记录不再被过期的检查快照覆盖,失败原因如实回报
一次检查更新要跑完逐条节流加网络往返,脚本多时可达数分钟,而结果是拿检查
开始时的脚本快照无条件写回内存记录的。这段窗口里用户若在更新页把某条更新装
上了,检查结束时那条「旧版 → 新版」会连同过期的代码比对一起复活——刚更新完
的行几秒后又冒出来,还带着「更新」按钮,看起来像没更新成功。真机验证过:磁盘
上确实已是新版本,只是记录被覆盖。
写回前按当前库内状态复核每条:脚本已删则整条丢弃,版本已变则退化成
checkUpdate: false,交给下一次检查重算。
同时把更新动作的返回值补成明确契约:缓存随 Service Worker 回收而消失时回报
record_expired,让页面提示重新检查而不是静默无反应;单条安装失败时把原因带
回去,供行内展示。
* 💄 编辑器:脚本列表开关收进「视图」菜单,删掉工具栏按钮
折叠按钮长在编辑器工具栏右侧,控制的却是左边的列表,而它左边还有主导航的
收起按钮——两个外观相近的控件挨在一起管着不同的面板。菜单里已经有稳定的
去处,就把入口收进「视图 → 显示/隐藏脚本列表」,工具栏按钮直接删掉。
快捷键仍是 ⌘B / Ctrl+B,走捕获阶段监听,Monaco 或输入框持有焦点时也能切换,
且不会把字符 b 输进代码。同时认 e.code 与 e.key:非拉丁布局下物理 B 键的
e.key 是本地字符(俄文为「и」),只认 e.key 会让这些用户完全按不出来。
移动端没有脚本列表面板,「视图」子菜单不出现。
Closes #1650
* ✨ 反馈链接落到 issue 模板选择页,并带上可读的环境信息
原来点「反馈问题」直接把用户摁进 bug 模板,连挑一下类型、顺手看眼有没有重复
issue 的机会都没有。改成落到 issues/new/choose,模板由用户自己选,版本号与
浏览器信息作为预填参数带过去。
浏览器信息不再糊一整条 Mozilla/5.0,而是「macOS 14.8.7 + Chrome 148 (arm64)」
这样的人话;能拿到 client hints 时用高熵值补全系统版本与架构(UA 被冻结后这
些信息只剩这一个来源),拿不到则退回解析 UA 串。原先按语言猜产地的
isChineseUser() 一并删掉。
给功能请求、技术方案、翻译三对模板补上可选的 scriptcat-version 字段,否则预填
参数会被 GitHub 静默丢弃。check-issue-templates 相应扩展:选择页 URL 的每个
参数名都要能在某个模板的字段 id 里找到;URL 的查询串必须写成字面量,运行时
拼装(如 URLSearchParams)会让 AST 读不到参数名、把校验变成空转,这种情况直接
报错而不是放行。
Closes #1648
* 💄 Agent:未配置模型时给出可执行引导,而不是一行灰字
「未配置模型」原来只是输入框下方一行不显眼的小字,用户看不见也不知道该去哪。
改成两层:空状态里说明原因并给出「去添加模型服务」「查看接入文档」两个动作,
输入区把发送禁用的原因写清楚并挂上「立即配置」。
Closes #1651
* fix: validate batch update cache before installing
* fix: prevent invalid install retries
* fix: align issue schema and shortcut handling
* ✅ e2e 安装页按扩展新建标签的方式打开,不再靠 about:blank 撑出的历史
#1675 起安装页改用 history.length 区分「独立新标签(关闭自己)」与「被 DNR 接管的
用户标签(返回上一页)」,install / subscribe-lifecycle 两条用例随即在 CI 红到现在。
原因在用例这边:context.newPage() 先停在 about:blank 再 goto,标签留下两条历史,
模拟出的是现实里不存在的第三种入口。实测三条路径的 history.length:
context.newPage() + goto = 2 ← 只有用例这么开
chrome.tabs.create({ url }) = 1 ← 生产:扩展新建的独立安装标签
同标签内从网页跳转 = 3 ← 生产:DNR 接管用户原标签
所以安装后走了 history.back() 退回 about:blank,标签不关,等 close 的用例超时。
改由扩展 service worker 调 chrome.tabs.create 开页,与 openInstallPageByUrl 一致。
* ✅ VSCode URL 断言改用会重试的 toHaveValue,不再撞上配置回填前的空窗
DevToolsSection 的输入框先以 useState("") 渲染,vscode_url 要等一次 service worker
往返才回填。inputValue() 是一次性读取,CI 慢机上会读到那段空窗——实测报的正是
Received string: "",不是值不对而是还没到。同文件另一处早已用 toHaveValue,这里对齐。
---------
Co-authored-by: cyfung1031 <44498510+cyfung1031@users.noreply.github.com>1 parent a51bec9 commit a8c92c1
86 files changed
Lines changed: 3606 additions & 374 deletions
File tree
- .github/ISSUE_TEMPLATE
- docs/references
- e2e
- scripts
- src
- app/service/service_worker
- locales
- de-DE
- en-US
- ja-JP
- ko-KR
- pt-BR
- ru-RU
- tr-TR
- vi-VN
- zh-CN
- zh-TW
- pages
- batchupdate
- components/ui
- confirm
- external_access_confirm
- install
- components
- options/routes
- Agent/Chat
- ScriptEditor
- popup
- store/features
- pkg/utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
65 | 74 | | |
66 | 75 | | |
67 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
65 | 74 | | |
66 | 75 | | |
67 | 76 | | |
| |||
0 commit comments