✨ feat(vscode): 看板默认显示团队工单,同事的卡只读并贴头像
看板范围默认从「只看我的」改为「团队全部」,同事移交或推进的工单不用 手动切开关就能看见。同事的卡片按 Gitea 归属(assignee 优先,无 assignee 退回创建者)判定为只读:禁止拖列、开会话、实施、合并分支、删 worktree、 删改工单,卡片右上角贴归属人头像,详情面板属性表整体消毒并显示只读徽章。 看 PR 改动、勾已查看、生成文件摘要属于本机审查动作,照常放行。 扩展侧在消息分发前统一拦截需要归属人身份的消息,兜住前端快照过期或工单 刚被重新指派的竞态;webhook 单卡上板时同步归属,避免增量卡漏进门禁。 头像由扩展侧带 token 抓回转 data URI 下发,绕开 webview CSP 对外链图片 的限制,按 URL 进程内缓存。 Claude-Session: https://claude.ai/code/session_01KSgcQwf1mWrb8qeTKFvJbV
This commit is contained in:
1 parent
e8963ac2a2
commit
9167b86708
26 files changed
+550
-34
No files matched your search
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* 工单归属判定(扩展侧 `src/panel/issueOwnership.ts` 的镜像,两个包不共享
|
||||
* 源码,改一处要同步另一处)。
|
||||
*
|
||||
* 看板范围切到「团队全部」后同事的工单也会上板,这类卡片只读:不能拖列、
|
||||
* 不能开会话、不能合并或删除,只保留查看与接管。
|
||||
*/
|
||||
|
||||
import type { Issue } from '../types'
|
||||
|
||||
type OwnershipFacts = Pick<Issue, 'poster' | 'assignees'>
|
||||
|
||||
/** 该工单是否归当前登录者所有(可写)。身份未知时一律放行,不锁死自己的板。 */
|
||||
export function isIssueMine(issue: OwnershipFacts, me: string | undefined): boolean {
|
||||
if (me === undefined)
|
||||
return true
|
||||
const assignees = issue.assignees ?? []
|
||||
if (assignees.length > 0)
|
||||
return assignees.includes(me)
|
||||
return issue.poster === undefined || issue.poster === me
|
||||
}
|
||||
|
||||
/** 卡片头像取谁:assignee 优先(责任人),否则创建者。 */
|
||||
export function issueOwnerLogin(issue: OwnershipFacts): string | undefined {
|
||||
return (issue.assignees ?? [])[0] ?? issue.poster
|
||||
}
|
||||
Reference in new issue
Block a user