🎨 style(vscode): eslint 自动修复格式与排序

Claude-Session: https://claude.ai/code/session_01HTMgwaE3woqM5yvsHiuSAa
This commit is contained in:
cruldra committed 2026-08-31 22:30:42 +08:00
1 parent df35bcfd49
commit 8c22a29ce5
41 files changed
+248 -167

No files matched your search

@@ -1,18 +1,20 @@
import type { Ref } from 'react'
import { forwardRef } from 'react'
import type { Issue } from '../types'
import { useSortable } from '@dnd-kit/sortable'
import { CSS } from '@dnd-kit/utilities'
import { Lock } from 'lucide-react'
import { forwardRef } from 'react'
import { cn } from '@/lib/utils'
import { Card } from './ui/card'
import type { Issue } from '../types'
interface IssueCardProps {
issue: Issue
selected?: boolean
onSelect?: (id: string) => void
/** Visual nesting level for prerequisite-chain rendering in the todo column.
* Each level adds 16px of left margin. Defaults to 0 (flat). */
/**
* Visual nesting level for prerequisite-chain rendering in the todo column.
* Each level adds 16px of left margin. Defaults to 0 (flat).
*/
depth?: number
/** 锁定态:前置工单尚未完成。显示锁图标 + tooltip。 */
locked?: boolean
@@ -1,11 +1,11 @@
import type { ReactNode } from 'react'
import { useMemo, useRef } from 'react'
import { ArrowRightLeft, CircleSlash, Download, ExternalLink, GitMerge, Loader2, 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'
import { isIssueLocked } from '../lib/dependencies'
import type { PropertyGroup } from './property-grid'
import { ArrowRightLeft, CircleSlash, Download, ExternalLink, GitMerge, Loader2, Play, RotateCcw, Terminal, Trash2, X } from 'lucide-react'
import { useMemo, useRef } from 'react'
import { isIssueLocked } from '../lib/dependencies'
import { COLUMN_LABELS, COLUMN_ORDER } from '../types'
import { PropertyGrid } from './property-grid'
/** 跨机绝对路径只比 basename(同名 .json)映射到本机 profiles 列表。 */
@@ -37,14 +37,20 @@ interface IssueDetailPanelProps {
globalAutoReview: boolean
onOpenInBrowser: (url: string) => void
onResumeSession: (sessionId: string, profilePath?: string, cwd?: string, issueNumber?: number) => void
/** Open a new terminal that runs `codex resume <id>` for the auto-review
* conversation associated with this issue. */
/**
* Open a new terminal that runs `codex resume <id>` for the auto-review
* conversation associated with this issue.
*/
onResumeReviewSession: (sessionId: string, issueNumber: number, cwd?: string) => void
/** Open a new terminal that runs `claude --resume <id>` for the test
* conversation associated with this issue. */
/**
* Open a new terminal that runs `claude --resume <id>` for the test
* conversation associated with this issue.
*/
onResumeTestSession: (sessionId: string, issueNumber: number, cwd?: string) => void
/** Spawn a fresh "测试" cc tab for an issue whose PR has merged. Bound to the
* Play button next to the "测试会话 id" row (only shown when `issue.pr` exists). */
/**
* Spawn a fresh "测试" cc tab for an issue whose PR has merged. Bound to the
* Play button next to the "测试会话 id" row (only shown when `issue.pr` exists).
*/
onStartTestSession: (issueNumber: number) => void
/** Open a workspace-relative file in the editor. */
onOpenFile: (path: string) => void
@@ -60,23 +66,31 @@ interface IssueDetailPanelProps {
onOpenWorktree: (path: string) => void
/** Delete the worktree (`git worktree remove`) and clear it from state. */
onDeleteWorktree: (issueNumber: number, path: string) => void
/** Pre-merge the issue's feature branch into the main worktree's current branch
* (`git merge --no-commit --no-ff <branch>`) so the user can inspect locally. */
/**
* Pre-merge the issue's feature branch into the main worktree's current branch
* (`git merge --no-commit --no-ff <branch>`) so the user can inspect locally.
*/
onMergeBranch: (issueNumber: number, branch: string) => void
/** 硬删整个工单 + 关联资源(worktree / PR / feature branch / cc tabs)。
* 顶部垃圾桶按钮触发,扩展端做 modal confirm,可选。 */
/**
* 硬删整个工单 + 关联资源(worktree / PR / feature branch / cc tabs)。
* 顶部垃圾桶按钮触发,扩展端做 modal confirm,可选。
*/
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
/**
* 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. */
* makes the X button vanish on its own.
*/
onCloseSessionTab: (issueNumber: number, kind: 'brainstorm' | 'implement' | 'review' | 'test') => void
/** Spawn a fresh "规划" cc tab for an issue whose sessionId is still empty
/**
* Spawn a fresh "规划" cc tab for an issue whose sessionId is still empty
* (created out-of-band via spx without webhook linking). Bound to the Play
* button next to the "头脑风暴会话 id" row. */
* button next to the "头脑风暴会话 id" row.
*/
onStartBrainstormSession: (issueNumber: number) => void
/** Persist a per-issue `autoReview` override into the state JSON. */
onUpdateAutoReview: (issueNumber: number, value: boolean) => void
@@ -649,7 +663,11 @@ export function IssueDetailPanel({
{issue.source === 'youtrack' && issue.attachments && issue.attachments.length > 0 && (
<div className="flex flex-col gap-1 text-xs">
<span className="opacity-60">附件({issue.attachments.length})</span>
<span className="opacity-60">
附件(
{issue.attachments.length}
)
</span>
<div className="flex flex-wrap gap-2">
{issue.attachments.map(att => (
<button
@@ -1,10 +1,10 @@
import type { ReactNode } from 'react'
import type { Issue, IssueColumn } from '../types'
import { useDroppable } from '@dnd-kit/core'
import { Plus } from 'lucide-react'
import { cn } from '@/lib/utils'
import { Badge } from './ui/badge'
import type { Issue, IssueColumn } from '../types'
import { COLUMN_LABELS } from '../types'
import { Badge } from './ui/badge'
interface KanbanColumnProps {
column: IssueColumn
@@ -12,9 +12,9 @@
*/
import type { ReactElement } from 'react'
import { useEffect, useLayoutEffect, useRef, useState } from 'react'
import { Copy, Trash2, X } from 'lucide-react'
import type { LogEntry } from '../lib/messages'
import { Copy, Trash2, X } from 'lucide-react'
import { useEffect, useLayoutEffect, useRef, useState } from 'react'
export interface LogModalProps {
open: boolean
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useRef, useState } from 'react'
import { X } from 'lucide-react'
import { useCallback, useEffect, useRef, useState } from 'react'
import { getPastedImageFiles, readClipboardImages } from '../lib/imagePaste'
export interface PastedImage {
@@ -13,8 +13,8 @@
import type { PastedImage } from '../lib/imagePaste'
import { X } from 'lucide-react'
import { useEffect, useRef, useState } from 'react'
import { getPastedImageFiles, readClipboardImages } from '../lib/imagePaste'
import { useProfileAssets } from '../hooks/useProfileAssets'
import { getPastedImageFiles, readClipboardImages } from '../lib/imagePaste'
interface Props {
keyLabel: string
@@ -1,5 +1,5 @@
import { useEffect } from 'react'
import { CheckCircle2, Loader2, X, XCircle } from 'lucide-react'
import { useEffect } from 'react'
export interface ToastItem {
id: string
@@ -55,7 +55,7 @@ export function statusColorVar(status: string): string {
/** PR diff 里跳过测试代码:路径任一段为 `tests` 即视为忽略(匹配 `tests/…` 或 `…/tests/…`)。 */
export function isIgnoredPath(path: string): boolean {
return path.split('/').some(seg => seg === 'tests')
return path.split('/').includes('tests')
}
/**
@@ -29,18 +29,18 @@ import { SelectMenu } from './ui/select-menu'
// --- 类型定义 ---
/** 字段类型枚举 */
export type FieldType =
| 'string'
| 'multiline'
| 'number'
| 'boolean'
| 'select'
| 'color'
| 'theme-color'
| 'password'
| 'action'
| 'file-link'
| 'pr-link'
export type FieldType
= | 'string'
| 'multiline'
| 'number'
| 'boolean'
| 'select'
| 'color'
| 'theme-color'
| 'password'
| 'action'
| 'file-link'
| 'pr-link'
/** 属性定义 */
export interface PropertyDef {
@@ -1,4 +1,5 @@
import { cva, type VariantProps } from 'class-variance-authority'
import type { VariantProps } from 'class-variance-authority'
import { cva } from 'class-variance-authority'
import * as React from 'react'
import { cn } from '@/lib/utils'
+2 -1
View File
@@ -1,4 +1,5 @@
import { type ClassValue, clsx } from 'clsx'
import type { ClassValue } from 'clsx'
import { clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'
export function cn(...inputs: ClassValue[]): string {
-1
View File
@@ -14,7 +14,6 @@ class ErrorBoundary extends React.Component<{ children: React.ReactNode }, Bound
}
componentDidCatch(error: Error, info: React.ErrorInfo): void {
// eslint-disable-next-line no-console
console.error('[superpowers webview] render crash:', error, info.componentStack)
}
+36 -18
View File
@@ -11,24 +11,32 @@ export interface Issue {
column: IssueColumn
/** YouTrack attachments (name + absolute URL); links only. */
attachments?: Array<{ name: string, url: string }>
/** Optional Claude Code session id stored alongside the column marker in
* the issue's state-JSON comment. Used to resume the conversation. */
/**
* Optional Claude Code session id stored alongside the column marker in
* the issue's state-JSON comment. Used to resume the conversation.
*/
sessionId?: string
/** Absolute path to the Claude settings profile used at creation; passed
* as --settings on resume. */
/**
* Absolute path to the Claude settings profile used at creation; passed
* as --settings on resume.
*/
/** 实施会话专用的 Claude 配置文件;空 = 默认,不回退其它字段。 */
profilePath?: string
/** 头脑风暴会话专用的 Claude 配置文件;空 = 默认,不回退其它字段。 */
brainstormProfilePath?: string
/** 测试会话专用的 Claude 配置文件;空 = 默认,不回退其它字段。 */
testProfilePath?: string
/** Optional workspace-relative path to the spec file for this issue, as
/**
* Optional workspace-relative path to the spec file for this issue, as
* surfaced from the Claude session transcript. Lives under
* `docs/superpowers/specs/*.md`. */
* `docs/superpowers/specs/*.md`.
*/
specFile?: string
/** Optional workspace-relative path to the plan file for this issue, as
/**
* Optional workspace-relative path to the plan file for this issue, as
* surfaced from the Claude session transcript. Lives under
* `docs/superpowers/plans/*.md`. */
* `docs/superpowers/plans/*.md`.
*/
planFile?: string
/** Optional workspace-relative path to the generated PR diff summary. */
prDiffFile?: string
@@ -46,24 +54,32 @@ export interface Issue {
worktreeExists?: boolean
/** Lifecycle of the implementation flow. */
implementStatus?: 'running' | 'done' | 'failed'
/** Session id of the implementation conversation (separate from
* discussion-session `sessionId`). */
/**
* Session id of the implementation conversation (separate from
* discussion-session `sessionId`).
*/
implementSessionId?: string
/** Backend-agnostic review session id (v1 stores a codex thread id). */
reviewSessionId?: string
/** 本机是否存在 reviewSessionId 对应的 codex 会话文件;扩展端加载时计算,
* 不持久化。codex resume 只依赖这个文件,与 worktree 无关。 */
/**
* 本机是否存在 reviewSessionId 对应的 codex 会话文件;扩展端加载时计算,
* 不持久化。codex resume 只依赖这个文件,与 worktree 无关。
*/
reviewSessionFileExists?: boolean
/** Claude Code session id of the test conversation; manually started after
* the PR is merged, resumable from the detail panel. */
/**
* Claude Code session id of the test conversation; manually started after
* the PR is merged, resumable from the detail panel.
*/
testSessionId?: string
htmlUrl: string
/** 前置任务 issue number (Gitea dependencies 取第一个) */
prerequisite?: number
/** Terminal/tab color id chosen on first session open, persisted in state JSON. */
color?: string
/** Per-issue override of the global `autoReview` setting. Undefined = follow
* global setting; true/false = explicit override stored in state JSON. */
/**
* Per-issue override of the global `autoReview` setting. Undefined = follow
* global setting; true/false = explicit override stored in state JSON.
*/
autoReview?: boolean
/** Gitea assignee login 列表;接管按钮只对 assignee 含当前登录者的工单显示。 */
assignees?: string[]
@@ -71,8 +87,10 @@ export interface Issue {
handoffAttachmentId?: string
/** 发起移交的 Gitea login。 */
handoffFrom?: string
/** 三类会话 tab 是否当前在编辑器分组里打开(由 extension 通过 issue/patch 同步)。
* 仅用于详情面板控制是否在三行会话 id 右侧显示 "关闭 tab" 按钮,不持久化到 state JSON。 */
/**
* 三类会话 tab 是否当前在编辑器分组里打开(由 extension 通过 issue/patch 同步)。
* 仅用于详情面板控制是否在三行会话 id 右侧显示 "关闭 tab" 按钮,不持久化到 state JSON。
*/
brainstormTabOpen?: boolean
implementTabOpen?: boolean
reviewTabOpen?: boolean