+
+
-
- Resolution
- Flow
-
+ {!sidebarCollapsed && (
+
+ Resolution
+ Flow
+
+ )}
{/* Search trigger */}
diff --git a/frontend/src/components/workspace/WorkspaceCreateModal.tsx b/frontend/src/components/workspace/WorkspaceCreateModal.tsx
new file mode 100644
index 00000000..4c9b0da1
--- /dev/null
+++ b/frontend/src/components/workspace/WorkspaceCreateModal.tsx
@@ -0,0 +1,136 @@
+import { useState } from 'react'
+import { X, Loader2 } from 'lucide-react'
+import { workspacesApi } from '@/api/workspaces'
+import { useWorkspaceStore } from '@/store/workspaceStore'
+import { toast } from '@/lib/toast'
+import { cn } from '@/lib/utils'
+
+interface WorkspaceCreateModalProps {
+ open: boolean
+ onClose: () => void
+}
+
+const ICONS = ['π', 'π§', 'π', 'π', 'π―', 'πΌ', 'π', 'π', 'π§ͺ', 'βοΈ']
+
+export function WorkspaceCreateModal({ open, onClose }: WorkspaceCreateModalProps) {
+ const fetchWorkspaces = useWorkspaceStore(s => s.fetchWorkspaces)
+ const [name, setName] = useState('')
+ const [description, setDescription] = useState('')
+ const [icon, setIcon] = useState('π')
+ const [saving, setSaving] = useState(false)
+
+ const slug = name
+ .toLowerCase()
+ .replace(/[^a-z0-9\s-]/g, '')
+ .replace(/\s+/g, '-')
+ .slice(0, 50)
+
+ const handleSubmit = async (e: React.FormEvent) => {
+ e.preventDefault()
+ if (!name.trim() || !slug) return
+ setSaving(true)
+ try {
+ await workspacesApi.create({ name: name.trim(), slug, description: description.trim() || undefined, icon })
+ await fetchWorkspaces()
+ toast.success(`Workspace "${name}" created`)
+ setName('')
+ setDescription('')
+ setIcon('π')
+ onClose()
+ } catch (err: unknown) {
+ const message = err instanceof Error ? err.message : 'Failed to create workspace'
+ toast.error(message)
+ } finally {
+ setSaving(false)
+ }
+ }
+
+ if (!open) return null
+
+ return (
+
+
+
+
+
Create Workspace
+
+
+
+
+
+
+ )
+}
diff --git a/frontend/src/components/workspace/WorkspaceSwitcher.tsx b/frontend/src/components/workspace/WorkspaceSwitcher.tsx
index fca2655c..2afc36e0 100644
--- a/frontend/src/components/workspace/WorkspaceSwitcher.tsx
+++ b/frontend/src/components/workspace/WorkspaceSwitcher.tsx
@@ -1,6 +1,7 @@
import { useState, useRef, useEffect } from 'react'
import { ChevronDown, Plus } from 'lucide-react'
import { useWorkspaceStore } from '@/store/workspaceStore'
+import { WorkspaceCreateModal } from './WorkspaceCreateModal'
import { toast } from '@/lib/toast'
import { cn } from '@/lib/utils'
@@ -9,6 +10,7 @@ export function WorkspaceSwitcher() {
const activeWorkspace = workspaces.find(w => w.id === activeWorkspaceId)
const [open, setOpen] = useState(false)
+ const [createModalOpen, setCreateModalOpen] = useState(false)
const ref = useRef
(null)
useEffect(() => {
@@ -30,6 +32,7 @@ export function WorkspaceSwitcher() {
if (!activeWorkspace) return null
return (
+ <>
-
)}
+
+