@@ -43,7 +43,7 @@ app/src/
4343├── components/ # Reusable UI components
4444│ ├── ui/ # Generic Shadcn primitives (button, card, dialog, accordion, etc.)
4545│ ├── ai-elements/ # Conversation, Message, PromptInput components
46- │ ├── AgentIsland/ # 3D agent bar (React Three Fiber)
46+ │ ├── AgentIsland/ # Floating agent bar with chat modal
4747│ ├── AgentSettings/ # AgentConfigModal
4848│ ├── Board/ # PyramidBoard, Block, BlockModal
4949│ ├── Chat/ # (reserved for future chat components)
@@ -188,44 +188,47 @@ pyramids, productDefinitions, contextDocuments, directories, uiUxArchitectures,
188188| Path | Page | Description |
189189| ------| ------| -------------|
190190| ` /workspaces ` | WorkspacesPage | Workspace list and creation |
191- | ` /workspace/:id/dashboard ` | Dashboard | Main app selector (8 categories) |
191+
192+ All workspace-scoped routes are nested under ` /:workspaceId ` using a ` WorkspaceRouteSync ` layout route that syncs the URL workspace ID to context.
193+
194+ | ` /:workspaceId/dashboard ` | Dashboard | Main app selector (8 categories) |
192195
193196#### Problem Solving, Thinking and Planning (bg-indigo-600)
194197| Path | Page | Description |
195198| ------| ------| -------------|
196- | ` /pyramids ` | PyramidsPage | Pyramid list |
197- | ` /pyramid/:id ` | PyramidEditor | 8x8 grid editor |
198- | ` /diagrams ` | DiagramsPage | Diagram list |
199- | ` /diagram/:id ` | DiagramEditor | ReactFlow visual editor |
199+ | ` /:workspaceId/ pyramids ` | PyramidsPage | Pyramid list |
200+ | ` /:workspaceId/ pyramid/:id ` | PyramidEditor | 8x8 grid editor |
201+ | ` /:workspaceId/ diagrams ` | DiagramsPage | Diagram list |
202+ | ` /:workspaceId/ diagram/:id ` | DiagramEditor | ReactFlow visual editor |
200203
201204#### Product Design & Management (bg-teal-600 / bg-pink-600)
202205| Path | Page | Description |
203206| ------| ------| -------------|
204- | ` /product-definitions ` | ProductDefinitionsPage | Product def list |
205- | ` /product-definition/:id ` | ProductDefinitionEditor | Hierarchical mindmap editor |
206- | ` /ui-ux-architectures ` | UiUxArchitecturesPage | UI/UX list |
207- | ` /ui-ux-architecture/:id ` | UiUxArchitectureEditorPage | Theme/component/page editor |
207+ | ` /:workspaceId/ product-definitions ` | ProductDefinitionsPage | Product def list |
208+ | ` /:workspaceId/ product-definition/:id ` | ProductDefinitionEditor | Hierarchical mindmap editor |
209+ | ` /:workspaceId/ ui-ux-architectures ` | UiUxArchitecturesPage | UI/UX list |
210+ | ` /:workspaceId/ ui-ux-architecture/:id ` | UiUxArchitectureEditorPage | Theme/component/page editor |
208211
209212#### Knowledge Base (bg-amber-600)
210213| Path | Page | Description |
211214| ------| ------| -------------|
212- | ` /context-documents ` | ContextDocumentsPage | Document list |
213- | ` /context-document/:id ` | ContextDocumentEditor | Rich text editor |
214- | ` /directory/:id ` | DirectoryDocumentsPage | Directory contents |
215+ | ` /:workspaceId/ context-documents ` | ContextDocumentsPage | Document list |
216+ | ` /:workspaceId/ context-document/:id ` | ContextDocumentEditor | Rich text editor |
217+ | ` /:workspaceId/ directory/:id ` | DirectoryDocumentsPage | Directory contents |
215218
216219#### Technical (bg-purple-600 / bg-blue-600)
217220| Path | Page | Description |
218221| ------| ------| -------------|
219- | ` /technical-architectures ` | TechnicalArchitecturesPage | Architecture list |
220- | ` /technical-architecture/:id ` | TechnicalArchitectureEditorPage | Architecture editor |
221- | ` /technical-tasks ` | TechnicalTaskBoard | Kanban board |
222- | ` /technical-task/:id ` | TechnicalTaskDetail | Task detail view |
222+ | ` /:workspaceId/ technical-architectures ` | TechnicalArchitecturesPage | Architecture list |
223+ | ` /:workspaceId/ technical-architecture/:id ` | TechnicalArchitectureEditorPage | Architecture editor |
224+ | ` /:workspaceId/ technical-tasks ` | TechnicalTaskBoard | Kanban board |
225+ | ` /:workspaceId/ technical-task/:id ` | TechnicalTaskDetail | Task detail view |
223226
224227#### AI Apps (bg-violet-600)
225228| Path | Page | Description |
226229| ------| ------| -------------|
227- | ` /ai-chat ` | AiChatPage | Session-based AI chat |
228- | ` /workspace/:id /ai-settings ` | AiSettingsPage | Agent configuration |
230+ | ` /:workspaceId/ ai-chat ` | AiChatPage | Session-based AI chat |
231+ | ` /:workspaceId /ai-settings ` | AiSettingsPage | Agent configuration |
229232
230233---
231234
@@ -445,34 +448,39 @@ agents, sessions — writes via Admin SDK (bypasses rules)
445448
446449## Agent Island (3D Agent Bar)
447450
448- Global floating bar at center-bottom of all authenticated pages displaying workspace agents as interactive 3D characters .
451+ Floating glassmorphism bar at center-bottom of workspace pages. Agents rendered as blur-styled buttons with name, position, and color. Clicking an agent opens a per-agent chat modal .
449452
450453### Component Tree
451454` ` `
452455AuthenticatedLayout
453456 └── AgentIsland (fixed bottom - center , glassmorphism )
454- └── React .lazy → AgentCharacter × N
455- └── < Canvas > (R3F )
456- └── AgentModel (GLTF + animation cycling )
457+ ├── AgentButton × N (blur / glass styled , color accent )
458+ ├── " All Agents" button → / ai - chat
459+ ├── " AI Settings" button → / ai - settings
460+ └── AgentChatModal (Dialog with chat session )
461+ └── useAgentChat hook (shared with AiChatPage )
457462` ` `
458463
459464### Files
460465| File | Purpose |
461466|------|---------|
462- | ` components / AgentIsland / AgentIsland .tsx ` | Container: glassmorphism bar, lazy loading, route-based visibility |
463- | ` components / AgentIsland / AgentCharacter .tsx ` | Per-agent 3D Canvas with GLTF model and animation cycling |
467+ | ` components / AgentIsland / AgentIsland .tsx ` | Container: glassmorphism bar, visibility logic, modal state |
468+ | ` components / AgentIsland / AgentButton .tsx ` | Per-agent blur/glass button with color, name, position, status badge |
469+ | ` components / AgentIsland / AgentChatModal .tsx ` | Dialog with session sidebar + chat area for a specific agent |
464470| ` components / AgentIsland / useAgentIslandAgents .ts ` | Hook: fetches agents via ` getAgents (workspaceId )` |
471+ | ` components / AgentIsland / useAgentLastSessionStatus .ts ` | Hook: fetches last session status per agent |
472+ | ` hooks / useAgentChat .ts ` | Extracted chat logic shared between AgentChatModal and AiChatPage |
473+ | ` lib / agent - colors .ts ` | Color palette (12 colors) + ` getRandomAgentColor ()` helper |
465474
466- ### 3D Stack
467- - **@react-three/fiber**: React renderer for Three.js
468- - **@react-three/drei**: ` useGLTF ` (GLTF/Draco loading), ` useAnimations ` (clip management)
469- - **Model**: ` public / agents / gm .gltf ` — shared model for all agents (Draco-compressed)
470- - **Animations**: ` idle ` , ` walk ` , ` happy ` , ` sad ` , ` standing_jump ` , ` jump_run ` , ` running `
475+ ### Agent Data Model (new fields)
476+ - ` position : string ` — Agent role (e.g., "General Manager", "Designer")
477+ - ` color : string ` — Hex color from palette, used for button accent
478+ - Default GM agent: name "Jeana", position "General Manager", color "#6366f1"
471479
472480### Behavior
473- - Each agent rendered as a separate ` < Canvas > ` with transparent background
474- - Characters overflow above the island container (upper body/head sticks out )
475- - Animation cycle: ` idle ` → ` walk ` → ` happy ` with crossfade, staggered per agent
476- - Click navigates to ` / ai - chat `
477- - Hidden on ` / ai - chat ` page, max 6 visible agents with "+N" overflow badge
478- - Lazy-loaded to keep Three.js out of the initial JS bundle
481+ - Max 5 agents visible, configurable via ` workspace . islandAgentIds ` in AI Settings
482+ - Click agent → opens ` AgentChatModal ` (not navigation )
483+ - Right-side buttons: "All Agents" (→ /ai-chat), "AI Settings" (→ /ai-settings)
484+ - Status badge on agent buttons: green pulse = active session, amber = paused, none = no session
485+ - Hidden on ` / ai - chat ` page and ` / workspaces ` page
486+ - Context awareness: modal uses ` useCurrentPageContext ` to pass page context to agent
0 commit comments