diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-16 16:06:33 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-16 16:06:33 +0200 |
| commit | f6ceae477979b32869c0c17e2b1fc05477d6eb81 (patch) | |
| tree | 4fecf207f449e7a454d4ee80e28407ddfa63df2d /desktop/assistant/Files.js | |
| parent | 9a0c898a7a3d6c134626f05508c63840477e4be3 (diff) | |
| download | quickshell-f6ceae477979b32869c0c17e2b1fc05477d6eb81.tar.gz quickshell-f6ceae477979b32869c0c17e2b1fc05477d6eb81.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'desktop/assistant/Files.js')
| -rw-r--r-- | desktop/assistant/Files.js | 10 |
1 files changed, 7 insertions, 3 deletions
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"; } |
