forked from smallcloudai/refact
-
-
Notifications
You must be signed in to change notification settings - Fork 4
GUI Architecture
refact-planner edited this page Jun 7, 2026
·
1 revision
React chat UI architecture for IDE and standalone consumption, centered on Redux state, RTK Query services, and event-driven chat streaming.
React 18.2 + TypeScript 5.8 (strict) + Vite 5.0 + Redux Toolkit 2.2 (RTK Query) + Radix UI/Themes + CSS Modules + Vitest 3.1 + MSW 2.3.
- Builds to
dist/chat/as a browser UMD bundle. - Builds to
dist/events/for event type exports. - Consumed by IDE webviews and standalone web.
flowchart LR
UI[React App] --> Redux[Redux store + RTK Query]
Redux --> LSP[LSP Server :8001]
Redux --> IDE[IDE via postMessage]
LSP -->|chat, tools, caps, models| Redux
IDE -->|file ops, theme, context| Redux
Redux --> UI
From src/:
-
app/— store, middleware, storage -
features/— Redux slices and feature UIs-
Chat/Thread/— multi-thread reducer, selectors, actions, types -
Checkpoints/— workspace rollback -
Config/— global settings and FeatureMenu -
Connection/— SSE connection status -
Customization/— agent modes, subagent forms, tool parameter editor -
FIM/— fill-in-middle debug -
History/— chat history -
Integrations/— integration config -
Knowledge/— memory system and knowledge graph view -
Login/— login page -
Pages/— navigation stack PatchesAndDiffsTracker/-
Providers/— LLM provider config and OAuth -
Tasks/— task management -
ThreadHistory/— thread history view
-
-
components/— reusable UI-
ChatContent/,ChatForm/,IntegrationsView/,Providers/,Sidebar/,Trajectory/,UsageCounter/, etc.
-
-
hooks/— custom hooks -
services/— RTK Query APIs plus chat commands/subscription -
contexts/— abort controllers, internal links -
events/— IDE integration event types and setup -
lib/— library entry -
utils/— utilities, parsing, token math, test helpers
The app is organized around a Redux store created with combineSlices in src/app/store.ts. Feature state is split between:
- global slices like
config,history,pages,sidebar,notifications - chat runtime state in
features/Chat/Thread/ - RTK Query APIs for server-backed resources
The chat layer does not use RTK Query for message streaming. Instead, it uses explicit commands plus an SSE subscription.
Refact on GitHub: https://github.com/JegernOUTT/refact
- Agent Modes
- Agent Tools
- Task Planner & Cards
- Worktrees
- Subagents
- Memory & Knowledge
- Hidden Roles & Plans
- Context Compression
- Scheduler & Cron
- Processes & PTY
- Buddy
- MCP
- Skills, Commands & Hooks
- Marketplace
- Chat System
- Providers
- Caps & Models
- Code Completion (FIM)
- AST
- VecDB
- Exec Runtime
- HTTP API
- Checkpoints & Git
- Voice