From 9d641e031f25cff5caaff7cbd8db1cf719daa0d0 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 28 Aug 2026 16:35:59 +0000 Subject: [PATCH] feat: SSE disconnect/reconnecting indicator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit useLiveUpdates now tracks the EventSource's open/error transitions and returns a connection state, surfaced in the top bar as a small amber "Reconnecting…" badge whenever the SSE feed drops. Closes #11 --- src/client/RepoView.tsx | 7 ++++++- src/client/api/events.ts | 14 ++++++++++++-- src/client/styles/styles.css | 4 ++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/client/RepoView.tsx b/src/client/RepoView.tsx index b88a793..9cc79a2 100644 --- a/src/client/RepoView.tsx +++ b/src/client/RepoView.tsx @@ -75,7 +75,7 @@ interface ToastState { export function RepoView({ repoPath }: { repoPath: string }) { const [credReq, setCredReq] = React.useState<{ id: string; prompt: string } | null>(null); - useLiveUpdates(repoPath, (e) => setCredReq({ id: e.id, prompt: e.prompt })); + const connection = useLiveUpdates(repoPath, (e) => setCredReq({ id: e.id, prompt: e.prompt })); const [settings, setSetting] = useSettings(); const repoQ = useRepo(repoPath); @@ -682,6 +682,11 @@ export function RepoView({ repoPath }: { repoPath: string }) {
+ {connection === 'reconnecting' && ( + + Reconnecting… + + )}