Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/app/api/workspaces/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,12 @@ export async function GET() {

// Get workspace name
let workspaceName = `Project ${entry.name.slice(0, 8)}`
let projectPath: string = "(unknown path)"
try {
const workspaceData = JSON.parse(await fs.readFile(entry.workspaceJsonPath, 'utf-8'))
if (workspaceData.folder) {
const folderName = workspaceData.folder.split('/').pop() || workspaceData.folder.split('\\').pop()
projectPath = String(workspaceData.folder).replace('file://', '')
const folderName = projectPath.split('/').pop() || projectPath.split('\\').pop()
workspaceName = folderName || workspaceName
}
} catch (error) {
Expand All @@ -303,7 +305,7 @@ export async function GET() {
projects.push({
id: entry.name,
name: workspaceName,
path: entry.workspaceJsonPath,
path: projectPath,
conversationCount: conversationCount,
lastModified: stats.mtime.toISOString()
})
Expand All @@ -317,4 +319,4 @@ export async function GET() {
console.error('Failed to get workspaces:', error)
return NextResponse.json({ error: 'Failed to get workspaces' }, { status: 500 })
}
}
}
45 changes: 30 additions & 15 deletions src/components/workspace-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { Loading } from "@/components/ui/loading"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import { Alert, AlertDescription } from "@/components/ui/alert"
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"
import { Info } from "lucide-react"

interface Project {
Expand Down Expand Up @@ -75,12 +76,19 @@ export function WorkspaceList() {
{projectsWithConversations.map((project) => (
<TableRow key={project.id} className="hover:bg-accent/50">
<TableCell>
<Link
href={`/workspace/${project.id}`}
className="text-blue-600 hover:underline font-medium"
>
{project.name}
</Link>
<Tooltip>
<TooltipTrigger asChild>
<Link
href={`/workspace/${project.id}`}
className="text-blue-600 hover:underline font-medium"
>
{project.name}
</Link>
</TooltipTrigger>
<TooltipContent side="top" className="max-w-[60vw] break-all">
{project.path}
</TooltipContent>
</Tooltip>
</TableCell>
<TableCell>
<span className="text-green-600 font-medium">
Expand Down Expand Up @@ -111,7 +119,7 @@ export function WorkspaceList() {
<Alert className="mb-4">
<Info className="h-4 w-4" />
<AlertDescription>
These projects may appear empty due to folder relocation, Cursor updates, or conversations being stored in a different location.
These projects may appear empty due to folder relocation, Cursor updates, or conversations being stored in a different location.
You can still click on a project to check if there are any legacy conversations available.
</AlertDescription>
</Alert>
Expand All @@ -127,12 +135,19 @@ export function WorkspaceList() {
{projectsWithoutConversations.map((project) => (
<TableRow key={project.id} className="hover:bg-accent/50">
<TableCell>
<Link
href={`/workspace/${project.id}`}
className="text-blue-600 hover:underline font-medium"
>
{project.name}
</Link>
<Tooltip>
<TooltipTrigger asChild>
<Link
href={`/workspace/${project.id}`}
className="text-blue-600 hover:underline font-medium"
>
{project.name}
</Link>
</TooltipTrigger>
<TooltipContent side="top" className="max-w-[60vw] break-all">
{project.path}
</TooltipContent>
</Tooltip>
</TableCell>
<TableCell>
<span className="text-gray-400">0</span>
Expand Down Expand Up @@ -161,7 +176,7 @@ export function WorkspaceList() {
<Alert>
<Info className="h-4 w-4" />
<AlertDescription>
This could be due to an incorrect workspace path configuration or no Cursor projects being available.
This could be due to an incorrect workspace path configuration or no Cursor projects being available.
Check the configuration page to verify your Cursor workspace storage location.
</AlertDescription>
</Alert>
Expand All @@ -170,4 +185,4 @@ export function WorkspaceList() {
)}
</div>
)
}
}