diff --git a/apps/web/app/workspace/page.tsx b/apps/web/app/workspace/page.tsx index 84b38e5..1f7cf0b 100644 --- a/apps/web/app/workspace/page.tsx +++ b/apps/web/app/workspace/page.tsx @@ -222,16 +222,16 @@ export default function WorkspacePage() { {/* Detail Drawers */} {drawerItem && (drawerItem.type === 'plan_research' || drawerItem.type === 'plan_product' || drawerItem.type === 'plan_ui') && ( - setDrawerItem(null)} /> + setDrawerItem(null)} contextLabel={`${drawerItem.productName} / ${drawerItem.projectName} / ${drawerItem.versionName}`} /> )} {drawerItem && drawerItem.type === 'devTask' && ( - t.id)} onClose={() => setDrawerItem(null)} /> + t.id)} onClose={() => setDrawerItem(null)} contextLabel={`${drawerItem.productName} / ${drawerItem.projectName} / ${drawerItem.versionName}`} /> )} {drawerItem && drawerItem.type === 'testCase' && ( - setDrawerItem(null)} onCreateBug={(tcId) => { setDrawerItem(null); setBugFromTestCaseId(tcId); }} /> + setDrawerItem(null)} onCreateBug={(tcId) => { setDrawerItem(null); setBugFromTestCaseId(tcId); }} contextLabel={`${drawerItem.productName} / ${drawerItem.projectName} / ${drawerItem.versionName}`} /> )} {drawerItem && drawerItem.type === 'bug' && ( - setDrawerItem(null)} /> + setDrawerItem(null)} contextLabel={`${drawerItem.productName} / ${drawerItem.projectName} / ${drawerItem.versionName}`} /> )} {bugFromTestCaseId && ( setBugFromTestCaseId(null)} /> diff --git a/apps/web/components/bug/BugDetailDrawer.tsx b/apps/web/components/bug/BugDetailDrawer.tsx index 28b490a..e90581e 100644 --- a/apps/web/components/bug/BugDetailDrawer.tsx +++ b/apps/web/components/bug/BugDetailDrawer.tsx @@ -21,9 +21,10 @@ const LOG_ACTION_LABEL: Record = { interface Props { bugId: string; onClose: () => void; + contextLabel?: string; } -export function BugDetailDrawer({ bugId, onClose }: Props) { +export function BugDetailDrawer({ bugId, onClose, contextLabel }: Props) { const { bugs, changeStatus, transferBug } = useBugStore(); const { testCases } = useTestCaseStore(); const { requirements } = useRequirementStore(); @@ -66,6 +67,11 @@ export function BugDetailDrawer({ bugId, onClose }: Props) { return (
e.stopPropagation()}> + {contextLabel && ( +
+ {contextLabel} +
+ )}
{bug.bugNo} diff --git a/apps/web/components/dev-task/DevTaskDetailDrawer.tsx b/apps/web/components/dev-task/DevTaskDetailDrawer.tsx index 0d880a2..b9955e5 100644 --- a/apps/web/components/dev-task/DevTaskDetailDrawer.tsx +++ b/apps/web/components/dev-task/DevTaskDetailDrawer.tsx @@ -15,9 +15,10 @@ interface Props { taskId: string; allTaskIds: string[]; onClose: () => void; + contextLabel?: string; } -export function DevTaskDetailDrawer({ taskId, allTaskIds, onClose }: Props) { +export function DevTaskDetailDrawer({ taskId, allTaskIds, onClose, contextLabel }: Props) { const { tasks, changeStatus, setBlocked, deleteTask, updateTask } = useDevTaskStore(); const { categories } = useTaskCategoryStore(); const { requirements } = useRequirementStore(); @@ -56,6 +57,12 @@ export function DevTaskDetailDrawer({ taskId, allTaskIds, onClose }: Props) { return (
e.stopPropagation()}> + {/* 上下文 */} + {contextLabel && ( +
+ {contextLabel} +
+ )} {/* 顶栏 */}
diff --git a/apps/web/components/test-case/TestCaseDetailDrawer.tsx b/apps/web/components/test-case/TestCaseDetailDrawer.tsx index 7ba3e29..75ecd13 100644 --- a/apps/web/components/test-case/TestCaseDetailDrawer.tsx +++ b/apps/web/components/test-case/TestCaseDetailDrawer.tsx @@ -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 (
e.stopPropagation()}> + {contextLabel && ( +
+ {contextLabel} +
+ )}
{tc.caseNo} diff --git a/apps/web/components/version/PlanDetailDrawer.tsx b/apps/web/components/version/PlanDetailDrawer.tsx index 7d9d375..c1ece92 100644 --- a/apps/web/components/version/PlanDetailDrawer.tsx +++ b/apps/web/components/version/PlanDetailDrawer.tsx @@ -11,13 +11,14 @@ import type { PlanTask, VersionPlan } from '@/lib/version-plan'; interface Props { planId: string; onClose: () => void; + contextLabel?: string; } const STATUS_STYLE: Record = { pending: 'bg-zinc-100 text-zinc-600', in_progress: 'bg-blue-50 text-blue-600', completed: 'bg-emerald-50 text-emerald-600' }; const STATUS_LABEL: Record = { pending: '未开始', in_progress: '进行中', completed: '已完成' }; const TYPE_LABEL: Record = { research: '调研', product: '产品方案', ui: 'UI设计' }; -export function PlanDetailDrawer({ planId, onClose }: Props) { +export function PlanDetailDrawer({ planId, onClose, contextLabel }: Props) { const { plans, updatePlan, completePlan } = useVersionPlanStore(); const { requirements } = useRequirementStore(); const { members } = useMemberStore(); @@ -77,6 +78,12 @@ export function PlanDetailDrawer({ planId, onClose }: Props) { return (
e.stopPropagation()}> + {/* Context */} + {contextLabel && ( +
+ {contextLabel} +
+ )} {/* Header */}