03 - Frontend Overview#
The Helmor frontend is a React application running inside a Tauri webview. It provides the workspace UI, session timeline, code editor, file browser, and terminal — all communicating with the Rust backend via Tauri IPC.
Tech stack#
| Layer | Technology |
|---|---|
| Framework | React 19.2 |
| Bundler | Vite 8 |
| State (module-level) | Zustand |
| State (server) | TanStack React Query with file-system persistence |
| Styling | Tailwind CSS |
| Components | Radix UI (shadcn-style primitives) |
| Editor | Monaco Editor |
| Rich text input | Lexical |
| Terminal | xterm with WebGL renderer |
Project structure#
src/
├── features/ # Feature modules (workspace, session, commit, etc.)
├── components/ # Shared components
│ └── ui/ # Primitives (button, dialog, input, etc.)
├── hooks/ # Shared React hooks
├── stores/ # Zustand stores
├── lib/ # Utilities, query keys, constants
└── App.tsx # Root component
State management#
Zustand handles runtime state that must survive React component unmounts — streaming status, pending permissions, active sessions. These stores exist at module level so Tauri channel callbacks can update them even when the relevant component isn't mounted.
React Query manages server-derived state (workspaces, sessions, messages, settings). Key features:
- Hierarchical query keys for targeted invalidation.
- Opt-in file-system persistence (bypasses webview storage quotas).
- 30-minute GC time; persisted entries live 24 hours.
- Session messages tail-load the 100 most recent for fast workspace switching.
IPC with the backend#
Frontend calls typed wrappers around Tauri's invoke(). For streaming operations (agent messages), Tauri channels emit multiple events into a callback, which updates the Zustand store directly.
Streaming flow:
- Composer submit → optimistic React Query cache update.
- Mark session as "sending" in Zustand.
- Call
invoke("send_agent_message_stream", { request, onEvent }). - Event dispatcher routes backend deltas to the store.
Related#
- Architecture Overview — where frontend fits in the three tiers.
- Backend Overview — what the IPC calls invoke.