You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "liuxiaocs7 (via GitHub)" <gi...@apache.org> on 2026/09/25 13:30:57 UTC

[PR] fix(desktop): gate "Remove from project" on a visible home project [maka]

liuxiaocs7 opened a new pull request, #5726:
URL: https://github.com/apache/maka/pull/5726

   ## Summary
   
   A task whose `projectId` no longer names any project the rail's scopes can see (deleted, archived, or relocated upstream) had a "Move to project → Remove from project" entry in its row ⋯ menu, even though the row itself already read as project-less in the rail. The two guards that build that menu asked "is `projectId` truthy?" instead of "is this `projectId` a project the rail can name?", and the orphan exit row was the visible result (#5725).
   
   Both guards now share one question — does the rail's destination list still contain the task's `projectId`? The desktop provider's check was extracted to a pure `sessionMoveTargets` in `model/` so the desktop unit suite covers it directly, and the UI's row-level filter is symmetric so the gate holds under either entry path.
   
   Fixes #5725
   
   ## Verification
   
   - New unit tests cover both guards:
     - `apps/desktop/src/main/__tests__/session-navigation-move-targets.test.ts` — 6 cases against the extracted `sessionMoveTargets`: in-project, no-project, orphan `projectId` (the regression), archived home, cross-host exclusion, unavailable project.
     - `packages/ui/src/__tests__/session-history-move-to-project-menu.test.tsx` — 4 cases against the rendered row menu, including the regression scenario end-to-end.
   - Existing suites all pass:
     - `packages/ui`: 53 session-history tests (`node --test "dist/__tests__/session-history-*.test.js"`).
     - `apps/desktop`: existing `session-navigation-move-to-project.test.ts` (3 cases) plus new file (6 cases), 9/9 pass.
   - Typecheck clean across all 4 desktop tsconfigs and `packages/ui`.
   
   Not run: Storybook visual diffs. The change is filter logic only — no markup or styling changed.
   
   ## AI use
   
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: Claude Opus 4.7 authored the diagnosis, both guards, the new tests, and this PR description.
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [x] Yes — described under Summary above
   - [ ] No
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(desktop): gate "Remove from project" on a visible home project [maka]

Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 merged PR #5726:
URL: https://github.com/apache/maka/pull/5726


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org