Recordings were just a thin named pointer over an already-captured session's events, so the whole separate feature (recordings table, API routes, pages, UI) is gone: any completed session can now be named and replayed directly. Replaying no longer creates a session or duplicates events of its own - it just bumps the source session's playCount/lastPlayedAt. Also renames play_sessions/playSession(s) to sessions/session(s) throughout the schema, queries, API routes, and UI for consistency, and updates the README to match the new flow. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
import { SessionsTable } from "@/components/sessions/SessionsTable";
|
|
import { PageNav } from "@/components/shared/PageNav";
|
|
import { listSessionsPage } from "@/lib/db/queries/sessions";
|
|
import { parsePage } from "@/lib/pagination";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
export const metadata: Metadata = { title: "Sessions" };
|
|
|
|
export default async function SessionsPage({
|
|
searchParams,
|
|
}: {
|
|
searchParams: Promise<{ page?: string }>;
|
|
}) {
|
|
const page = parsePage((await searchParams).page);
|
|
const { items: sessions, pageSize, total } = await listSessionsPage(page);
|
|
|
|
return (
|
|
<div className="flex flex-col gap-6">
|
|
<div>
|
|
<h1 className="font-heading text-2xl font-semibold">Sessions</h1>
|
|
<p className="text-sm text-muted-foreground">History of live control and replay sessions.</p>
|
|
</div>
|
|
<Card className="bp-glass">
|
|
<CardHeader>
|
|
<CardTitle className="text-base">History</CardTitle>
|
|
</CardHeader>
|
|
<CardContent className="flex flex-col gap-3">
|
|
<SessionsTable sessions={sessions} />
|
|
<PageNav basePath="/sessions" page={page} pageSize={pageSize} total={total} />
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
);
|
|
}
|