Skip to content

Global search shows archived/deleted tasks #3161

Description

@igennova

Deleted/archived tasks still appear in global search

Summary

Tasks that have been archived — or archived and then deleted — still show up in the global search (command menu / "Search commands, channels, and tasks…"). They should be excluded, consistent with the sidebar and command center.

Steps to reproduce

  1. Create a task and run it locally (so it appears in the sidebar).
  2. Archive the task (right-click → Archive), or archive it and then delete it from the Archived tasks view.
  3. Open global search (Search tasks button, or the command menu).
  4. Type the task's name.
Screen.Recording.2026-07-06.at.9.51.31.AM.mov

Expected behavior

  • Archived tasks do not appear in search results.
  • Archived-then-deleted tasks do not appear in search results.
  • Search shows the same tasks that are visible in the sidebar / command center.

Actual behavior

  • Archived tasks still appear in the "Tasks" section of global search.
  • Deleted archived tasks also still appear, because deleting an archived task removes local state but not the cloud task record.

Root cause

The command menu builds its task list directly from useTasks() with no visibility filtering:

  • It never checks archivedTaskIds, so archived tasks show.
  • It never checks workspace presence, so deleted archived tasks show.

Deleting an archived task removes the archives row (so it leaves archivedTaskIds) and the workspaces row, but leaves the cloud task in useTasks(). As a result, an archived-id-only filter cannot hide deleted tasks — the missing workspace is what distinguishes them.

Proposed fix

Filter the command menu's task list to mirror the sidebar/command-center rule: a task appears only when it is not archived and still has a workspace (!archivedTaskIds.has(task.id) && Boolean(workspaces?.[task.id])).

Notes

  • This narrows global search to tasks with a local workspace (matching the sidebar/command center). Tasks without a workspace row will no longer appear in search.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions