File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -321,8 +321,11 @@ function AppInner() {
321321 result . set (
322322 projectPath ,
323323 config . workspaces . slice ( ) . sort ( ( a , b ) => {
324- const aMeta = workspaceMetadata . get ( a . path ) ;
325- const bMeta = workspaceMetadata . get ( b . path ) ;
324+ // Extract workspace ID from path
325+ const aId = a . path . replace ( / \\ / g, "/" ) . split ( "/" ) . pop ( ) || "" ;
326+ const bId = b . path . replace ( / \\ / g, "/" ) . split ( "/" ) . pop ( ) || "" ;
327+ const aMeta = workspaceMetadata . get ( aId ) ;
328+ const bMeta = workspaceMetadata . get ( bId ) ;
326329 if ( ! aMeta || ! bMeta ) return 0 ;
327330
328331 // Get timestamp of most recent user message (0 if never used)
@@ -374,7 +377,9 @@ function AppInner() {
374377 const targetWorkspace = sortedWorkspaces [ targetIndex ] ;
375378 if ( ! targetWorkspace ) return ;
376379
377- const metadata = workspaceMetadata . get ( targetWorkspace . path ) ;
380+ // Extract workspace ID from path
381+ const workspaceId = targetWorkspace . path . replace ( / \\ / g, "/" ) . split ( "/" ) . pop ( ) || "" ;
382+ const metadata = workspaceMetadata . get ( workspaceId ) ;
378383 if ( ! metadata ) return ;
379384
380385 setSelectedWorkspace ( {
Original file line number Diff line number Diff line change @@ -823,10 +823,9 @@ const ProjectSidebarInner: React.FC<ProjectSidebarProps> = ({
823823 { ( sortedWorkspacesByProject . get ( projectPath ) ?? config . workspaces ) . map (
824824 ( workspace ) => {
825825 // Extract workspace ID from path (path format: ~/.cmux/src/projectName/workspaceId)
826- const workspaceId =
827- workspace . path . split ( "/" ) . pop ( ) ??
828- workspace . path . split ( "\\" ) . pop ( ) ??
829- "" ;
826+ // Handle both Unix (/) and Windows (\) path separators
827+ const pathParts = workspace . path . replace ( / \\ / g, "/" ) . split ( "/" ) ;
828+ const workspaceId = pathParts [ pathParts . length - 1 ] || "" ;
830829 const metadata = workspaceMetadata . get ( workspaceId ) ;
831830 if ( ! metadata ) return null ;
832831 const isSelected =
You can’t perform that action at this time.
0 commit comments