@@ -46,6 +46,7 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
4646 // Destructure metadata for convenience
4747 const { id : workspaceId , name : workspaceName , namedWorkspacePath, status } = metadata ;
4848 const isCreating = status === "creating" ;
49+ const isDisabled = isCreating || isDeleting ;
4950 const gitStatus = useGitStatus ( workspaceId ) ;
5051
5152 // Get rename context
@@ -102,14 +103,14 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
102103 < div
103104 className = { cn (
104105 "py-1.5 pl-4 pr-2 border-l-[3px] border-transparent transition-all duration-150 text-[13px] relative flex gap-2" ,
105- isCreating || isDeleting
106+ isDisabled
106107 ? "cursor-default opacity-70"
107108 : "cursor-pointer hover:bg-hover [&:hover_button]:opacity-100" ,
108- isSelected && ! isCreating && "bg-hover border-l-blue-400" ,
109+ isSelected && ! isDisabled && "bg-hover border-l-blue-400" ,
109110 isDeleting && "pointer-events-none"
110111 ) }
111112 onClick = { ( ) => {
112- if ( isCreating ) return ; // Disable click while creating
113+ if ( isDisabled ) return ;
113114 onSelectWorkspace ( {
114115 projectPath,
115116 projectName,
@@ -118,7 +119,7 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
118119 } ) ;
119120 } }
120121 onKeyDown = { ( e ) => {
121- if ( isCreating ) return ; // Disable keyboard while creating
122+ if ( isDisabled ) return ;
122123 if ( e . key === "Enter" || e . key === " " ) {
123124 e . preventDefault ( ) ;
124125 onSelectWorkspace ( {
@@ -130,12 +131,16 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
130131 }
131132 } }
132133 role = "button"
133- tabIndex = { isCreating ? - 1 : 0 }
134+ tabIndex = { isDisabled ? - 1 : 0 }
134135 aria-current = { isSelected ? "true" : undefined }
135136 aria-label = {
136- isCreating ? `Creating workspace ${ displayName } ` : `Select workspace ${ displayName } `
137+ isCreating
138+ ? `Creating workspace ${ displayName } `
139+ : isDeleting
140+ ? `Deleting workspace ${ displayName } `
141+ : `Select workspace ${ displayName } `
137142 }
138- aria-disabled = { isCreating }
143+ aria-disabled = { isDisabled }
139144 data-workspace-path = { namedWorkspacePath }
140145 data-workspace-id = { workspaceId }
141146 >
@@ -158,14 +163,14 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
158163 < span
159164 className = { cn (
160165 "text-foreground -mx-1 min-w-0 flex-1 truncate rounded-sm px-1 text-left text-[14px] transition-colors duration-200" ,
161- ! isCreating && "cursor-pointer hover:bg-white/5"
166+ ! isDisabled && "cursor-pointer hover:bg-white/5"
162167 ) }
163168 onDoubleClick = { ( e ) => {
164- if ( isCreating ) return ; // Disable rename while creating
169+ if ( isDisabled ) return ;
165170 e . stopPropagation ( ) ;
166171 startRenaming ( ) ;
167172 } }
168- title = { isCreating ? "Creating workspace..." : "Double-click to rename" }
173+ title = { isDisabled ? undefined : "Double-click to rename" }
169174 >
170175 { canInterrupt || isCreating ? (
171176 < Shimmer className = "w-full truncate" colorClass = "var(--color-foreground)" >
0 commit comments