aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/assistant/test_files.js
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-16 16:06:33 +0200
committerDanilo M. <danix@danix.xyz>2026-10-16 16:06:33 +0200
commitf6ceae477979b32869c0c17e2b1fc05477d6eb81 (patch)
tree4fecf207f449e7a454d4ee80e28407ddfa63df2d /desktop/assistant/test_files.js
parent9a0c898a7a3d6c134626f05508c63840477e4be3 (diff)
downloadquickshell-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/test_files.js')
-rw-r--r--desktop/assistant/test_files.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/desktop/assistant/test_files.js b/desktop/assistant/test_files.js
index 5ece64f..80a855d 100644
--- a/desktop/assistant/test_files.js
+++ b/desktop/assistant/test_files.js
@@ -23,12 +23,13 @@ const F = new Function(src + "\nreturn { kind, chats, fromUrl, file, name };")()
const cases = {
"/a/report.pdf": "pdf", "/a/Report.PDF": "pdf", "/a/x.png": "image", "/a/x.JPEG": "image",
"/a/clip.mp4": "video", "/a/c.MKV": "video", "/a/src.tar.gz": "archive", "/a/b.7z": "archive",
- "/a/main.py": "text", "/a/notes.md": "text", "/a/pkg.SlackBuild": "text",
+ "/a/main.py": "code", "/a/notes.md": "text", "/a/pkg.SlackBuild": "code",
+ "/a/data.csv": "text", "/a/README.rst": "text", "/a/a.txt": "text", "/a/c.json": "code",
"/a/Makefile": "other", "/a/.bashrc": "other", "/a/x.bin": "other", "/a/dir.d/noext": "other",
};
for (const [p, k] of Object.entries(cases)) assert.strictEqual(F.kind(p), k, p);
-assert.ok(F.chats("pdf") && F.chats("image") && F.chats("text"));
+assert.ok(F.chats("pdf") && F.chats("image") && F.chats("text") && F.chats("code"));
assert.ok(!F.chats("video") && !F.chats("archive") && !F.chats("other"));
assert.strictEqual(F.fromUrl("file:///home/you/My%20Docs/caf%C3%A9.pdf"), "/home/you/My Docs/café.pdf");