@@ -45,6 +45,7 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
4545 // Destructure metadata for convenience
4646 const { id : workspaceId , name : workspaceName , namedWorkspacePath, status } = metadata ;
4747 const isCreating = status === "creating" ;
48+ const isDisabled = isCreating || isDeleting ;
4849 const gitStatus = useGitStatus ( workspaceId ) ;
4950
5051 // Get rename context
@@ -107,14 +108,14 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
107108 < div
108109 className = { cn (
109110 "py-1.5 pl-4 pr-2 border-l-[3px] border-transparent transition-all duration-150 text-[13px] relative flex gap-2" ,
110- isCreating || isDeleting
111+ isDisabled
111112 ? "cursor-default opacity-70"
112113 : "cursor-pointer hover:bg-hover [&:hover_button]:opacity-100" ,
113- isSelected && ! isCreating && "bg-hover border-l-blue-400" ,
114+ isSelected && ! isDisabled && "bg-hover border-l-blue-400" ,
114115 isDeleting && "pointer-events-none"
115116 ) }
116117 onClick = { ( ) => {
117- if ( isCreating ) return ; // Disable click while creating
118+ if ( isDisabled ) return ;
118119 onSelectWorkspace ( {
119120 projectPath,
120121 projectName,
@@ -123,7 +124,7 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
123124 } ) ;
124125 } }
125126 onKeyDown = { ( e ) => {
126- if ( isCreating ) return ; // Disable keyboard while creating
127+ if ( isDisabled ) return ;
127128 if ( e . key === "Enter" || e . key === " " ) {
128129 e . preventDefault ( ) ;
129130 onSelectWorkspace ( {
@@ -135,12 +136,16 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
135136 }
136137 } }
137138 role = "button"
138- tabIndex = { isCreating ? - 1 : 0 }
139+ tabIndex = { isDisabled ? - 1 : 0 }
139140 aria-current = { isSelected ? "true" : undefined }
140141 aria-label = {
141- isCreating ? `Creating workspace ${ displayName } ` : `Select workspace ${ displayName } `
142+ isCreating
143+ ? `Creating workspace ${ displayName } `
144+ : isDeleting
145+ ? `Deleting workspace ${ displayName } `
146+ : `Select workspace ${ displayName } `
142147 }
143- aria-disabled = { isCreating }
148+ aria-disabled = { isDisabled }
144149 data-workspace-path = { namedWorkspacePath }
145150 data-workspace-id = { workspaceId }
146151 >
@@ -170,14 +175,14 @@ const WorkspaceListItemInner: React.FC<WorkspaceListItemProps> = ({
170175 < span
171176 className = { cn (
172177 "text-foreground -mx-1 min-w-0 flex-1 truncate rounded-sm px-1 text-left text-[14px] transition-colors duration-200" ,
173- ! isCreating && "cursor-pointer hover:bg-white/5"
178+ ! isDisabled && "cursor-pointer hover:bg-white/5"
174179 ) }
175180 onDoubleClick = { ( e ) => {
176- if ( isCreating ) return ; // Disable rename while creating
181+ if ( isDisabled ) return ;
177182 e . stopPropagation ( ) ;
178183 startRenaming ( ) ;
179184 } }
180- title = { isCreating ? "Creating workspace..." : "Double-click to rename" }
185+ title = { isDisabled ? undefined : "Double-click to rename" }
181186 >
182187 { canInterrupt || isCreating ? (
183188 < Shimmer className = "w-full truncate" colorClass = "var(--color-foreground)" >
0 commit comments