Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions design.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ Logo 默认 64px,小屏或短屏为 52px;标题为 36px,小屏为 30px。

行首图标块为中性灰:SOP 运行用 `workflow`,自由协作(`collaborationMode==='group'`)用 `chat`;自由协作行的进度显示「—」,不显示耗时。查看(`eye`)和删除(`trash`)图标按钮在悬停或键盘聚焦到行时显示,删除悬停变红;不可删除的行不输出删除按钮也不留占位。整行点击或按 Enter 进入详情。列表周期刷新时保留行或按钮上的键盘焦点。

### 节点当前活动

运行详情中,选中节点实际执行时,状态文字旁显示转圈,当前活动文字以约 2.4 秒一轮从左向右扫过高光。标签、模型信息与布局保持静止;实时日志只更新文本与状态类,避免重建元素打断动效。已完成、失败、取消、暂停、等待人工确认及子 SOP 待确认时均为静态。明暗主题沿用 Harness 文字令牌,长活动文字省略;减少动态效果或强制颜色模式下关闭两种动画,保留可读文字与静态状态图形。

## Bot 管理

Bot 管理页(`#botsView`)按需求列表与运行记录列表的 Harness 先例绘制,接口、权限、三步引导和表单字段不变。令牌与共享组件见「设计规范」;动效只引用 `--bot-*` 时长与曲线令牌,曲线不在令牌以外重复声明。
Expand Down
Binary file added docs/assets/node-activity-live-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/node-activity-live-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions docs/node-activity-validation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Node activity UI acceptance

This evidence uses the real platform built from the animation contribution,
a dedicated local test installation, a password session and a synthetic shell
SOP. No model service, production run or organization data is involved.

## Asset cache upgrade

The literal query in `web/index.html` is not the URL sent to a browser.
`studioFileServer` calls `stampStudioIndex` on each HTML request. Every CSS and
JavaScript reference is rewritten with the first eight bytes of the asset's
SHA-256 hash. HTML is served with `Cache-Control: no-cache`; the resulting
versioned assets use `public, max-age=31536000, immutable`.

The Chromium check kept the same browser context and its HTTP cache enabled:

1. A same-origin HTTP proxy presented the prior stylesheet and its content-hash
URL while forwarding authentication, run APIs, streaming and other assets to
the real platform. The baseline was the stylesheet before this contribution.
2. A second normal document navigation reused that old stylesheet. Chromium's
DevTools Protocol reported a cache hit; the proxy received only one request
for the old asset across both navigations.
3. The proxy then forwarded the platform's current HTML unchanged. A normal
navigation fetched the new stylesheet URL, and the existing cached stylesheet
did not prevent either animation from appearing. No cache clear, hard refresh,
Playwright request routing or mocked run response was used.

| Asset | Served URL | Network requests |
| --- | --- | --- |
| Previous CSS | `/observability.css?v=b5623289d4bd5745` | 1, then reused from cache |
| Animation CSS | `/observability.css?v=e10036f176cdcba1` | 1 after the upgrade |

The stylesheet hash follows its bytes and will change with later edits. The
handwritten `v=20261031metrics2` was unchanged throughout this check. Regression
tests in `internal/httpapi/studio_test.go` also verify that changing only CSS
changes the served URL without editing HTML or recreating the handler.

## Real-service visual checks

The selected node came from a real running shell SOP. Computed styles and timed
samples confirmed spinner rotation and moving text highlights in both themes.
Reduced-motion preferences disabled both animations. The inspector was also
checked at a 390px viewport, and requesting cancellation stopped its animations
through the real run update path.

The following screenshots are fresh captures of that live inspector. They are
cropped to exclude unrelated installation controls and are static images of the
animated states.

Light theme:

![Live node activity in the light theme](assets/node-activity-live-light.png)

Dark theme:

![Live node activity in the dark theme](assets/node-activity-live-dark.png)

Validation completed on 2026-11-11: the ten node-inspector tests, the stylesheet
hash/upgrade and cache-header Go tests, JavaScript syntax checks, and the live
Chromium checks described above passed. These checks do not claim approval on
behalf of a maintainer or execution of the entire deployed acceptance suite.
45 changes: 45 additions & 0 deletions internal/httpapi/studio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"path/filepath"
"strings"
"testing"
"testing/fstest"

"agentflow/internal/engine"
"agentflow/internal/repo"
Expand Down Expand Up @@ -50,6 +51,50 @@ func TestStudioIndexStampsAssetsWithContentHash(t *testing.T) {
if strings.Contains(html, "/app.js?v=20260820s6") || strings.Contains(html, "/app.js?v=20260820s5") {
t.Fatal("hand-edited cache-bust versions should be replaced")
}
css, err := fs.ReadFile(static, "observability.css")
if err != nil {
t.Fatal(err)
}
cssHash := sha256.Sum256(css)
if want := `/observability.css?v=` + hex.EncodeToString(cssHash[:8]) + `"`; !strings.Contains(html, want) {
t.Fatalf("served index must use the activity stylesheet's content hash: want %s, got %s", want, snippet(html, "observability.css"))
}
}

func TestStudioStylesheetChangesInvalidateURLWithoutEditingIndex(t *testing.T) {
const index = `<html><head><link rel="stylesheet" href="/observability.css?v=20261031metrics2"></head></html>`
static := fstest.MapFS{
"index.html": {Data: []byte(index)},
"observability.css": {Data: []byte(`.node-activity-inline{color:gray}`)},
}
h := studioFileServer(static)
previousURL := ""
for _, css := range []string{
`.node-activity-inline{color:gray}`,
`.node-activity-inline.is-running{animation:shimmer 2.4s infinite}`,
} {
// The deployment changes only the stylesheet; keep the same HTML and handler.
static["observability.css"].Data = []byte(css)
sum := sha256.Sum256([]byte(css))
url := "/observability.css?v=" + hex.EncodeToString(sum[:8])
rec := httptest.NewRecorder()
h.ServeHTTP(rec, httptest.NewRequest(http.MethodGet, "/", nil))
if rec.Code != http.StatusOK || rec.Header().Get("Cache-Control") != "no-cache" {
t.Fatalf("index must be revalidated: status=%d cache=%q", rec.Code, rec.Header().Get("Cache-Control"))
}
if !strings.Contains(rec.Body.String(), `href="`+url+`"`) || strings.Contains(rec.Body.String(), "20261031metrics2") {
t.Fatalf("handwritten version must be replaced by the current stylesheet hash: %s", rec.Body.String())
}
if url == previousURL {
t.Fatal("changed stylesheet reused its immutable URL")
}
asset := httptest.NewRecorder()
h.ServeHTTP(asset, httptest.NewRequest(http.MethodGet, url, nil))
if asset.Code != http.StatusOK || asset.Body.String() != css {
t.Fatalf("stamped URL must serve the matching stylesheet: status=%d body=%q", asset.Code, asset.Body.String())
}
previousURL = url
}
}

func TestStudioVscodePageStampsAssetsWithContentHash(t *testing.T) {
Expand Down
Loading
Loading