mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-20 20:39:10 +00:00
Upvote BrowserOS launch bak new agent prompt confetti bak -- confetti in new agent bak bak bak bak bak
Sidepanel V2 Implementation
Phase 1 Complete ✅
What We Built
-
Directory Structure
- Clean separation of concerns
- Organized by feature type (stores, hooks, components)
-
Chat Store (
stores/chatStore.ts)- Simple Zustand store with Zod schemas
- Messages, processing state, tab selection, and error handling
- Clean actions with single responsibilities
- Useful selectors for common operations
-
Message Handler (
hooks/useMessageHandler.ts)- Listens to Chrome extension port messages
- Processes different message types cleanly
- Simple streaming message tracking
- No complex buffering or debouncing
-
App Component (
App.tsx)- Minimal entry point for v2
- Shows connection status and message count
- Debug UI to verify everything works
-
Feature Flag (in
index.tsx)- Use
?v2query param to enable v2 - Or set
USE_V2=trueenvironment variable - Defaults to v1 for safety
- Use
Testing V2
- Build the extension:
npm run build:dev - Open the sidepanel with
?v2in the URL - You should see the minimal Phase 1 UI
- Send messages from the background - they should appear in the debug list
Running Tests
npm test -- src/sidepanel/v2/stores/chatStore.test.ts
Next Steps (Phase 2)
- Copy TabSelector and MarkdownContent components
- Build Chat, Header, MessageList, and MessageItem components
- Add proper styling
- Replace debug UI with real chat interface