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.
This commit is contained in:
ZacharyZhang-NY committed 2026-04-17 19:11:28 -04:00
1 parent 02ba887610
commit 41132e2da4
1 file changed
-1
@@ -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) => {