refactor sse

This commit is contained in:
d-kimsuon
2025-09-21 07:50:50 +09:00
parent f299e8f8bb
commit 7211ddeb5a
7 changed files with 20 additions and 9 deletions

View File

@@ -25,8 +25,13 @@ export const SSEEventListeners: FC<PropsWithChildren> = ({ children }) => {
});
});
useServerEventListener("taskChanged", async (event) => {
setAliveTasks(event.aliveTasks);
useServerEventListener("taskChanged", async ({ aliveTasks, changed }) => {
setAliveTasks(aliveTasks);
await queryClient.invalidateQueries({
queryKey: sessionDetailQuery(changed.projectId, changed.sessionId)
.queryKey,
});
});
return <>{children}</>;

View File

@@ -1,5 +1,4 @@
import { QueryClient } from "@tanstack/react-query";
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import { Toaster } from "../components/ui/sonner";
@@ -24,7 +23,7 @@ const geistMono = Geist_Mono({
subsets: ["latin"],
});
export const metadata: Metadata = {
export const metadata = {
title: "Claude Code Viewer",
description: "Web Viewer for Claude Code history",
};
@@ -42,7 +41,7 @@ export default async function RootLayout({
});
return (
<html lang="ja">
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>

View File

@@ -218,7 +218,7 @@ export const SessionPageContent: FC<{
{/* Fixed Diff Button */}
<Button
onClick={() => setIsDiffModalOpen(true)}
className="fixed bottom-6 right-6 w-14 h-14 rounded-full shadow-lg hover:shadow-xl transition-all duration-200 z-50"
className="fixed bottom-15 right-6 w-14 h-14 rounded-full shadow-lg hover:shadow-xl transition-all duration-200 z-50"
size="lg"
>
<GitCompareIcon className="w-6 h-6" />