✨ feat(vscode): 多人协作二期:状态分层/写校验/签名/团队视图

- 本机状态(会话id/worktree/profile/prDiffFile)迁 workspaceState,
  共享 state JSON 只留团队字段;读侧本地记录叠加,旧数据兜底
- mergeStateJsonComment 写后读回校验,并发覆盖时在最新状态上重放一次
- webhook 支持 Gitea secret,校验 X-Gitea-Signature(HMAC-SHA256),
  不匹配 401;设置面板新增 Webhook Secret 字段
- 看板新增 我的/全部 范围切换(团队视图),按工作区持久化
This commit is contained in:
cruldra committed 2026-08-19 00:32:06 +08:00
1 parent c370214d12
commit faf227412e
18 files changed
+665 -202

No files matched your search

@@ -1,49 +1,72 @@
import { GitCommit, GitMerge, ListPlus, Loader2, Lock, RefreshCw, Settings, Unlock } from 'lucide-react'
import { GitCommit, GitMerge, ListPlus, Loader2, Lock, RefreshCw, Settings, Unlock, User, Users } from 'lucide-react'
interface Props {
onRefresh: () => void
/** 看板范围:'mine' 只看我的(assigned/created),'all' 团队全部工单。 */
scope: 'mine' | 'all'
onToggleScope: () => void
onEditAuth: () => void
commitRunning: boolean
/** Whether the workspace git working tree has uncommitted changes. The
/**
* Whether the workspace git working tree has uncommitted changes. The
* commit button is only rendered when this is true (or `commitRunning` is
* true — we keep it visible mid-run so the spinner stays on screen even
* if `cc` clears the tree before finishing). */
* if `cc` clears the tree before finishing).
*/
hasChanges: boolean
onCommit: () => void
/** Commits the remote auto-build branch is behind the remote dev branch.
/**
* Commits the remote auto-build branch is behind the remote dev branch.
* Combined with `branchSyncDisabled` to compute the button's disabled
* state. */
* state.
*/
branchSyncBehind: number
branchSyncRunning: boolean
/** True when sync is structurally unavailable (same-branch / fetch fail
* / not a repo / …). Disables the button regardless of `branchSyncBehind`. */
/**
* True when sync is structurally unavailable (same-branch / fetch fail
* / not a repo / …). Disables the button regardless of `branchSyncBehind`.
*/
branchSyncDisabled: boolean
/** Hover tooltip, already includes branch names + behind count or the
* unavailable reason. */
/**
* Hover tooltip, already includes branch names + behind count or the
* unavailable reason.
*/
branchSyncTitle: string
onSyncBranch: () => void
/** Whether the workspace's `.env*` files are currently chmod-locked (444).
* Icon flips between Lock and Unlock based on this. */
/**
* Whether the workspace's `.env*` files are currently chmod-locked (444).
* Icon flips between Lock and Unlock based on this.
*/
envLocked: boolean
/** Number of `.env*` files discovered in the workspace at the last scan.
* The button is disabled when 0 — nothing to lock. */
/**
* Number of `.env*` files discovered in the workspace at the last scan.
* The button is disabled when 0 — nothing to lock.
*/
envFileCount: number
/** True while a chmod batch is in flight; disables the button to avoid
* duplicate toggles. */
/**
* True while a chmod batch is in flight; disables the button to avoid
* duplicate toggles.
*/
envLockRunning: boolean
/** Hover tooltip, already includes file count + current lock state. */
envLockTitle: string
onToggleEnvLock: () => void
/** Whether YouTrack is configured. The「导入 YouTrack 工单」button is only
* rendered when true. */
/**
* Whether YouTrack is configured. The「导入 YouTrack 工单」button is only
* rendered when true.
*/
youtrackConfigured: boolean
/** Open the native multi-select dialog to pick which YouTrack issues to
* mirror onto the board. */
/**
* Open the native multi-select dialog to pick which YouTrack issues to
* mirror onto the board.
*/
onImportYouTrack: () => void
}
export function PanelHeader({
onRefresh,
scope,
onToggleScope,
onEditAuth,
commitRunning,
hasChanges,
@@ -122,6 +145,15 @@ export function PanelHeader({
<ListPlus size={14} />
</button>
)}
<button
type="button"
onClick={onToggleScope}
title={scope === 'mine' ? '当前:只看我的工单,点击切换为全部' : '当前:团队全部工单,点击切换为只看我的'}
aria-label={scope === 'mine' ? '切换为全部工单' : '切换为只看我的'}
className="flex h-6 w-6 items-center justify-center rounded hover:bg-[var(--vscode-toolbar-hoverBackground)]"
>
{scope === 'mine' ? <User size={14} /> : <Users size={14} />}
</button>
<button
type="button"
onClick={onRefresh}