Skip to content

Commit d1e193b

Browse files
committed
agent island and sidebar adjustment
1 parent 5a9a624 commit d1e193b

11 files changed

Lines changed: 51488 additions & 47 deletions

File tree

app/architecture.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +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)
4647
│ ├── AgentSettings/ # AgentConfigModal
4748
│ ├── Board/ # PyramidBoard, Block, BlockModal
4849
│ ├── Chat/ # (reserved for future chat components)
@@ -439,3 +440,39 @@ agents, sessions — writes via Admin SDK (bypasses rules)
439440
5. **Global context**: Workspace-level context aggregation injected into every AI interaction.
440441
6. **Workspace isolation**: All entities scoped by userId + workspaceId. Workspace deletion cascades.
441442
7. **Shadcn UI**: All primitives from Radix via Shadcn. Custom components compose these primitives.
443+
444+
---
445+
446+
## Agent Island (3D Agent Bar)
447+
448+
Global floating bar at center-bottom of all authenticated pages displaying workspace agents as interactive 3D characters.
449+
450+
### Component Tree
451+
```
452+
AuthenticatedLayout
453+
└── AgentIsland (fixed bottom-center, glassmorphism)
454+
└── React.lazyAgentCharacter × N
455+
└── <Canvas> (R3F)
456+
└── AgentModel (GLTF + animation cycling)
457+
```
458+
459+
### Files
460+
| File | Purpose |
461+
|------|---------|
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 |
464+
| `components/AgentIsland/useAgentIslandAgents.ts` | Hook: fetches agents via `getAgents(workspaceId)` |
465+
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`
471+
472+
### 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

app/dev-dist/sw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ define(['./workbox-5a5d9309'], (function (workbox) { 'use strict';
8282
"revision": "3ca0b8505b4bec776b69afdba2768812"
8383
}, {
8484
"url": "index.html",
85-
"revision": "0.eqg8g7k0bus"
85+
"revision": "0.6sb5d33p71k"
8686
}], {});
8787
workbox.cleanupOutdatedCaches();
8888
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

0 commit comments

Comments
 (0)