✨ feat(vscode): 看板顶部加筛选框,按标题 / 工单号 / PR 号过滤卡片
工单多了以后靠肉眼在四列里翻太慢。顶部输入框按空白分词逐词 AND 匹配 标题、工单号、PR 号,`#427` 与 `427` 等价,纯数字按包含匹配,记不全 编号也能搜到。筛选只收窄渲染,拖拽与依赖锁定仍按全量列表算;列头角标 在筛选时显示「可见 / 总数」。
This commit is contained in:
1 parent
73f2c3ec66
commit
9e255f517b
6 files changed
+167
-8
No files matched your search
@@ -9,12 +9,15 @@ import { Badge } from './ui/badge'
|
||||
interface KanbanColumnProps {
|
||||
column: IssueColumn
|
||||
issues: Issue[]
|
||||
/** 该列未经筛选的卡片总数。与 `issues.length` 不等时角标显示「可见 / 总数」。 */
|
||||
totalCount?: number
|
||||
children: ReactNode
|
||||
/** When provided, renders a + button in the header. Used for the todo column. */
|
||||
onCreate?: () => void
|
||||
}
|
||||
|
||||
export function KanbanColumn({ column, issues, children, onCreate }: KanbanColumnProps) {
|
||||
export function KanbanColumn({ column, issues, totalCount, children, onCreate }: KanbanColumnProps) {
|
||||
const filtered = totalCount !== undefined && totalCount !== issues.length
|
||||
const { setNodeRef, isOver } = useDroppable({ id: column })
|
||||
|
||||
return (
|
||||
@@ -31,7 +34,7 @@ export function KanbanColumn({ column, issues, children, onCreate }: KanbanColum
|
||||
{COLUMN_LABELS[column]}
|
||||
</span>
|
||||
<div className="flex items-center gap-1.5">
|
||||
<Badge variant="outline">{issues.length}</Badge>
|
||||
<Badge variant="outline">{filtered ? `${issues.length} / ${totalCount}` : issues.length}</Badge>
|
||||
{onCreate && (
|
||||
<button
|
||||
type="button"
|
||||
@@ -49,7 +52,7 @@ export function KanbanColumn({ column, issues, children, onCreate }: KanbanColum
|
||||
{issues.length === 0
|
||||
? (
|
||||
<div className="flex flex-1 items-center justify-center rounded-md border border-dashed border-[var(--vscode-foreground)] border-opacity-20 p-4 text-xs text-muted-foreground opacity-60">
|
||||
拖到这里
|
||||
{filtered ? '没有匹配的工单' : '拖到这里'}
|
||||
</div>
|
||||
)
|
||||
: (
|
||||
|
||||
Reference in new issue
Block a user