# project-workspace ## 목적 / 책임 NomadCode에서 관리할 workspace/project 목록, 선택 상태, active workspace tab, 프로젝트 상세 동작을 담당한다. 현재 프로젝트 데이터와 action은 mock/placeholder 상태다. ## 포함 경로 - `src/routes/ProjectsPage.tsx` : Projects page composition - `src/components/projects/` : project card, detail, workspace tabs - `src/stores/projectStore.ts` : 선택 프로젝트와 active workspace 상태 - `src/api/projects.ts` : project 타입, mock list, workspace action placeholder ## 제외 경로 - `src/stores/agentStore.ts` : agent 대화와 context 상태 - `src/api/tasks.ts` : task API는 backend-integration - `src/components/common/` : ui-shell common primitive ## 주요 구성 요소 - `Project` : workspace, repo, Plane, Outline, default agent metadata - `mockProjects` : 현재 project inventory seed - `ProjectCard` : project 선택과 주요 action entry - `ProjectDetail` : 선택 project metadata 표시 - `WorkspaceTabs` : active workspace tab 표시와 close action - `useProjectStore` : selected project와 active workspace ids 관리 ## 유지할 패턴 - project 선택 상태는 `useProjectStore`를 원천으로 사용한다. - 외부 링크 열기와 placeholder action은 API/helper 함수로 격리한다. - 실제 metadata API가 생기면 `mockProjects`를 Query 기반 fetch로 대체하고 store에는 UI 선택 상태만 남긴다. - project action이 agent message를 만들 때는 `useAgentStore.sendMessage` 경계를 통해 요청한다. ## 다른 도메인과의 경계 - **agent-workspace**: project action이 agent 요청을 만들 수 있지만 agent message 생성 규칙은 agent-workspace가 유지한다. - **backend-integration**: task 생성과 서버 project metadata 연동은 backend-integration에 둔다. - **ui-shell**: workspace tab과 project detail의 내부 동작은 project-workspace, 전체 route/layout은 ui-shell. ## 금지 사항 - project mock 데이터를 여러 파일에 중복 선언하지 않는다. - `window.open` 같은 브라우저 side effect를 UI 깊은 곳에 흩뿌리지 않는다. - workspace tab 상태와 selected project 상태가 서로 불일치하도록 업데이트하지 않는다.