1- import { useState , useEffect , useCallback , useRef } from "react" ;
1+ import { useEffect , useCallback , useRef } from "react" ;
22import "./styles/globals.css" ;
33import { useWorkspaceContext } from "./contexts/WorkspaceContext" ;
44import { useProjectContext } from "./contexts/ProjectContext" ;
@@ -44,6 +44,9 @@ function AppInner() {
4444 renameWorkspace,
4545 selectedWorkspace,
4646 setSelectedWorkspace,
47+ pendingNewWorkspaceProject,
48+ beginWorkspaceCreation,
49+ clearPendingWorkspaceCreation,
4750 } = useWorkspaceContext ( ) ;
4851 const {
4952 projects,
@@ -54,9 +57,6 @@ function AppInner() {
5457 addProject,
5558 } = useProjectContext ( ) ;
5659
57- // Track when we're in "new workspace creation" mode (show FirstMessageInput)
58- const [ pendingNewWorkspaceProject , setPendingNewWorkspaceProject ] = useState < string | null > ( null ) ;
59-
6060 // Auto-collapse sidebar on mobile by default
6161 const isMobile = typeof window !== "undefined" && window . innerWidth <= 768 ;
6262 const [ sidebarCollapsed , setSidebarCollapsed ] = usePersistedState ( "sidebarCollapsed" , isMobile ) ;
@@ -72,7 +72,7 @@ function AppInner() {
7272
7373 const startWorkspaceCreation = useStartWorkspaceCreation ( {
7474 projects,
75- setPendingNewWorkspaceProject ,
75+ beginWorkspaceCreation ,
7676 setSelectedWorkspace,
7777 } ) ;
7878
@@ -569,13 +569,13 @@ function AppInner() {
569569 telemetry . workspaceCreated ( metadata . id ) ;
570570
571571 // Clear pending state
572- setPendingNewWorkspaceProject ( null ) ;
572+ clearPendingWorkspaceCreation ( ) ;
573573 } }
574574 onCancel = {
575575 pendingNewWorkspaceProject
576576 ? ( ) => {
577577 // User cancelled workspace creation - clear pending state
578- setPendingNewWorkspaceProject ( null ) ;
578+ clearPendingWorkspaceCreation ( ) ;
579579 }
580580 : undefined
581581 }
0 commit comments