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/test_files.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'desktop/assistant/test_files.js') 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"); -- cgit v1.2.3