fix: 上架前审查修复(1-4 号 bug + 优化) - #1
Draft
patrick-eu wants to merge 15 commits into
Draft
patrick-eu wants to merge 15 commits into
patrick-eu wants to merge 15 commits into
Conversation
…ish locale URL prefix
…prefix URLs (/it /zh /zh-hant)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, instant abort, honest summary
系统化调试逐个定位真因并修复: - bin 行定位:选择器 a[data-id] 匹配 0 个 → 改按标题内容回溯含 Buy 按钮的行容器(排除插件自身面板) - 不弹签名:data-three-dee 动画按钮的下单逻辑绑在 pointer 事件,.click() 不触发 → 改用完整 pointer/mouse 序列 realClick - 多笔只弹第一个:份额清空是点击即触发的乐观重置(假信号)→ 改用按钮「Placing」状态结束作为完成信号,逐笔等待 - 换批次价格框找不到:placeholder 在 0.0¢/0¢ 间浮动 → 改 ¢ 子串匹配;价格/份额/按钮查找统一加 waitEl 轮询等渲染 - UI:等签名/进度/完成/错误状态框统一为确认卡片样式(pb-ov-title),错误态用 pb-loss 红色 清理全部临时诊断日志;node --check + clob/cost 单测通过。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
下单本就是驱动 Polymarket 自己的 UI、由其连接的钱包签名,无 MetaMask 专属逻辑。 本次改动让它对所有账户类型稳定工作: - 完成信号改用「成交 toast(Buy Yes/No placed)」替代按钮 Placing 状态——与签名方式无关, MetaMask(弹窗数秒)和 Magic(无签名瞬时)都覆盖;用 MutationObserver 在点击前 arm,避免瞬时 toast 漏检 - 解决即时钱包(Magic)连续下单时第二笔按钮禁用:post-order 重渲染令 React 受控态与 DOM 脱节, 周期性重填价/量戳 React 重新校验解锁 - UI 文案去 MetaMask 化("请在钱包中签名…" / "X 笔已提交") node --check + clob/cost 单测通过。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
同步:zip 里的最新源码(worstFillCents 吃穿盘口限价、工具栏开关 bg.js、 donate 页、图标)此前未入库,先同步回仓库,补齐 worstFillCents 测试。 修复: - 面板销毁(切路由/切语言)时中止进行中的批量下单,防止无 UI 后台继续下单 - 份额输入校验:0/负数/非数不再进入计价与下单流程 - bin 标题/确认清单/slug 改用 textContent,远程数据不进 innerHTML - 非英文界面在确认弹窗提示成交无法自动检测(toast 仅匹配英文文案) 优化: - 删除未使用的 host_permissions(content script fetch 走页面 CORS,已实测两 API 均放行) - recompute 各腿盘口并行拉取,不再串行等网络 - 工具栏 tooltip 改英文 重新打包 polybatch-ext.zip。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
从 Polymarket 前端 bundle 查证(generateToastTitleFromOrderCreation):
成交 toast 是硬编码英文模板 `${Side} ${Outcome} placed`、不走 i18n,
/zh/ 等本地化页面加载的 chunk 与英文页完全相同。即现有
/buy (yes|no) placed/ 匹配在所有语言前缀下都能自动确认成交,
「非英文界面每笔等超时」的前提不成立。
据此删除 nonEnWarn 警告与 pageIsEnglish(),查证结论与「正则须保持
严格邻接(防误匹配失败 toast)」写入 armFillWatcher 注释。重打 zip。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
背景
上架前代码审查发现 zip 提交物比仓库源码新(worstFillCents / bg.js / donate 页未入库),且存在 4 个 bug 与若干可优化点。本 PR 先同步源码,再修复与优化。
源码同步
worstFillCents(按份额吃穿盘口挂限价)、工具栏开关bg.js、donate.html/js、图标、二维码cost.test.js从已删除的bestAskCents切换到worstFillCents,补 8 条用例(一档内/恰好一档/跨档/深度不足/0.1¢ 精度/size=0 过滤/空簿/null)Bug 修复
destroy()(切路由/切语言触发)现在会置_abort,中止进行中的批量下单——此前面板被销毁后下单循环仍在无 UI 状态下继续点页面按钮textContent,远程/URL 数据不再进innerHTML(也是商店审核关注点)${Side} ${Outcome} placed、不走 i18n,本地化页面加载的 chunk 与英文页完全相同,即现有匹配在所有语言前缀下都有效,无需任何降级提示。查证结论与「正则须保持严格邻接、防误匹配失败 toast」已写入armFillWatcher注释(40a7603)优化
host_permissions(content script fetch 走页面 CORS;已实测 gamma-api 放行 polymarket.com、clob 为*;bg.js 不发请求)→ 减少商店权限审查recompute各腿盘口并行拉取(原为逐腿串行 await)验证
node clob.test.js/node cost.test.jsPASSnode --check全部 JS 通过,manifest JSON 校验通过polybatch-ext.zip已用修复后源码重新打包(13 个文件与仓库一一对应)🤖 Generated with Claude Code