From f6ceae477979b32869c0c17e2b1fc05477d6eb81 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 16 Oct 2026 16:06:33 +0200 Subject: feat(assistant): Ask presets in the file state A row of canned questions matching every staged file's kind, plus Compare for two or more files: one click asks it, Shift+click puts it in the input to edit first. Defaults live in Presets.js and the list in use in Prefs, so a future drawer settings page can edit it; a saved list that does not validate reads as the defaults. Each prompt asks for an answer in the document's language. Code and configuration get their own kind, so a script is offered Explain and Review rather than Summarize. Button's clicked signal carries the mouse event for the Shift check. Co-Authored-By: Claude Opus 5.5 --- desktop/assistant/Files.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'desktop/assistant/Files.js') diff --git a/desktop/assistant/Files.js b/desktop/assistant/Files.js index bcfe1f0..825aed1 100644 --- a/desktop/assistant/Files.js +++ b/desktop/assistant/Files.js @@ -17,17 +17,20 @@ // ponytail: the daemon also takes any text/* mime type; a file of such a // type with a suffix not listed here reads as "other" and is not offered // chat. Add the suffix when one shows up. -const TEXT = [".py", ".c", ".h", ".cpp", ".hpp", ".rs", ".go", ".js", ".ts", ".jsx", +// Text splits into prose and data (text) and code or configuration (code), +// so each gets the presets that fit it; the daemon sees one text kind. +const TEXT = [".md", ".rst", ".txt", ".csv"]; +const CODE = [".py", ".c", ".h", ".cpp", ".hpp", ".rs", ".go", ".js", ".ts", ".jsx", ".tsx", ".sh", ".bash", ".zsh", ".lua", ".rb", ".pl", ".php", ".java", ".kt", ".swift", ".sql", ".toml", ".yaml", ".yml", ".json", ".ini", - ".cfg", ".conf", ".md", ".rst", ".txt", ".csv", ".xml", ".html", ".css", + ".cfg", ".conf", ".xml", ".html", ".css", ".diff", ".patch", ".slackbuild", ".info", ".desktop", ".service", ".qml"]; const IMAGE = [".png", ".jpg", ".jpeg", ".gif", ".webp"]; const VIDEO = [".mp4", ".mkv", ".webm", ".mov", ".avi", ".m4v"]; const ARCHIVE = [".zip", ".tar", ".gz", ".tgz", ".xz", ".txz", ".bz2", ".zst", ".7z", ".rar"]; // Kinds chat takes; the rest only get local actions. -const CHAT = ["text", "image", "pdf"]; +const CHAT = ["text", "code", "image", "pdf"]; function name(path) { return path.slice(path.lastIndexOf("/") + 1); } @@ -40,6 +43,7 @@ function kind(path) { if (VIDEO.includes(ext)) return "video"; if (ARCHIVE.includes(ext)) return "archive"; if (TEXT.includes(ext)) return "text"; + if (CODE.includes(ext)) return "code"; return "other"; } -- cgit v1.2.3