Skip to content

Commit d043d5f

Browse files
committed
Sort sessions by creation timestamp in ProjectSessionsListPage
- Updated the session mapping logic to sort sessions based on their creation timestamps in descending order, enhancing the display order for better user experience. - Removed the previous inline mapping for clarity and improved readability of the code.
1 parent 8db5f83 commit d043d5f

File tree

6 files changed

+8
-886
lines changed

6 files changed

+8
-886
lines changed

components/frontend/src/app/projects/[name]/sessions/page.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,13 @@ export default function ProjectSessionsListPage({ params }: { params: Promise<{
145145
</TableRow>
146146
</TableHeader>
147147
<TableBody>
148-
{sessions.map((session: any) => (
148+
{[...sessions]
149+
.sort((a: any, b: any) => {
150+
const aTime = a?.metadata?.creationTimestamp ? new Date(a.metadata.creationTimestamp).getTime() : 0;
151+
const bTime = b?.metadata?.creationTimestamp ? new Date(b.metadata.creationTimestamp).getTime() : 0;
152+
return bTime - aTime;
153+
})
154+
.map((session: any) => (
149155
<TableRow key={session.metadata?.uid || session.metadata?.name}>
150156
<TableCell className="font-medium min-w-[180px]">
151157
<Link href={`/projects/${projectName}/sessions/${session.metadata.name}`} className="text-blue-600 hover:underline hover:text-blue-800 transition-colors block">

components/runners/claude-code-runner/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def pull_dir(pvc_path: str, dst: Path) -> None:
117117
target = dst / name
118118
if it.get("isDir"):
119119
pull_dir(p, target)
120-
else:
120+
else:
121121
try:
122122
data = self.content_read(p) or b""
123123
target.parent.mkdir(parents=True, exist_ok=True)

components/runners/claude-code-runner/simple_test.py

Lines changed: 0 additions & 174 deletions
This file was deleted.

0 commit comments

Comments
 (0)