Agent Zero AI framework
fix(sidebar-folders): clarify status and activity filters
Alessandro4d327a3028e0
diff --git a/plugins/_sidebar_folders/AGENTS.md b/plugins/_sidebar_folders/AGENTS.mdindex 591aa5faf..fa9800375 100644--- a/plugins/_sidebar_folders/AGENTS.md+++ b/plugins/_sidebar_folders/AGENTS.md@@ -44,6 +44,7 @@- Project moves and ordering use drag and drop, without move actions in thread menus. Folder-row creation uses the same `chat_add_on` icon as the New chat menu action.- Header, folder, chat, worker, and task action buttons share hover/focus treatment. The two Chats header icons use `1.125rem` inside the existing button frames, preserving action-column alignment with the smaller row icons. Header borders appear only on hover; row buttons retain their resting borders. Use `--spacing-xs` between buttons and at row ends. Keep these sidebar-scoped overrides in the plugin's header extension and retain row visibility behavior and confirmation states.- The options menu contains only View (Folders / Flat mode), Sort by, Project, Status, and Last activity. Keep native dropdowns consistent with Settings: muted borders, the small radius token, and an opaque menu-colored surface so native option lists remain readable. Use `--spacing-xs` gaps between fields and `--spacing-sm` outer padding. Show focus outlines for keyboard navigation, without a lingering pointer-click ring. Folder expansion belongs to individual folder rows.+- Sort copy uses **Last active**. Chats and tasks share **All**, **Working**, and **Idle**. A family is Working if any member runs without being paused or disabled; otherwise it is Idle, including completed/waiting chats, paused chats, and disabled tasks.## Verificationdiff --git a/plugins/_sidebar_folders/README.md b/plugins/_sidebar_folders/README.mdindex fcf5e3202..2a47edd60 100644--- a/plugins/_sidebar_folders/README.md+++ b/plugins/_sidebar_folders/README.md@@ -11,6 +11,6 @@ Organize chats and tasks into project folders. Folder view is on by default; use- Drag folders or chats between rows to reorder them. Reordering folders, chats, or tasks automatically selects **Manual order**. Reorder pins within their section without changing their projects; use the row menu to pin or unpin.- Drop a chat onto a project folder to switch its project context, or onto **No project** to remove its project assignment. Its parallel children stay with it. Stop a running chat and its parallel calls before moving them. Existing transcript and files are retained; this changes the project used for subsequent work, without relocating files.- Scheduler tasks have their own pinned section and project folders. Their configured project stays unchanged when reordered.-- Chats and tasks default to **Created time**, newest first, so new messages do not change their position. Recent activity, name, and manual order are also available. Filter by project, working/paused status, or recent activity. A matching parallel child keeps its parent visible.+- Chats and tasks default to **Created time**, newest first, so new messages do not change their position. **Last active**, name, and manual order are also available. Filter by project, **Working** / **Idle** status, or recent activity. Idle includes waiting or completed chats, paused chats, and disabled tasks. A working parallel child keeps its family under Working.View and sort settings, project pins, and manual order are saved for the instance. Folder expansion is saved in the browser; filters apply to the current page. Disabling this plugin restores the standard sidebar.diff --git a/plugins/_sidebar_folders/extensions/webui/chats-header-controls/options.html b/plugins/_sidebar_folders/extensions/webui/chats-header-controls/options.htmlindex bb62c1357..bbc7318a7 100644--- a/plugins/_sidebar_folders/extensions/webui/chats-header-controls/options.html+++ b/plugins/_sidebar_folders/extensions/webui/chats-header-controls/options.html@@ -27,7 +27,7 @@<label class="sidebar-option-field"><span>Sort by</span><select :value="$store.sidebarFolders.config.sort_by" :disabled="$store.sidebarFolders.busy"@change="$store.sidebarFolders.setConfig({ sort_by: $event.target.value })">- <option value="recent">Recent activity</option><option value="created">Created time</option>+ <option value="recent">Last active</option><option value="created">Created time</option><option value="name">Name</option><option value="manual">Manual order</option></select></label>@@ -41,7 +41,8 @@</label><label class="sidebar-option-field"><span>Status</span><select x-model="$store.sidebarFolders.statusFilter">- <option value="all">All</option><option value="running">Working</option><option value="paused">Paused / disabled</option>+ <option value="all">All</option><option value="running">Working</option>+ <option value="idle">Idle</option></select></label><label class="sidebar-option-field"><span>Last activity</span>diff --git a/plugins/_sidebar_folders/tests/test_frontend.mjs b/plugins/_sidebar_folders/tests/test_frontend.mjsindex ee99e04c4..f248550e2 100644--- a/plugins/_sidebar_folders/tests/test_frontend.mjs+++ b/plugins/_sidebar_folders/tests/test_frontend.mjs@@ -66,6 +66,22 @@ assert.deepEqual(store.family(contexts[0], "chat").map((row) => row.id), ["a", "store.statusFilter = "running";assert.deepEqual(chats.topLevelContexts().map((row) => row.id), ["a"], "working children keep their parent visible");assert.deepEqual(store.groups("task"), [], "parallel children never become scheduler tasks");+store.statusFilter = "idle";+assert.deepEqual(chats.topLevelContexts().map((row) => row.id), ["b", "c"], "a working descendant keeps its entire family out of Idle");+contexts[3].paused = true;+tasks.tasks[0].state = "disabled";+assert.deepEqual(chats.topLevelContexts().map((row) => row.id), ["b", "c", "a"], "paused and inactive chats are Idle");+assert.equal(store.groups("task")[0].rows[0].id, "task", "disabled tasks use the same Idle filter");+store.statusFilter = "running";+assert.deepEqual(chats.topLevelContexts(), [], "a paused worker is not Working even while its execution task is alive");+assert.deepEqual(store.groups("task"), [], "disabled tasks are not Working");+tasks.tasks[0].state = "idle";+tasks.tasks[0].running = true;+assert.equal(store.groups("task")[0].rows[0].id, "task", "running tasks use the same Working filter");+store.statusFilter = "idle";+assert.deepEqual(store.groups("task"), [], "working tasks do not also appear under Idle");+tasks.tasks[0].running = false;+assert.equal(store.groups("task")[0].rows[0].id, "task", "waiting tasks also count as Idle");store.statusFilter = "all";store.config.sort_by = "name";assert.deepEqual(store.groups("chat")[0].rows.map((row) => row.id), ["b", "a"]);diff --git a/plugins/_sidebar_folders/webui/sidebar-folders-store.js b/plugins/_sidebar_folders/webui/sidebar-folders-store.jsindex 5379536ba..c787cc31d 100644--- a/plugins/_sidebar_folders/webui/sidebar-folders-store.js+++ b/plugins/_sidebar_folders/webui/sidebar-folders-store.js@@ -129,9 +129,11 @@ export const store = createStore("sidebarFolders", {matches(row, kind) {if (this.projectFilter !== "*" && (row.project?.name || "") !== this.projectFilter) return false;if (this.statusFilter === "all" && this.activityFilter === "all") return true;- return this.family(row, kind).some((item) => {- if (this.statusFilter === "running" && !item.running) return false;- if (this.statusFilter === "paused" && !item.paused && item.state !== "disabled") return false;+ const family = this.family(row, kind);+ const working = family.some((item) => item.running && !item.paused && item.state !== "disabled");+ if (this.statusFilter === "running" && !working) return false;+ if (this.statusFilter === "idle" && working) return false;+ return family.some((item) => {if (this.activityFilter !== "all") {const cutoff = Date.now() - Number(this.activityFilter) * 86400000;if (timestamp(item.last_message || item.created_at) < cutoff) return false;