fix: 侧边详情显示产品/项目/版本上下文

所有 Drawer 新增 contextLabel 可选属性:
- 从工作台打开时传入"产品 / 项目 / 版本"路径
- 显示在 Drawer 顶部灰色背景条中
- 从版本详情打开时不传,不显示(无需冗余)
- 统一样式:px-5 py-2 bg-[var(--bg-subtle)] text-[11px]

涉及组件:
- PlanDetailDrawer
- DevTaskDetailDrawer
- TestCaseDetailDrawer
- BugDetailDrawer

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Script Generator
2026-06-15 17:52:15 +08:00
parent c7bccd7819
commit fa7a0f7294
5 changed files with 34 additions and 8 deletions

View File

@@ -17,9 +17,10 @@ interface Props {
testCaseId: string;
onClose: () => void;
onCreateBug?: (testCaseId: string) => void;
contextLabel?: string;
}
export function TestCaseDetailDrawer({ testCaseId, onClose, onCreateBug }: Props) {
export function TestCaseDetailDrawer({ testCaseId, onClose, onCreateBug, contextLabel }: Props) {
const { testCases, changeStatus, deleteTestCase, updateTestCase } = useTestCaseStore();
const { bugs } = useBugStore();
const { requirements } = useRequirementStore();
@@ -60,6 +61,11 @@ export function TestCaseDetailDrawer({ testCaseId, onClose, onCreateBug }: Props
return (
<div className="fixed inset-0 z-50 flex justify-end" onClick={onClose}>
<div className="w-full max-w-md h-full bg-[var(--bg)] border-l border-[var(--line)] shadow-2xl flex flex-col" onClick={(e) => e.stopPropagation()}>
{contextLabel && (
<div className="px-5 py-2 border-b border-[var(--line)] bg-[var(--bg-subtle)] shrink-0">
<span className="text-[11px] text-[var(--ink-muted)]">{contextLabel}</span>
</div>
)}
<div className="flex items-center justify-between h-14 px-5 border-b border-[var(--line)] bg-[var(--bg-card)] shrink-0">
<div className="flex items-center gap-2">
<span className="text-[12px] font-mono text-[var(--ink-muted)]">{tc.caseNo}</span>