Skip to content

[Bug]: First message in a chat outside the sidebar project filter resets the filter to All projects #33251

Open

Description

@karimou5

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. In the sidebar, set the project filter to a single project, e.g. Project A.
  2. Start a new chat in another project, Project B (new-thread picker / Cmd+Shift+O, or a thread link).
  3. Send the first message.

Expected behavior

The sidebar follows the chat I am working in: the filter switches to Project B (or at least adds B to the current selection), so I keep a focused, single-project list.

Actual behavior

The filter is reset to All projects and that choice is persisted, so the sidebar suddenly lists every thread of every project. I then have to reopen the filter menu and pick the project again, many times a day.

Cause, from the source (main at c6ca605):

  • resolveSidebarRouteReveal (apps/web/src/components/sidebar/routeReveal.ts) reports widensScope when the routed thread is hidden by the current project scope.
  • Sidebar.tsx (~L1132-1149) then uses projectScopeKeys = [] and persists it with setPersistedProjectScopeKeys([]).
  • While the chat is still a draft the thread shell does not exist, so findThread returns undefined and nothing happens; the widening fires at the first send, when the shell arrives.

Proposal

Make the reveal target the thread's own project instead of clearing the scope, ideally behind a setting so both behaviors stay available:

Settings > Sidebar > When the open thread is outside the project filter:

  • Switch the filter to its project (proposed default)
  • Add its project to the filter
  • Show all projects (current behavior)

The project group key is already at hand in Sidebar.tsx: the group whose memberProjectRefs contains ${thread.environmentId}:${thread.projectId}. When no group matches, fall back to all projects as today.

Impact

Minor bug or occasional failure

Version or commit

0.1.8-nightly.20261109.4399 (code unchanged on main at c6ca605)

Environment

Linux (Lubuntu), desktop AppImage, default (non-boring) sidebar

Workaround

Re-select the project in the filter after each first message in another project. Locally I patch the minified renderer bundle so the effect persists [threadProjectKey] instead of [].

Activity

  1. viicslen commented on Nov 30, 2026

    @viicslen

    Note

    🤖 Claude Opus 5.5 responding on behalf of viicslen

    Adding a project through the sidebar filter's Add project option also hits this. Adding the project leaves the filter alone. It opens a draft in the new project, though, and the first message sent there resets the filter to All projects through the same widensScope path.

    Reproduced on main at 5c95c69 (web dev server, Replay (dev)):

    1. Filter the sidebar to project A.
    2. Filter menu → Add project → add folder B. The filter stays on A (sidebarProjectScopeKeys is [A]).
    3. Send a message in B's draft. sidebarProjectScopeKeys becomes [].

    Going by its description, #34062 (add the thread's project to the scope instead of clearing it) covers this case too. I haven't run that branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions