Skip to content

项目看板:7 个指标卡 + 在跑任务表 #1829

Closed

Description

@Birfy

Written-by: Chief

项目看板顶部先给 7 个指标,下面是在跑任务表(名称 / 状态 / 谁在做 / 做了多久 / 来源)。

出处:#1550 的 Stage 2「Project as the work and knowledge boundary」,本轮由 owner 直接提出(2026-10-30)。

指标口径(定死)

  1. 今日新开 PR / 今日合入 PR / 今日新开 issue / 今日关闭 issue —— 用户时区自然日,按 created_at / merged_at / closed_at。
  2. PR 合入时长、issue 关闭时长、task 完成时长 —— 近 7 天中位数。
  3. 缺凭据或读失败显示 — 并注明数据源不可用,不显示 0;缓存 5 分钟。

要做的

  1. host 新增聚合端点 project-metrics(GitHub REST + 本地 tasks),带 5 分钟缓存与失败降级。
  2. 看板顶部指标区渲染 7 张卡,每张带一行口径小字。
  3. 中部在跑任务表:任务名 · 状态 · 谁在做(Bot/角色)· 已做多久(claim 起算)· 来源(bot/group/workflow)· 最近活动;超时行加标记;点行回到原面板;空状态一行提示。
  4. 原 Waiting / In flight / Blocked 三栏收成一行计数。

验收

  • 指标数与 GitHub 实际对得上(PR 附取数命令),无凭据显示 —。
  • 在跑任务表每行四要素齐,点行能到原面板。
  • npm run verify 绿;测试覆盖时区边界、除零、缓存命中。

口径文件:docs/project-board-rework.md §3。

Activity

  1. added
    enhancementNew feature or request
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:uiWeb/desktop UI and copy
    on Oct 30, 2026
  2. Birfy commented on Oct 30, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    分诊:agent-ready(创建时已带,标签不变)。口径以本单正文为准——正文引用的 docs/project-board-rework.md §3 在 main 上不存在(contents API 404,tree 也无同名路径),实现按正文那 7 条口径走,不要等这份文件。

    要改的文件

    • core/src/host/project-board.js:新增 project-metrics 聚合读模型(GitHub REST GET + 本地 tasks),5 分钟缓存;无凭据/读失败返回 unavailable,UI 显示 —,绝不 0。
    • core/src/client/project-board.js:顶部 7 张指标卡(每卡一行口径小字);中部在跑任务表(任务名 · 状态 · 谁在做 · 已做多久从 claim 起算 · 来源 bot|group|workflow · 最近活动;超时行加标记;点行走已有 onOpen;空状态一行);原 Waiting / In flight / Blocked 三栏收成一行计数。
    • core/src/client/i18n.js:en/zh 新键。
    • docs/subsystems/core-host.md、docs/subsystems/core-client.md(arch-docs owned_paths),或两处都带 Docs-not-needed:。

    测试(红先写)

    • core/test/project-metrics.test.js:用户时区自然日边界(跨 UTC 0 点)、除零(窗口 0 条 → — 不是 0/NaN)、缓存命中(5 分钟内只打一次源)、读失败 → unavailable、无 token → unavailable。
    • core/test/project-board-view.test.js:7 卡渲染与每卡口径小字、表格五要素、超时标记、空状态一行、点行回调、三栏合并成一行计数。
    • core/test/i18n.test.js:新键在 zh 绑定后不回落英文。

    验收

    • PR 正文附取数命令 + 一次真实数字对账(GitHub 上的计数 vs 卡上数字)。
    • TZ=UTC npm run verify 绿;撤掉源改动后新增测试变红。
    • 风险档:T2(新增 host 端点 + client 渲染;GitHub REST 复用现有 token 读取路径,不新增权限面)。
  3. self-assigned this
    on Oct 30, 2026
  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 30, 2026
  5. Birfy commented on Oct 30, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev

    Claimed #1829 — branch dev/1829-project-metrics, first step: the host project-metrics aggregation with a 5-minute cache and unavailable fallback.

  6. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 30, 2026
  7. Birfy commented on Oct 30, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev

    Tip pushed: 073e6f11d0a27d9b18f5f6f026bc5356a7c31ae9 on dev/1829-project-metrics, PR #1835.

    Host half done: seven metrics, five-minute cache, ok: false + null degradation, day boundary in the reader zone, runningOf projection. 9/9 new unit tests green; ds-bot-patches check green.

    Still open on the same branch: the client render (seven cards + running table + one count line for Waiting/In flight/Blocked), the en/zh keys, and the view/i18n test cases. The PR checkpoint names it as next.

  8. Birfy commented on Oct 30, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev

    Branch moved to caa61c327b2f31db3a91445e203d6862983ce9e2 (PR #1835); the earlier note about the client half being open is superseded.

    Now in the branch: seven captioned cards + the running table (overdue mark, click through onOpen, one empty line), client.js rebuilt, zh entries for the new copy, 0001/0008 patch sections regenerated, ds-bot-patches check green, and node --test test/i18n.test.js test/project-metrics.test.js test/project-board-view.test.js green (28 tests, 0 fail). Waiting on CI at the tip.

  9. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 30, 2026
  10. added a commit that references this issue on Oct 30, 2026
    b4e05ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uiWeb/desktop UI and copyenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions