feat(vscode): 支持重置回待办并修好待办依赖拖拽

This commit is contained in:
2026-08-25 18:53:55 +08:00
parent 75dec8fa90
commit 6c05b7f7e3
12 changed files with 717 additions and 164 deletions
@@ -1,6 +1,6 @@
import type { ReactNode } from 'react'
import { useMemo, useRef } from 'react'
import { CircleSlash, ExternalLink, GitMerge, Play, Terminal, Trash2, X } from 'lucide-react'
import { CircleSlash, ExternalLink, GitMerge, Play, RotateCcw, Terminal, Trash2, X } from 'lucide-react'
import type { ClaudeProfile } from '../hooks/useIssues'
import type { Issue, IssueColumn } from '../types'
import { COLUMN_LABELS, COLUMN_ORDER } from '../types'
@@ -68,6 +68,8 @@ interface IssueDetailPanelProps {
onDeleteIssue?: (issueNumber: number) => void
/** 关闭 Gitea 工单,不清理本地会话、worktree、PR 或分支。 */
onCloseIssue: (issueNumber: number) => void
/** 将实施中 / 审查中的工单重置回待办(清 worktree / 未合并 PR / feature 分支)。 */
onResetToTodo: (issueNumber: number) => void
/** Close the matching session terminal tab. The extension watches
* onDidCloseTerminal and clears the corresponding `*TabOpen` flag, which
* makes the X button vanish on its own. */
@@ -117,6 +119,7 @@ export function IssueDetailPanel({
onMergeBranch,
onDeleteIssue,
onCloseIssue,
onResetToTodo,
onCloseSessionTab,
onStartBrainstormSession,
onUpdateAutoReview,
@@ -572,6 +575,17 @@ export function IssueDetailPanel({
avoid acting on a gitea issue of the same number. */}
{issue.source !== 'youtrack' && (
<>
{(issue.column === 'in-progress' || issue.column === 'review') && (
<button
type="button"
onClick={() => onResetToTodo(issue.number)}
title="重置为待办"
aria-label="重置为待办"
className="inline-flex shrink-0 items-center justify-center rounded border border-[var(--vscode-panel-border)] p-1 text-xs text-[var(--vscode-foreground)] hover:border-yellow-500/60 hover:bg-yellow-500/10 hover:text-yellow-500"
>
<RotateCcw className="size-3.5" />
</button>
)}
<button
type="button"
onClick={() => onCloseIssue(issue.number)}