✨ feat(vscode): 同事改工单所在列、开关工单时,本机看板实时跟着动
此前只有新建工单、改标题、改指派会实时上卡;列变化存在 state JSON 评论里, 而 issue_comment 处理只认带 spx:review 标识的审查评论,别人拖卡这边毫无反应, issues closed/reopened 也没接。抽出 refreshIssueCard 作为统一刷卡入口:重拉 该工单、叠加本机运行态、按 mine 可见性门禁决定上卡还是撤卡,只刷 UI,不写 远端状态也不起会话,观察者机器执行同样安全。state 评论(解析出 column)与 工单开关都接到这个入口上。
This commit is contained in:
1 parent
6603e76fe1
commit
fb122b76ce
3 files changed
+105
-17
No files matched your search
@@ -43,6 +43,15 @@ function parseStateComment(body: string | undefined | null): Record<string, unkn
|
||||
return hasKnownField ? obj : null
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论是否是一条带 `column` 的 state JSON——即「这张卡换列了」的信号。
|
||||
* webhook 收到这种评论时据此刷新对应卡片。
|
||||
*/
|
||||
export function hasStateColumn(body: string | undefined | null): boolean {
|
||||
const parsed = parseStateComment(body)
|
||||
return parsed !== null && 'column' in parsed
|
||||
}
|
||||
|
||||
/**
|
||||
* 从尾往前找最近一条 state JSON comment,返回解析结果;找不到返回 null。
|
||||
* 跳过中途插入的普通文本/JSON 内容评论,从而不丢失历史状态。
|
||||
|
||||
Reference in new issue
Block a user