Skip to content

Sidebar task menu shows "Remove from project" on tasks that have no project #5725

Description

@liuxiaocs7

What happened

A task with no project shows a "Remove from project" entry inside the "Move to project" submenu of its row's ⋯ menu, when the submenu itself should not be there at all: the task has no project to leave, and none of the visible projects contain it.

The rail shows a ⋯ → 移动到项目 → 移出项目 submenu on a task that visually sits in the "no project" section.

The task carries a truthy projectId that no longer names any project the current scopes know about (deleted, archived, or relocated upstream). Both guards that build the menu read "is this in a project?" as "is projectId truthy?":

  • apps/desktop/src/renderer/features/session-navigation/ui/session-navigation-provider.tsx pushed the projectId: null exit whenever session.projectId was truthy, regardless of whether the project's scope still existed
  • packages/ui/src/session-history-list.tsx dropped the exit only when currentProjectId === null, with the same orphan-id blind spot

When the visible Project scopes filter down to zero available targets, the top-level "Move to project" item disappears but the null entry still rides inside the submenu, rendering as a lone "Remove from project" row for a task that already reads project-less.

How to reproduce

  1. Create a task in a project (so the session carries a real projectId).
  2. Outside the row (delete or archive the project from Settings, or move its directory) such that the rail's projectScopes no longer include that project, while the session row still points at its id.
  3. Reopen the task's ⋯ menu → "Move to project" shows a submenu whose only entry is "Remove from project".

Environment

  • Maka version or commit: 93cc6b875 (fix(ui): use catalog activity for session branch recency (#5705))
  • OS and version: macOS
  • Surface: Desktop

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions