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

@@ -11,13 +11,14 @@ import type { PlanTask, VersionPlan } from '@/lib/version-plan';
interface Props {
planId: string;
onClose: () => void;
contextLabel?: string;
}
const STATUS_STYLE: Record<string, string> = { 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<string, string> = { pending: '未开始', in_progress: '进行中', completed: '已完成' };
const TYPE_LABEL: Record<string, string> = { 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 (
<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 overflow-hidden" onClick={(e) => e.stopPropagation()}>
{/* Context */}
{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>
)}
{/* Header */}
<div className="flex items-center justify-between px-5 py-4 border-b border-[var(--line)] shrink-0">
<div className="flex items-center gap-2">