Skip to content

feat(web): separate platform runner bar from available runners - #1348

Merged
crispinhu27 merged 3 commits into
mainfrom
feat/runners-ui-layout
Nov 25, 2026
Merged

crispinhu27 merged 3 commits into
mainfrom
feat/runners-ui-layout

Conversation

@crispinhu27

Copy link
Copy Markdown
Collaborator

Summary

  • Split the platform cloud runner out of #runnersList into a dedicated 平台机器 (#platformRunnerSection / #platformRunnerHost) section above 可用机器, rendering it as a full-width horizontal strip with status, editable concurrency limit, and project-default toggle.
  • Keep #runnersList and #runnerCount strictly for bound/shared machines and align card action footers at the bottom of each grid row.
  • Update design.md, web/i18n-en.js, and webtest/tests/mcp-sops-runners.test.mjs to match the new layout.

Verification

  • npm --prefix webtest test (Node v22.23.2): 306 passed, 0 failed
  • node web/run_queue_test.js && node web/runner_default_rule_test.js: passed
  • bash scripts/build-chatbot.sh: 62 test files (531 tests) passed and rebuilt web/native-chat
  • go test ./web -count=1: passed
  • Headless Chromium check across 1440×900 (light & dark themes), 760×900, and 390×844 with zero horizontal overflow

@Robert0622 Robert0622 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR + 本机部署实测:LGTM ✅(head a692e95d)

代码审查:平台执行机器从 #runnersList 拆到独立的 #platformRunnerSection / #platformRunnerHost,并发上限输入框和项目默认按钮的事件绑定改成在 platformHost 和 list 两处都挂,焦点恢复和 refreshRunners 的轮询保护([data-platform-run-limit])在新位置仍然生效;#runnerCount 只统计可绑定/共享机器;「在此项目使用」统一改为「设为项目默认」,仓库里没有其他地方再引用旧文案或旧选择器。后端未改。

部署实测:本机部署 PR 二进制(MariaDB 新库、平台本地执行),另起一个 main 058a530b 的平台做对照。注册 2 台真实 agentflow-runner(dev-box-01 属于管理员,build-server-02 共享到项目),成员 B 以项目 member 角色登录。用 Chromium 跑了 72 项检查,全部通过:

  • 布局:「平台机器」分区位于「接入新机器」下方、「可用机器」上方;平台卡不在 #runnersList 里;#runnerCount = 2(管理员)/ 1(成员 B),和列表卡片数一致;绑定机器卡片的底部操作栏都对齐到卡片底部(main 上平台卡和机器卡底部差 132px)
  • 交互(管理员):并发上限改成 7 → PUT /api/runners/platform/run-limit 200,刷新后仍为 7;「设为项目默认」→ 显示「此项目默认」,按钮变为「清除项目默认」,/api/runners/default?projectId=demo 返回 projectRunnerMode=platform;再点「清除项目默认」恢复原状;绑定机器卡片的按钮也显示「设为项目默认」
  • 权限:成员 B 看到只读的「最多同时运行 7 条」,没有输入框
  • 响应式:1440 / 1024 / 760 / 600 / 390 / 360 宽度,亮色和暗色主题下页面都没有横向溢出;控件互不重叠、没有被截断、没有超出卡片;≤1024 宽时控件行换到下方;鼠标悬停 ? 时提示框在视口内
  • 边界:没有可用机器时,平台横条仍然显示,下方显示「还没有机器」,计数为 0;英文界面显示 Platform machine / Shared across all projects / Set as project default,没有截断
  • 本地把最新 main(78cdab43,含 #1342/#1343 对 index.html、i18n-en.js 的改动)合进来没有冲突,合并后 runners 相关 webtest 13/13 通过
  • npm --prefix webtest test 306/306、node web/run_queue_test.js、node web/runner_default_rule_test.js、go test ./web 都通过;控制台没有 pageerror

CI:core、browser、platform-required 失败的原因和 main 058a530b 自己的 platform 运行完全相同:sop_executors_test.go:446/531/556 not enough arguments(#1339/#1291 的问题,#1345 在修),以及 route coverage 85.0% 低于 85% 的门槛。本 PR 只改了前端,没有新增或删除路由,所以这两项都不是本 PR 引入的。

P3(不阻塞):开启「自动分配」后,状态行里的「在线可用机器数」仍然把平台机器算进去(runners.filter(...).length + (platform online ? 1 : 0)),而标题旁的 #runnerCount 现在不包含平台机器。比如本次实测里,标题显示「可用机器 2」,状态行却是 3 台在线可用。建议在文案里写明「含平台机器」,或者把两处口径统一。

截图(PR 管理员 1440 亮色 / 设为项目默认后 / 暗色 / 390 宽 / 成员 B 只读 / main 对照):

PR 1440 亮色
设为项目默认后
PR 1440 暗色
PR 390 宽
成员 B 只读上限
main 对照

@crispinhu27
crispinhu27 merged commit 832e2be into main Nov 25, 2026
16 checks passed
@crispinhu27
crispinhu27 deleted the feat/runners-ui-layout branch November 25, 2026 15:52
Robert0622 pushed a commit that referenced this pull request Nov 25, 2026
Four user-visible errors that arrived with main (#1342 work branch naming,
#1343/#1348 runner auto-assign, #1301 child artifacts) still said SOP.

Co-Authored-By: Claude Code <noreply@anthropic.com>
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.

2 participants