Overview
This cookbook recreates a Cursor-like editor layout: a left file tree, a center editor, and an AI assistant panel on the right. The aim is to keep code and chat in the same workflow.
Page Structure
- Left sidebar: file tree + search
- Center: editor tabs + editor canvas
- Right:
Sidekickpanel for AI help - Bottom: status bar
Ingredients
SidekickProvider+Sidekick- Tabs for open files
- Scrollable file tree
- Editor surface (Monaco, CodeMirror, or placeholder)
Steps
- Create a 3-column layout with
SidekickProviderandSidekickInset. - Build a file tree in the left sidebar with a filter input.
- Add tabs and a code editor in the center.
- Add
Sidekickon the right with aPromptInputfooter.
Layout Example
<SidekickProvider defaultOpen>
<SidekickInset className="grid grid-cols-[240px_1fr]">
<aside className="border-r p-4">File tree</aside>
<main className="p-4">Editor</main>
</SidekickInset>
<Sidekick>
<SidekickHeader>Assistant</SidekickHeader>
<SidekickContent>
<Conversation>
<ConversationContent>{/* messages */}</ConversationContent>
</Conversation>
</SidekickContent>
<SidekickFooter>
<PromptInput onSubmit={handleSubmit}>
<PromptInput.Body>
<PromptInput.Textarea placeholder="Ask about this file..." />
</PromptInput.Body>
<PromptInput.Footer>
<PromptInput.Tools />
<PromptInput.Submit />
</PromptInput.Footer>
</PromptInput>
</SidekickFooter>
</Sidekick>
</SidekickProvider>Enhancements
- Add file context chips inside the prompt header
- Stream answers with
useGatewayChat - Persist conversations per file or project