feat: add workspace system and sidebar layout (UI design system Phase A+B)
Backend: Workspace model, migration (036), schemas, CRUD API endpoints. Adds workspace_id to trees and categories, seeds 4 default workspaces per account, auto-assigns existing trees by tree_type. Frontend: Complete AppLayout rewrite from top-nav to CSS Grid shell with persistent sidebar + topbar. New components: WorkspaceSwitcher, NavItem, CategoryList, TagCloud, TopBar, Sidebar. Dashboard components: QuickStats, FiltersBar, SectionGroup, TreeListItem, SessionsPanel. WorkspaceStore with localStorage persistence. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
39
backend/app/schemas/workspace.py
Normal file
39
backend/app/schemas/workspace.py
Normal file
@@ -0,0 +1,39 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class WorkspaceCreate(BaseModel):
|
||||
name: str = Field(..., min_length=1, max_length=100)
|
||||
slug: str = Field(..., min_length=1, max_length=100, pattern=r'^[a-z0-9-]+$')
|
||||
description: Optional[str] = None
|
||||
icon: Optional[str] = Field(None, max_length=10)
|
||||
accent_color: Optional[str] = Field(None, pattern=r'^#[0-9a-fA-F]{6}$')
|
||||
sort_order: int = 0
|
||||
|
||||
|
||||
class WorkspaceUpdate(BaseModel):
|
||||
name: Optional[str] = Field(None, min_length=1, max_length=100)
|
||||
slug: Optional[str] = Field(None, min_length=1, max_length=100, pattern=r'^[a-z0-9-]+$')
|
||||
description: Optional[str] = None
|
||||
icon: Optional[str] = Field(None, max_length=10)
|
||||
accent_color: Optional[str] = Field(None, pattern=r'^#[0-9a-fA-F]{6}$')
|
||||
sort_order: Optional[int] = None
|
||||
|
||||
|
||||
class WorkspaceResponse(BaseModel):
|
||||
id: uuid.UUID
|
||||
name: str
|
||||
slug: str
|
||||
description: Optional[str] = None
|
||||
icon: Optional[str] = None
|
||||
accent_color: Optional[str] = None
|
||||
account_id: uuid.UUID
|
||||
is_default: bool
|
||||
sort_order: int
|
||||
tree_count: int = 0
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
Reference in New Issue
Block a user