mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-27 17:36:25 +02:00
add cmd+k palette with chat mode that captures editor cursor context
Cmd+K (Ctrl+K on Win/Linux) now opens a unified palette with two modes: Chat (default) and Search (existing behavior). Tab cycles between them. In Chat mode, if the user triggered the shortcut from the markdown editor, the palette auto-attaches a removable chip showing the note path and precise cursor line. Enter sends the prompt to the right-sidebar copilot — opening the sidebar if closed and starting a fresh chat tab — with the chip carried as a FileMention whose lineNumber is forwarded to the agent as "... at <path> (line N)" so the agent can use workspace-readFile with offset to fetch the right slice on demand. Line numbers are computed against the same getMarkdownWithBlankLines serializer used to write notes to disk, so the reference is byte-identical to what the agent reads back. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4a2dfbf16f
commit
b3066a0b7a
6 changed files with 511 additions and 210 deletions
|
|
@ -566,7 +566,8 @@ export function convertFromMessages(messages: z.infer<typeof Message>[]): ModelM
|
|||
for (const part of msg.content) {
|
||||
if (part.type === "attachment") {
|
||||
const sizeStr = part.size ? `, ${formatBytes(part.size)}` : '';
|
||||
attachmentLines.push(`- ${part.filename} (${part.mimeType}${sizeStr}) at ${part.path}`);
|
||||
const lineStr = part.lineNumber ? ` (line ${part.lineNumber})` : '';
|
||||
attachmentLines.push(`- ${part.filename} (${part.mimeType}${sizeStr}) at ${part.path}${lineStr}`);
|
||||
} else {
|
||||
textSegments.push(part.text);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue