From 41132e2da4252e740d91f62c584e68439c0a9901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Fri, 17 Apr 2026 19:11:28 -0400 Subject: [PATCH] fix(team): don't auto-open CEO edit modal after onboarding useCompanyController.handleOnboardingDone() pre-selected the newly-created lead agent via setSelectedAgentId(). OrganizationSections.tsx uses the same `selectedAgentId` state as the Edit modal open flag (`open={!!selectedAgent}`), so the first visit to the Team section after onboarding auto-opened `Edit: CEO` with no user action. Removed the pre-select. Roster highlight on navigation still works via the explicit `setSelectedAgentId(entityId)` path in the navigation slice; the Edit modal now only opens when the user clicks a roster row, matching user expectation. Scope note: this does not yet split `selectedAgentId` into separate `focusedAgentId` + `editingAgentId` states; clicking a roster row still opens the editor immediately. That UX split belongs to the Jony/Jobs Team-page audit pass, not this single-line fix. --- src/renderer/hooks/useCompanyController.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/renderer/hooks/useCompanyController.ts b/src/renderer/hooks/useCompanyController.ts index 8badd2cf..fd053463 100644 --- a/src/renderer/hooks/useCompanyController.ts +++ b/src/renderer/hooks/useCompanyController.ts @@ -133,7 +133,6 @@ export function useCompanyController() { store.setError(null); store.setSection("overview"); if (summary.runId) store.setSelectedRunId(summary.runId); - if (summary.leadAgentId) store.setSelectedAgentId(summary.leadAgentId); }, [refresh]); const openPathWithFeedback = useCallback(async (path: string) => {