group file-browser tasks into category submenus

Every task declares a directory trigger, so right-clicking any folder listed all
fifteen at once — Tag Album offered on a folder of photos. TASK.md gains an
optional `category`, and the context menu nests by it: Run Task > Video > …

Nesting only kicks in when more than one category matches. A .mp4 matches eight
tasks that are all Video, so file menus stay flat rather than gaining a pointless
hop. Known categories lead (Video, Audio, Cleanup); anything else follows
alphabetically with Other last.

Applied to both menus — the right-click one and the ⋮ dropdown — which carried
identical blocks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
brunorezio
2026-07-26 02:26:48 +01:00
co-authored by Claude Opus 5
parent 1d0842cc01
commit 6a77ec22df
4 changed files with 297 additions and 182 deletions
+2
View File
@@ -12,6 +12,7 @@ tasksRouter.get('/', async (ctx) => {
dirName: row.dirName,
name: row.name,
description: row.description,
category: row.category,
triggers: (row.trigger as TriggerConfig[]) ?? [],
mode: row.mode ?? 'agentic',
}));
@@ -29,6 +30,7 @@ tasksRouter.get('/:name', async (ctx) => {
dirName: task.dirName,
name: task.name,
description: task.description,
category: task.category,
mode: task.mode,
inline: task.inline,
language: task.language,