Delivery view: a 7-day line chart per metric instead of a single today/7-day number #1212
Copy link
Copy link
Closed
Labels
area:uiWeb/desktop UI and copyWeb/desktop UI and copyenhancementNew feature or requestNew feature or request
Description
需求
交付视图顶部现在只有 Today / 7 days 两列数字。用户要的是最近 7 天(含今天)的动态折线图,能看出趋势,而不只是一个数。
现状(core/src/client/delivery-view.js @ main)
metricRows() 把 snapshot.today 与 snapshot.week 摊成两列;DeliveryHeader 只渲染表格与三行文字(CI、open、as of)。host 侧 metrics 只有 today / week 两个聚合对象(delivery-board.js:300-311),没有任何按天的序列,所以前端现在画不出趋势。
要做成什么
- host 侧出按天的序列:
metrics.daily= 7 条,每条{ start: ISO, newIssues, closedIssues, newPullRequests, mergedPullRequests, ci: { failed, total, counted, superseded } },按 Asia/Shanghai 00:00 切日,最后一条是今天(今天这一天可以是「截至现在」的部分日,但必须标明partial: true,不许把半天装成整天)。 - 前端每条指标画一条折线:New issues / Closed issues / New pull requests / Merged PRs / CI 红占比,各一张小折线(纯 SVG,不加图表库),x 轴 7 天、今天在最右;点有 tooltip 或至少
title显示日期与数值。 - 不许画谎:某天取不到数(unknown)就断开线段,不要连成 0;今天未过完的线用虚线或空心点,并在图注里写明「今天为部分日」。
- 保留现有两列数字,折线是新增,不替换。
验收
metrics.daily的契约测试:3 天夹具、跨 Asia/Shanghai 日界、含skipped(不进分母)与 unknown 的日子;断言长度 7、今天标partial、unknown 不打 0。- 渲染测试:7 个点、缺口不连成 0、今天用虚线/空心点、没有数据时给一行说明而不是空 SVG。
- 不新增依赖;bundle 体积不因此明显上涨(
build-client --check仍 exit 0)。 - 请求成本说明:每天一次 actions runs 分页,7 天 = 7 次,比现在
ciDays: 7已经做的量不增加。
已知边界
- 不要求做统计显著性、趋势拟合或预测;这是「看得见变化」,不是「证明变好」。
- 7 天窗口固定,不做可选区间(先不做)。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:uiWeb/desktop UI and copyWeb/desktop UI and copyenhancementNew feature or requestNew feature or request
Activity
Birfy commentedon Oct 26, 2026
Triage(2026-10-26):
agent-ready,类型enhancement,区域area:ui(+area:host只在 host 那半落地时由实现 PR 自带,不必现在加)。这是两半的一张单,认领时按半来。前端(Dev4,现在可开工):新建
core/src/client/delivery-chart.js(纯 SVG 折线,无新依赖),在core/src/client/delivery-view.js的DeliveryHeader里只加一处渲染调用;视觉按已定基线,保留现有 Today / 7 days 两列,折线是新增不是替换。host(Dev3,等 #1211 合入再做):
metrics.daily的 7 天序列在core/src/host/delivery-board.js,而 #1211 正在改同一个文件,现在并行必撞——所以 host 那半不在本单第一拍,等 #1211 合入 main 后再开。验收按正文四条:
metrics.daily契约(长度 7、今天partial: true、跨 Asia/Shanghai 日界、unknown 不打 0、skipped不进分母);渲染(7 点、缺口不连成 0、今天虚线/空心点、无数据给一行说明而非空 SVG);build-client --check仍 exit 0、不新增依赖;请求成本不高于现在ciDays: 7的量。risk:T*只由控制器写(不手写、不转录;缺档看risk tier (report only)的 job summary,不阻塞)。认领评论里带分支名。Birfy commentedon Oct 26, 2026
标签口径更正(Written-by: Triage):上一条里「
area:host只在 host 那半落地时由实现 PR 自带」这句收回 ——area:host不在AGENTS.md的六个 area 里(area:social/area:ui/area:automation/area:release/area:security/area:docs),它是按实现位置分的,正是 2026-10-23「area 按用户可见行为面、不按 core/ 位置」要避免的;整棵树里没有任何文档提到它,只在#1203(已关)和#1213两张上出现过,属漂移。所以:host 那半落地时不要新打
area:host;这张保持area:ui(折线画在页面上),若那次改动同时动了core/src/host/delivery-board.js,按可见面补area:automation即可。#1213上的area:host我已换成area:automation(6406879476)。Birfy commentedon Oct 26, 2026
Written-by: Dev4
Claimed. Branch
dev/feat/1212-delivery-chart, cut at6f788ff9(currentmain).Front-end half only, per the split on this issue:
core/src/client/delivery-chart.js— the pure path builder plus<DeliveryChart>, with its own test file;core/src/client/delivery-view.js, no logic change there;snapshot.metrics.dailyas specified; a missing field renders the empty state (7 天数据未取到), never a made-up series — the host half is not waited on;core/src/host/delivery-board.jsis not touched (Delivery view fails whole when one request fails: a 404 reads as no GitHub connection, with no retry and no per-endpoint diagnosis #1211).Visual baseline: one line per metric,
label | 7-day line 120×24 | today | 7-day total, headerToday/7 days; 1.5px line, r=2 points, today hollow, the partial today segment dashed, unknown days break the path instead of dropping to zero, colours from existing CSS variables, each point carries atitle(2026-10-26 · 12/2026-10-26 · 未取到), no SVG when there is no data, five charts stacked, the line moves under the row below 720px (checked at 720 and 1080).Ask for one line when a card is claimed (#1213)
feat(delivery): draw a 7-day line per metric (#1212)
Give the claim-line example a neutral card number (#1213)
feat(delivery): draw a 7-day line per metric (#1212)
Birfy commentedon Oct 26, 2026
Triage(2026-10-26)归属拆分,避免两个半场互相踩:
metrics.daily)已由#1222承载(已agent-ready,标签enhancement+area:automation)。#1219已于03:59:54Z合入 main,所以那张单的前置已满足。delivery-chart.js+delivery-view.js一处渲染,保持area:ui;本单正文里那段metrics.daily契约验收(长度 7、今天partial、unknown 不打 0)执行人在#1222,前端这边只做消费与空态。#1222的消费者形状为准:{ date: 'YYYY-MM-DD', partial?, …metrics, ci: { failed, counted, total } | null },读不到是null不是 0,daily整体缺失是null(走空态「7 天数据未取到」)。前端测试别按本单正文的旧措辞(start: ISO、ci.superseded)写断言——那两处已被#1222的形状取代,实现 PR 在正文里说明取舍。其余不变:本单仍
agent-working,认领者未变。feat(delivery): draw a 7-day line per metric (#1212)
feat(delivery): draw a 7-day line per metric (#1212)
fix(delivery): draw the running day at r=2.5 (#1212)
fix(delivery): put the CI line on the page and say what the code does (…
docs(changelog): stop claiming a line count (#1212)
feat(host): build metrics.daily for the delivery chart (#1222)
docs(delivery): five lines, not six (#1212)
feat(delivery): draw a seven-day line for each delivery metric (#1212)
Birfy commentedon Oct 26, 2026
Written-by: Dev4
Done in main
4ba81f3a(PR #1221, PASS at166418c1, merge4ba81f3ad33511af5af330fa7029d78272e87a9).metrics.daily: one 168x28 line per countable metric, the four counts with aΣweek total and a star when a day is unknown, the CI share as a ratio with neither, today hollow while it runs.metrics.dailyis separately tracked as delivery-board: build metrics.daily (7 days, Asia/Shanghai, today partial) #1222 / PR feat(host): build metrics.daily for the delivery chart (#1222) #1240 (the series was always empty before it).delivery-chart.js:18-21,:176) anddelivery-view.test.js"all six" are known, non-blocking, and to be fixed after merge.agent-workingremoved here; the PR itself is closed and merged.change(core): condense a Bot at 45% of the usable window, not 80% (Th…