Skip to content

Commit 65ac31d

Browse files
cnjackclaude
andcommitted
fix(web): drop unnecessary array spread in sidebar grouping (CI lint)
oxlint's unicorn/no-useless-spread flagged the `[...paths]` snapshot used to delete-while-iterating. Build the path Set directly instead — same behavior, no spread. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 4f65b68 commit 65ac31d

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

web/src/components/Sidebar.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,10 @@ const sidebarGroups = computed<SidebarGroup[]>(() => {
212212
// Group by project.
213213
const map = new Map<string, TaskItem[]>()
214214
for (const task of tasks) pushTask(map, task.project, task)
215-
const paths = new Set(map.keys())
216-
if (projectFilter.value) {
217-
// A single-project filter shows only that folder (the active project is
218-
// re-added below so the open conversation is never hidden).
219-
for (const p of [...paths]) if (p !== projectFilter.value) paths.delete(p)
220-
paths.add(projectFilter.value)
221-
}
215+
// Under a single-project filter the set is just that folder; otherwise every
216+
// project with a (filtered) task. The active project is added below so the
217+
// open conversation is never hidden.
218+
const paths = projectFilter.value ? new Set([projectFilter.value]) : new Set(map.keys())
222219
// Keep the active project's folder so the place you're working never vanishes.
223220
// Under a narrowing filter only keep it when it has a visible task (which now
224221
// includes the always-kept open conversation), so we don't synthesize a

0 commit comments

Comments
 (0)