From c5557ce9d633590c6ae4f0b2c0d8268c1fb895af Mon Sep 17 00:00:00 2001 From: christiankrag Date: Mon, 15 Dec 2025 11:36:55 +0100 Subject: [PATCH] Consolidate project toolbar and add inline phase indicator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace separate tab navigation with unified project view - Add compact phase indicator showing design thinking progress - Add slide-out phases panel for detailed view - Reduce visual clutter from 3 toolbars to 2 - Improve chat/phases integration per design-thinking methodology 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/app/(dashboard)/projects/[id]/page.tsx | 41 +++---- .../projects/[id]/project-view.tsx | 110 ++++++++++++++++++ .../project/phase-indicator-compact.tsx | 78 +++++++++++++ 3 files changed, 209 insertions(+), 20 deletions(-) create mode 100644 src/app/(dashboard)/projects/[id]/project-view.tsx create mode 100644 src/components/project/phase-indicator-compact.tsx diff --git a/src/app/(dashboard)/projects/[id]/page.tsx b/src/app/(dashboard)/projects/[id]/page.tsx index f434831..957ca7a 100644 --- a/src/app/(dashboard)/projects/[id]/page.tsx +++ b/src/app/(dashboard)/projects/[id]/page.tsx @@ -5,7 +5,7 @@ import Link from 'next/link' import { ArrowLeft, Settings } from 'lucide-react' import { Button } from '@/components/ui/button' import type { Database } from '@/types/database' -import { ProjectTabs } from './project-tabs' +import { ProjectView } from './project-view' type Project = Database['public']['Tables']['projects']['Row'] type Message = Database['public']['Tables']['messages']['Row'] @@ -32,33 +32,34 @@ export default async function ProjectPage({ params }: { params: Promise<{ id: st return (
-
+ {/* Consolidated Project Header - compact single row */} +
-
- - +
+ + -
-
-

{project.name}

- - {project.status} - -
- {project.description && ( -

{project.description}

- )} -
+
+

{project.name}

+ + {project.status} +
-
-
diff --git a/src/app/(dashboard)/projects/[id]/project-view.tsx b/src/app/(dashboard)/projects/[id]/project-view.tsx new file mode 100644 index 0000000..0415a79 --- /dev/null +++ b/src/app/(dashboard)/projects/[id]/project-view.tsx @@ -0,0 +1,110 @@ +'use client' + +import { useState } from 'react' +import { ProjectChat } from '@/components/chat/project-chat' +import { DesignThinkingDashboard } from '@/components/project/design-thinking-dashboard' +import { PhaseIndicatorCompact } from '@/components/project/phase-indicator-compact' +import { useProject } from '@/hooks/use-project' +import { MessageSquare, Compass, PanelRightOpen, PanelRightClose } from 'lucide-react' +import { Button } from '@/components/ui/button' +import { cn } from '@/lib/utils' +import type { Database } from '@/types/database' +import type { DesignPhase } from '@/types/design-thinking' + +type DBProject = Database['public']['Tables']['projects']['Row'] +type Message = Database['public']['Tables']['messages']['Row'] + +interface ProjectViewProps { + projectId: string + project: DBProject + initialMessages: Message[] +} + +export function ProjectView({ projectId, initialMessages }: ProjectViewProps) { + const [showPhases, setShowPhases] = useState(false) + const { project: projectData, phaseStatuses, loading } = useProject(projectId) + + const handlePhaseClick = () => { + setShowPhases(true) + } + + // Default to 'empathize' if project not loaded yet + const currentPhase = projectData?.current_phase || 'empathize' + + return ( +
+ {/* Main Chat Area */} +
+ {/* Inline toolbar with phase indicator */} +
+
+
+
+ + Chat +
+
+ {!loading && ( + + )} +
+ +
+
+ + {/* Chat Content */} +
+ +
+
+ + {/* Phases Sidebar - slides in from right */} +
+
+
+
+ +

Design Phases

+
+ +
+ +
+
+
+ ) +} diff --git a/src/components/project/phase-indicator-compact.tsx b/src/components/project/phase-indicator-compact.tsx new file mode 100644 index 0000000..e443b58 --- /dev/null +++ b/src/components/project/phase-indicator-compact.tsx @@ -0,0 +1,78 @@ +'use client' + +import { cn } from '@/lib/utils' +import { DESIGN_PHASES, designPhases, type DesignPhase, type PhaseStatus } from '@/types/design-thinking' +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from '@/components/ui/tooltip' + +interface PhaseIndicatorCompactProps { + currentPhase: DesignPhase + phaseStatuses?: Record + onPhaseClick?: (phase: DesignPhase) => void + className?: string +} + +export function PhaseIndicatorCompact({ + currentPhase, + phaseStatuses, + onPhaseClick, + className +}: PhaseIndicatorCompactProps) { + const currentIndex = DESIGN_PHASES.indexOf(currentPhase) + const currentPhaseData = designPhases.find(p => p.id === currentPhase) + + return ( + +
+ {/* Mini progress dots */} +
+ {DESIGN_PHASES.map((phase, index) => { + const status = phaseStatuses?.[phase] + const isCurrent = index === currentIndex + const isCompleted = status === 'completed' || index < currentIndex + + return ( + + +
+ + {/* Current phase badge */} + + + + + +

{currentPhaseData?.label}

+

{currentPhaseData?.shortDescription}

+
+
+
+
+ ) +}