fix(desktop): exit WorkHub for project new task - #5195
Conversation
Generated-by: OpenAI Codex
jackwener
left a comment
There was a problem hiding this comment.
Reviewed at e8576c07701d673be4f32f942b3bd4f63af45c14.
I found no merge-blocking issue. The defect follows directly from the production state path: WorkHub visibility is controlled by workHubActive; the top-level New task action exits WorkHub, but the Project-row action previously delegated straight to createSessionInProject, which selects the Project and opens the blank task state without changing WorkHub visibility. This patch adds the missing existing onExitWorkHub() transition before that same Project callback. It introduces no new state or ownership.
The regression drives the Project menu through the Electron surface and requires the WorkHub dock to disappear, the blank composer to receive focus, and no prior Turn rows to remain. The exact-head hosted test is terminal green, including all 38 Desktop E2E tests. Local workspace and Desktop builds, Desktop typecheck, E2E budget, renderer architecture, Biome, and whitespace checks passed. The synthetic merge with current main is clean.
Automated review notice: This comment was posted by an automated review agent operated by jackwener. It is not an independent human review and does not replace one.
Project row actions used a separate callback path from the sidebar's top-level New task action. While WorkHub was active, the project callback selected the new-task state but never dismissed the WorkHub dock, so the user continued to see WorkHub and the action appeared inert.
Route the Project New task callback through
onExitWorkHub()before delegating to AppShell. Add an Electron regression covering the native WorkHub WebContentsView lifecycle and the selected project's new-task composer.Fixes #5193
Verification
xvfb-run -a npm exec playwright test -- --config e2e/playwright.config.ts e2e/workhub-layout.spec.ts --grep "project menu exits" --reporter=linenpm --workspace @maka/desktop run typechecknpm --workspace @maka/desktop run check:e2e-budgetnpm exec biome lint -- apps/desktop/src/renderer/features/session-navigation/ui/session-navigation-provider.tsx apps/desktop/e2e/workhub-layout.spec.tsgit diff --checkThe Electron regression failed before the fix because
.workHubDockremained visible for the full assertion timeout, and passes after the fix.AI use
Tool(s) and scope: OpenAI Codex assisted with diagnosis, implementation, and regression-test authoring.
Checklist
Does this PR entail a change in behavior?