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

@@ -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 (
<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">