8000 test(browser): bring the dedicated browser scripts back in line with the app by InfinityPacer · Pull Request #66 · InfinityPacer/meterleaf · GitHub
[go: up one dir, main page]

Skip to content

test(browser): bring the dedicated browser scripts back in line with the app - #66

Merged
InfinityPacer merged 1 commit into
mainfrom
fix/browser-scripts
Oct 31, 2026
Merged

InfinityPacer merged 1 commit into
mainfrom
fix/browser-scripts

Conversation

@InfinityPacer
Copy link
Copy Markdown
Owner

问题

overview-account-usage、quota-pwa-layout、mobile-app、quota-estimate 四个专项浏览器脚本在 main 上都跑不通。产品本身没有问题,是脚本的预期落后于后来的界面和算法改动,改界面时没法再靠它们发现回归。

原因与改动

  • 总览账户用量:Tokens 数字改成了两位小数(8.40K、129.60K、50.00M),预期同步更新。
  • 额度布局:页面会读 /api/accounts/merge,脚本没有模拟这个接口,读回别的数据后页面报错、卡片不渲染。补上合并状态的模拟返回。
  • 手机端排序:拖放库播报拿起后才开始监听方向键,原来的 30 毫秒等待有时会让方向键被忽略。改成等读屏播报确认拿起,然后按方向键,直到播报确认移动。被忽略的按键不会移动账户,所以重按是安全的。
  • 额度预估:两次算法改动后脚本没跟着改。
    • 0.9.7 起,预估等于已花费用加上剩余比例乘以整周外推值。API 断言改用已有的 fullWeekEstimate 反推外推值,页面金额按同一公式算出。
    • 0.9.6 起,粗估和多段估算把四舍五入的百分比按首次到达点校正。早期粗估和多段中位数改成按校正后的点推导的值,推导过程写在注释里,没有照抄实测数字。
  • AGENTS.md 写明专项脚本需要演示后端和 bun run dev 页面,免得再把环境没搭好误判成脚本失效。

验证

  • 演示后端加开发页面,用共享调试浏览器运行。四个脚本全部通过,mobile-app 连续 5 次通过,主冒烟脚本 bun run test:browser 也通过。
  • 只改了测试和说明,不影响镜像与采集器,不升版本。

🤖 Generated with Claude Code

…the app

Four dedicated browser scripts had drifted from the app. Token counts now
render with two decimals, the merge endpoint needs a fixture, the weekly
estimate converges to actual spend and corrects rounded percent arrivals,
and the drag library ignores an arrow key pressed right after pickup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@InfinityPacer
InfinityPacer merged commit 1995e9b into main Oct 31, 2026
2 checks passed
@InfinityPacer
InfinityPacer deleted the fix/browser-scripts branch October 31, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0