forked from smallcloudai/refact
-
-
Notifications
You must be signed in to change notification settings - Fork 5
GUI Hooks
refact-planner edited this page Jun 7, 2026
·
1 revision
The GUI relies on many narrow custom hooks to isolate subscriptions, actions, messaging, and IDE integration concerns.
| Hook | Purpose |
|---|---|
useChatActions |
Provides chat-related actions and mutation helpers. |
useChatSubscription |
Subscribes to a single chat’s updates. |
useAllChatsSubscription |
Subscribes to updates across all chats. |
useEnsureSubscriptionConnected |
Ensures a subscription stays connected. |
useEventBusForApp |
Connects app-level event bus events. |
useEventBusForIDE |
Connects IDE-related event bus events. |
usePostMessage |
Sends postMessage traffic across frame / window boundaries. |
useCheckpoints |
Exposes checkpoint-related state and actions. |
The codebase uses 70+ custom hooks, so the convention is to keep each hook narrowly focused on one job. That keeps behavior easier to reason about, avoids oversized abstractions, and makes reuse predictable.
Hooks in this area commonly wrap one of three concerns:
- data subscription and connection management
- event bus wiring for app or IDE boundaries
- explicit user actions or messages
That separation helps keep chat UI components thin and keeps side effects localized to the hook layer.
See also: GUI Chat Flow, Context Compression
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