Quick Composer
Relevant source files
The following files were used as context for generating this wiki page:
Quick Composer is a floating, lightweight interface that allows users to start AI agent sessions, manage project contexts, and execute commands from a global overlay. It provides a subset of the full Composer functionality, optimized for rapid interaction and global accessibility. Sources: src/features/quick-composer/ui/QuickComposer.tsx, quick-composer.html
Architecture and UI Components
The Quick Composer operates within a dedicated webview window. It uses a transparent background to allow the interface to appear as a floating card over other applications. Sources: quick-composer.html:10-18
Component Hierarchy
The main entry point is the QuickComposer component, which manages the local state for projects, models, and attachments. It contains several specialized sub-components:
- QuickWorkspaceControls: Manages the active workspace, git branch, and worktree settings. Sources: src/features/quick-composer/ui/QuickComposer.tsx:143-151
- QuickModelSelector: Allows users to choose between available AI harnesses and specific models. Sources: src/features/quick-composer/ui/QuickComposer.tsx:415-429
- QuickPermissions: Configures the runtime mode (e.g., supervised vs. autonomous). Sources: src/features/quick-composer/ui/QuickComposer.tsx:432-436
- Attachment Display: Renders
AttachmentChipcomponents for files or screenshots attached to the prompt. Sources: src/features/quick-composer/ui/QuickComposer.tsx:327-336
Layout and Styling
The interface is structured as a vertical stack with a maximum height of 520px. The prompt area grows dynamically up to 220px before scrolling. Sources: src/features/quick-composer/ui/QuickComposer.tsx:75, src/features/quick-composer/ui/QuickComposer.tsx:132
The diagram shows the vertical layout structure of the Quick Composer UI. Sources: src/features/quick-composer/ui/QuickComposer.tsx:132-472
Core Logic and Data Flow
Quick Composer coordinates data between local storage, the Tauri backend, and the active workspace.
Interaction Workflow
- Show Event: When the composer is shown, it requests the latest model catalog and loads recent projects from local storage. Sources: src/features/quick-composer/ui/QuickComposer.tsx:96-113
- Input Processing: As the user types, the system checks for leading slash commands to set the interaction mode. Sources: src/features/quick-composer/ui/QuickComposer.tsx:82-88
- Submission: On submission, the
quick_composer_submitTauri command is invoked with aQuickLaunchpayload. Sources: src/features/quick-composer/ui/QuickComposer.tsx:219-242
The sequence diagram illustrates the lifecycle of a single interaction within the Quick Composer. Sources: src/features/quick-composer/ui/QuickComposer.tsx:103, src/features/quick-composer/ui/QuickComposer.tsx:236
Command and Mode Handling
Quick Composer uses leading slash commands to define the "intent" of the session. These commands are visually highlighted in the UI using ModeCommandText. Sources: src/features/quick-composer/ui/QuickComposer.tsx:342-350
| Command | Intent | Description |
|---|---|---|
/plan | plan | Investigates the request and generates a reviewable Markdown plan. Sources: src/features/sessions/model/plan.ts:14-25 |
/orchestrate | orchestrate | Plans and coordinates work across multiple agents. Sources: src/features/sessions/model/orchestratorCommand.ts |
/operator | default | Grants the thread access to Rebase-specific tools. Sources: src/features/quick-composer/ui/QuickComposer.tsx:87 |
/draft | N/A | Saves the message as a draft without initiating an agent turn. Sources: src/features/quick-composer/ui/QuickComposer.tsx:224 |
Slash Command Parsing
The quickPromptMode function identifies the mode by checking the beginning of the text against MODE_NAMES. If a mode is found (excluding operator), the command prefix is stripped from the prompt before being sent to the agent. Sources: src/features/quick-composer/ui/QuickComposer.tsx:82-89
Attachment Management
Quick Composer supports attaching files and screenshots if the selected harness has the capability.
- Screenshot Capture: Invokes
attachments.takeScreenshot()to capture a specific area or window. Sources: src/features/quick-composer/ui/QuickComposer.tsx:465-469 - File Drop: Uses the
useQuickAttachmentshook to handleonDropandonPasteevents. Sources: src/features/quick-composer/ui/QuickComposer.tsx:128 - Harness Support: The interface disables attachment buttons if
harnessSupportsAttachments(harness)returns false. Sources: src/features/quick-composer/ui/QuickComposer.tsx:127
Data Models
QuickLaunch Object
The primary data structure for initiating sessions from the Quick Composer. Sources: src/features/quick-composer/model/quickComposer.ts
| Field | Type | Description |
|---|---|---|
prompt | string | The text content of the user request. |
cwd | string | The target project directory. |
harness | HarnessId | The AI provider (e.g., Claude, OpenAI). |
model | string | The specific model ID. |
intent | "plan" | "orchestrate" | undefined | The specialized execution mode. |
attachments | Attachment[] | Array of file/image data. |
reveal | boolean | Whether to open the main Rebase window after submission. |
Summary
Quick Composer acts as a global gateway for Rebase, enabling users to interact with AI agents without leaving their current workflow. It manages complex state including workspace context, model configurations, and file attachments while maintaining a minimal footprint through a dedicated Tauri webview. Sources: src/features/quick-composer/ui/QuickComposer.tsx, src/features/quick-composer/model/quickComposer.ts