Skip to content

fix(dashboard): 定时任务展示目标群聊 - #802

Merged
deepcoldy merged 3 commits into
deepcoldy:masterfrom
Forgethson:codex/show-schedule-target-chat
Aug 10, 2026
Merged

fix(dashboard): 定时任务展示目标群聊#802
deepcoldy merged 3 commits into
deepcoldy:masterfrom
Forgethson:codex/show-schedule-target-chat

Conversation

@Forgethson

@Forgethson Forgethson commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

改动

  • 在定时任务卡片展示目标群聊名称;群名尚未解析时回退显示 chat ID。
  • 编辑任务时只读展示目标群聊,避免误以为可修改任务绑定。
  • 页面加载后刷新群聊名称映射;超长群名使用省略展示,避免挤压右侧操作按钮。

原因

定时任务此前仅显示 Bot AppID 与执行位置,无法在控制台确认任务实际投递到哪个群聊。

UI 截图

clipboard

影响面

仅 Dashboard 定时任务列表和编辑态展示;不改变任务创建、调度、投递或 PATCH 的数据语义。

实际验证

  • pnpm vitest run --project unit test/dashboard-schedules-ui.test.ts
  • pnpm tsc --noEmit
  • pnpm dashboard:bundle
  • 1280×720 本机 mock 页面:长群名省略展示,右侧“立即运行 / 启用 / 编辑 / 删除”按钮无重叠。

@Forgethson
Forgethson requested a review from deepcoldy as a code owner August 9, 2026 12:33
@Forgethson Forgethson changed the title Codex/show schedule target chat fix(dashboard): show schedule target chat Aug 9, 2026

@deepcoldy deepcoldy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

检查结论:核心数据流正确,但发现 1 个需修的 UI 边界,修复前不建议合并。

已核对:

  • 编辑态只读语义正确:前端 PATCH payload 不包含 chatId/larkAppId,daemon PATCH 也只处理可编辑字段。
  • 群名异步时机正确:延迟 /api/groups 的浏览器验证确认先显示 chatId,映射完成后列表与已打开弹窗都会重绘成群名;加载失败仍能回退 chatId。
  • 匿名只读面没有新增数据边界:schedule 的 chatId 与 groups 的 name 原本已在公开只读响应中保留。
  • pnpm build 通过;dashboard-schedules-ui + dashboard-public-redact 共 28/28 通过。
  • 全量单测为 14311 passed / 3 failed / 1 suite hook timeout;其中两个持续失败的集成测试在当前 origin/master 上可同样复现,hook timeout 单文件重跑通过,因此不是本 PR 引入的回归。

合并前还需按仓库规范补齐:中文 PR 标题与中文说明(改动、原因、影响面、实际验证),以及 UI 截图;当前两个 commit 的冒号后描述也仍为英文。

Comment thread src/dashboard/web/schedules-page.tsx Outdated
</div>
<div className="schedule-chip-strip">
<span>{kind}</span>
{s.chatId ? <span title={String(s.chatId)}>{tr('schedules.form.chat')}: {chatTitle ?? s.chatId}</span> : null}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

[P2] 长群名会覆盖右侧操作按钮。这里沿用 .schedule-chip-strip spanflex: none + white-space: nowrap,但新增内容没有任何宽度上限。仓库建群输入允许 60 字;浏览器用 51 字群名、1280×720 视口复现时,chat chip 的横向范围是 x=278–939,而 Run Now 是 x=857–949,二者真实重叠。建议给该 chip 单独加 class,并设置 max-widthoverflow: hiddentext-overflow: ellipsis;tooltip 同时保留完整群名和 chatId,另补一个长名称布局回归验证。

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

增量验证通过(63a0487),该 P2 已修复。

  • 新规则位于基础 .schedule-chip-strip span 之后且选择器更具体,声明的 inline-block 会覆盖 inline-flex。在 flex item 上浏览器会将其计算为 block,但关键是内容不再按 inline-flex 布局;配合受限宽度、overflow: hiddenwhite-space: nowrap,实际已渲染省略号。
  • 浏览器实测 1280×720:中文 47/60 字、ASCII 51 字三种群名均为 320px,scrollWidth > clientWidth,与右侧操作区无重叠;1100×720 响应式布局下同样不溢出容器、不重叠。
  • tooltip 均保留完整群名与 chatId;无群名映射时只显示原始 chatId,没有重复。
  • 新规则插在 .schedule-error-chip 之前,没有破坏 error-chip 紧邻 .schedule-row-head .schedule-state 的既有结构断言。
  • pnpm exec tsc --noEmitpnpm build 通过;dashboard-schedules-ui + dashboard-public-redact 为 29/29 通过。

未发现新的代码问题。合并前仍需按仓库规范补齐中文 PR 标题、中文说明与 UI 截图;未执行合并。

新增的「目标群聊」chip 继承 .schedule-chip-strip span 的 flex:none + white-space:nowrap
但没有宽度上限。仓库建群名允许 60 字,较长的中文群名(实测 ~47 字即触发)会让 chip
在 1280px 视口下越过主列、压到 Run/Edit/Delete 按钮上。

- 给 chip 单独加 .schedule-chat-chip:display:inline-block(base 的 inline-flex 不出
  省略号)+ max-width:min(320px,100%) + overflow:hidden + text-overflow:ellipsis
- title 同时保留完整群名与 chatId,截断后信息不丢
- 补真实浏览器无重叠回归验证(见 PR 说明)

Co-authored-by: 申晗 <deepcoldy@gmail.com>
@Forgethson Forgethson changed the title fix(dashboard): show schedule target chat fix(dashboard): 定时任务展示目标群聊 Aug 10, 2026
@deepcoldy
deepcoldy merged commit 31a7126 into deepcoldy:master Aug 10, 2026
@github-actions

Copy link
Copy Markdown

🚀 Released in v3.12.0

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