Skip to content

Commit 7d685e0

Browse files
fazxesclaude
andcommitted
Migrate from VS Code/Electron to Tauri 2.0 with CodeMirror 6
- Replace Monaco editor with CodeMirror 6 for syntax highlighting - Add Tauri 2.0 backend with Rust workspace structure - Create crates: snowflake-core, snowflake-fs, snowflake-lsp, snowflake-terminal, snowflake-git, snowflake-ai, snowflake-search - Add custom dark/light themes matching app colors (github-dark style) - Add file editing with save functionality (Cmd-S) - Add modified indicator (coral dot) on file tabs - Replace VS Code provider with Tauri communication layer - Theme-aware editor that syncs with app light/dark mode 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ba16a52 commit 7d685e0

87 files changed

Lines changed: 11410 additions & 749 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
26+
# Rust
27+
target/

‎CLAUDE.md‎

Lines changed: 61 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# CLAUDE.md
22

3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
3+
This file provides guidance to Claude Code when working with the Snowflake codebase.
44

55
## Project Overview
66

7-
Orbit Agent UI is a React 19 + TypeScript frontend for an AI coding assistant, built with Vite and Tailwind CSS v4. The UI provides a multi-panel IDE-like interface with chat, terminal, file browser, and code review capabilities.
7+
Snowflake is a modern AI-powered code editor built with **Tauri 2** (Rust backend) and **React 19** (TypeScript frontend). It features a multi-panel IDE-like interface with chat, terminal, file browser, and code review capabilities.
8+
9+
**Key Technologies:**
10+
11+
- **Frontend:** React 19 + TypeScript + Vite + Tailwind CSS v4
12+
- **Backend:** Tauri 2 (Rust) - _to be implemented_
13+
- **Editor:** CodeMirror 6 - _to be implemented_ (currently using Shiki for syntax highlighting)
14+
- **Terminal:** xterm.js
15+
- **State:** Zustand + Immer
816

917
## Commands
1018

@@ -24,6 +32,25 @@ npm run ci # Full CI: typecheck + lint + build
2432

2533
## Architecture
2634

35+
### Frontend-Backend Communication
36+
37+
The frontend uses a `useTauri` hook (`src/hooks/use-tauri.ts`) for communication with the Tauri backend. Messages are validated with Zod schemas.
38+
39+
```typescript
40+
// Send message to backend
41+
const { postMessage } = useTauri();
42+
postMessage({ type: 'message:send', session_id, content });
43+
44+
// Listen for backend messages
45+
useTauri({
46+
onMessage: (message) => {
47+
if (message.type === 'agent:chunk') {
48+
// Handle streaming response
49+
}
50+
},
51+
});
52+
```
53+
2754
### State Management
2855

2956
- **Zustand with Immer** for all global state (`src/stores/`)
@@ -52,9 +79,10 @@ npm run ci # Full CI: typecheck + lint + build
5279

5380
### Custom Hooks
5481

82+
- `use-tauri` - Tauri backend communication
5583
- `use-chat`, `use-agent`, `use-terminal` - Domain-specific state/effects
5684
- `use-keyboard-shortcuts` - Global hotkeys
57-
- `use-vscode` - VS Code extension messaging (postMessage API)
85+
- `use-chat-messages` - Chat message handling with streaming
5886

5987
## Code Style
6088

@@ -63,7 +91,7 @@ npm run ci # Full CI: typecheck + lint + build
6391
- **No `any`** - All unsafe operations are errors
6492
- **Explicit return types** on functions
6593
- **Consistent type imports** - Use `import type { }` separately
66-
- **Import order** - External → Internal → Types, alphabetized
94+
- **Import order** - External -> Internal -> Types, alphabetized
6795
- **No console.log** - Only `warn`/`error` allowed
6896
- **Strict boolean expressions** - No implicit truthy checks
6997
- **Exhaustive switches** - All cases must be handled
@@ -80,18 +108,36 @@ npm run ci # Full CI: typecheck + lint + build
80108
- Ternary for conditional rendering (ESLint enforced)
81109
- Props interfaces marked `readonly`
82110

83-
## CI/CD
111+
## Protocol Types
84112

85-
See `docs/CI-CD-GUIDE.md` for full details.
113+
All message types defined in `src/types/protocol.ts` with Zod schemas:
86114

87-
- **CI**: Parallel jobs for typecheck, lint, test, build on push/PR to main/develop
88-
- **Dependabot**: Weekly updates, auto-merge for minor/patch
89-
- **Release**: Tag `v*` triggers GitHub Release with build artifacts
115+
### Frontend -> Backend (WebviewMessage)
90116

91-
```bash
92-
# Run CI locally before pushing
93-
npm run ci
117+
- `message:send` - Send chat message
118+
- `file:read`, `file:write` - File operations
119+
- `terminal:create`, `terminal:write` - Terminal operations
94120

95-
# Create a release
96-
git tag v1.0.0 && git push --tags
97-
```
121+
### Backend -> Frontend (ExtensionMessage)
122+
123+
- `agent:chunk`, `agent:complete` - AI responses
124+
- `tool:start`, `tool:end` - Tool execution
125+
- `file:content`, `file:tree:response` - File data
126+
- `terminal:output`, `terminal:created` - Terminal data
127+
128+
## TODO: Tauri Backend Integration
129+
130+
The Tauri Rust backend needs to be implemented to handle:
131+
132+
- Claude AI integration
133+
- File system operations
134+
- Terminal PTY management
135+
- Session persistence
136+
137+
## TODO: CodeMirror 6 Integration
138+
139+
Replace current Shiki-based syntax highlighting with CodeMirror 6 for:
140+
141+
- Full code editing capabilities
142+
- Language server protocol support
143+
- Better performance for large files

0 commit comments

Comments
 (0)