Auto-refresh active sessions, collapsible skill categories, platform toolsets in config, search highlighting
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { use, useState, useRef } from "react";
|
||||
import { use, useState, useRef, useEffect } from "react";
|
||||
import { ArrowLeft, Send, Loader2, Eye, RefreshCw, Trash2 } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { useSession, useMessages } from "@/lib/hooks";
|
||||
@@ -37,6 +37,16 @@ export default function SessionReplayPage({ params }: { params: Promise<{ id: st
|
||||
const session = sessionData?.session;
|
||||
const messages = messagesData?.items || [];
|
||||
|
||||
// Auto-refresh active sessions every 5s
|
||||
useEffect(() => {
|
||||
if (!session || session.ended_at) return;
|
||||
const interval = setInterval(() => {
|
||||
qc.invalidateQueries({ queryKey: ["messages", id, msgLimit] });
|
||||
qc.invalidateQueries({ queryKey: ["session", id] });
|
||||
}, 5000);
|
||||
return () => clearInterval(interval);
|
||||
}, [session, id, msgLimit, qc]);
|
||||
|
||||
// Filter based on verbosity
|
||||
let visibleMessages = messages.filter((m) => {
|
||||
if (m.role === "user") return true;
|
||||
|
||||
Reference in New Issue
Block a user