11import { useState } from "react" ;
2+ import { Button } from "@/components/ui/button" ;
3+ import type { TaskStatus } from "../types" ;
24import { Dashboard } from "./components/Dashboard" ;
35import { ProjectSelector } from "./components/ProjectSelector" ;
46import { TaskDetailView } from "./components/TaskDetailView" ;
57import { useProjects } from "./hooks/useProjects" ;
6- import { type TaskStatus , useSpecs } from "./hooks/useSpecs" ;
8+ import { useSpecs } from "./hooks/useSpecs" ;
79
810export function App ( ) {
911 const {
@@ -13,9 +15,17 @@ export function App() {
1315 addProject,
1416 removeProject,
1517 loading : projectsLoading ,
18+ error : projectsError ,
1619 } = useProjects ( ) ;
17- const { fileTree, selectedFile, specContent, status, fetchSpecContent } =
18- useSpecs ( selectedProject ?. id ?? null ) ;
20+ const [ includeArchived , setIncludeArchived ] = useState ( false ) ;
21+ const {
22+ fileTree,
23+ selectedFile,
24+ specContent,
25+ status,
26+ fetchSpecContent,
27+ error : specsError ,
28+ } = useSpecs ( selectedProject ?. id ?? null , { includeArchived } ) ;
1929 const [ selectedTask , setSelectedTask ] = useState < TaskStatus | null > ( null ) ;
2030
2131 const handleTaskClick = ( task : TaskStatus ) => {
@@ -28,42 +38,63 @@ export function App() {
2838
2939 if ( projectsLoading ) {
3040 return (
31- < div className = "app" >
32- < div className = "loading" > Loading...</ div >
41+ < div className = "min-h-screen bg-muted/30" >
42+ < div className = "mx-auto max-w-5xl p-6 text-muted-foreground" >
43+ Loading...
44+ </ div >
3345 </ div >
3446 ) ;
3547 }
3648
3749 return (
38- < div className = "app" >
39- < header className = "app-header" >
40- < div className = "app-header-left" >
41- < h1 className = "app-title" > SDD Webapp</ h1 >
42- { selectedTask && (
43- < >
44- < span className = "breadcrumb-separator" > /</ span >
45- < span className = "breadcrumb-current" > { selectedTask . name } </ span >
46- </ >
47- ) }
50+ < div className = "min-h-screen bg-muted/30" >
51+ { ( projectsError || specsError ) && (
52+ < div
53+ className = "border-b border-destructive/20 bg-destructive/10 px-6 py-3 text-sm text-destructive"
54+ role = "alert"
55+ >
56+ { projectsError || specsError }
4857 </ div >
49- < div className = "app-header-right" >
50- < ProjectSelector
51- projects = { projects }
52- selectedProject = { selectedProject }
53- onSelect = { ( project ) => {
54- setSelectedProject ( project ) ;
55- setSelectedTask ( null ) ;
56- } }
57- onAdd = { addProject }
58- onRemove = { removeProject }
59- />
58+ ) }
59+ < header className = "sticky top-0 z-10 border-b bg-background/80 backdrop-blur" >
60+ < div className = "mx-auto flex h-16 max-w-6xl items-center justify-between gap-4 px-6" >
61+ < div className = "flex items-center gap-3" >
62+ < h1 className = "text-lg font-semibold" > SDD Webapp</ h1 >
63+ { selectedTask && (
64+ < >
65+ < span className = "text-muted-foreground" > /</ span >
66+ < Button
67+ type = "button"
68+ variant = "link"
69+ className = "h-auto p-0 text-sm text-muted-foreground"
70+ onClick = { handleBackToDashboard }
71+ >
72+ { selectedTask . name }
73+ </ Button >
74+ </ >
75+ ) }
76+ </ div >
77+ < div className = "flex items-center gap-3" >
78+ < ProjectSelector
79+ projects = { projects }
80+ selectedProject = { selectedProject }
81+ onSelect = { ( project ) => {
82+ setSelectedProject ( project ) ;
83+ setSelectedTask ( null ) ;
84+ } }
85+ onAdd = { addProject }
86+ onRemove = { removeProject }
87+ />
88+ </ div >
6089 </ div >
6190 </ header >
62- < main className = "main-content " >
91+ < main className = "mx-auto w-full max-w-6xl flex-1 px-6 py-6 " >
6392 { ! selectedProject ? (
64- < div className = "empty-state" >
65- < h2 > No Project Selected</ h2 >
66- < p > Add a project to get started.</ p >
93+ < div className = "rounded-lg border bg-background p-8 text-center" >
94+ < h2 className = "text-lg font-semibold" > No Project Selected</ h2 >
95+ < p className = "mt-2 text-sm text-muted-foreground" >
96+ Add a project to get started.
97+ </ p >
6798 </ div >
6899 ) : selectedTask ? (
69100 < TaskDetailView
@@ -78,6 +109,8 @@ export function App() {
78109 < Dashboard
79110 status = { status }
80111 projectName = { selectedProject . name }
112+ includeArchived = { includeArchived }
113+ onToggleArchived = { setIncludeArchived }
81114 onTaskClick = { handleTaskClick }
82115 />
83116 ) }
0 commit comments