From 6a86e5639ad183bb4150080e9309ca397ac76474 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 17 Jun 2026 23:39:55 -0700 Subject: [PATCH] fix status for devtools (#3532) Co-authored-by: Marc Bouchenoire --- .../src/devtools/components/RoomStatus.tsx | 5 ----- .../src/devtools/contexts/CurrentRoom.tsx | 1 - .../src/devtools/tabs/event-timeline/index.tsx | 6 +----- .../src/devtools/tabs/presence/index.tsx | 6 +----- .../src/devtools/tabs/storage/index.tsx | 6 +----- .../src/devtools/tabs/yjs/index.tsx | 18 +++--------------- .../src/devtools/tabs/yjs/yflow/YFlow.tsx | 4 +--- 7 files changed, 7 insertions(+), 39 deletions(-) diff --git a/tools/liveblocks-devtools/src/devtools/components/RoomStatus.tsx b/tools/liveblocks-devtools/src/devtools/components/RoomStatus.tsx index 1401db6d034..ad81e7bcef8 100644 --- a/tools/liveblocks-devtools/src/devtools/components/RoomStatus.tsx +++ b/tools/liveblocks-devtools/src/devtools/components/RoomStatus.tsx @@ -12,18 +12,13 @@ export function RoomStatus({ className, ...props }: ComponentProps<"div">) { const statusContent = useMemo(() => { switch (currentStatus) { case "connected": - case "open": // Sent by old clients (prior to 1.1) return ; case "connecting": case "reconnecting": - case "authenticating": // Sent by old clients (prior to 1.1) - case "unavailable": // Sent by old clients (prior to 1.1) return ; case "disconnected": - case "closed": // Sent by old clients (prior to 1.1) - case "failed": // Sent by old clients (prior to 1.1) return ( ); diff --git a/tools/liveblocks-devtools/src/devtools/contexts/CurrentRoom.tsx b/tools/liveblocks-devtools/src/devtools/contexts/CurrentRoom.tsx index 75783c57c52..e0d7bad7b9d 100644 --- a/tools/liveblocks-devtools/src/devtools/contexts/CurrentRoom.tsx +++ b/tools/liveblocks-devtools/src/devtools/contexts/CurrentRoom.tsx @@ -26,7 +26,6 @@ export type YUpdate = { ds: DeleteSet; structs: (Y.Item | Y.GC | Skip)[]; }; - type Room = { readonly roomId: string; status: Status | null; diff --git a/tools/liveblocks-devtools/src/devtools/tabs/event-timeline/index.tsx b/tools/liveblocks-devtools/src/devtools/tabs/event-timeline/index.tsx index 59fca5ae73f..e0f23894a39 100644 --- a/tools/liveblocks-devtools/src/devtools/tabs/event-timeline/index.tsx +++ b/tools/liveblocks-devtools/src/devtools/tabs/event-timeline/index.tsx @@ -11,11 +11,7 @@ export function EventTimeline({ className, ...props }: ComponentProps<"div">) { const currentStatus = useStatus(); const [customEvents, clearCustomEvents] = useCustomEvents(); - if ( - currentStatus === "connected" || - currentStatus === "open" || // Same as "connected", but only sent by old clients (prior to 1.1) - currentStatus === "reconnecting" - ) { + if (currentStatus === "connected" || currentStatus === "reconnecting") { if (customEvents.length > 0) { return (
diff --git a/tools/liveblocks-devtools/src/devtools/tabs/presence/index.tsx b/tools/liveblocks-devtools/src/devtools/tabs/presence/index.tsx index 2a686af97da..24c16b2e57c 100644 --- a/tools/liveblocks-devtools/src/devtools/tabs/presence/index.tsx +++ b/tools/liveblocks-devtools/src/devtools/tabs/presence/index.tsx @@ -10,11 +10,7 @@ export function Presence({ className, ...props }: ComponentProps<"div">) { const currentStatus = useStatus(); const presence = usePresence(); - if ( - currentStatus === "connected" || - currentStatus === "open" || // Same as "connected", but only sent by old clients (prior to 1.1) - currentStatus === "reconnecting" - ) { + if (currentStatus === "connected" || currentStatus === "reconnecting") { if (presence.length > 0) { return (
0) { return (
diff --git a/tools/liveblocks-devtools/src/devtools/tabs/yjs/index.tsx b/tools/liveblocks-devtools/src/devtools/tabs/yjs/index.tsx index e018beb966e..c9bae650c78 100644 --- a/tools/liveblocks-devtools/src/devtools/tabs/yjs/index.tsx +++ b/tools/liveblocks-devtools/src/devtools/tabs/yjs/index.tsx @@ -71,11 +71,7 @@ function YjsChangesList({ className, ...props }: ComponentProps<"div">) { const updates = useYUpdates(); const tree = useMemo(() => createTreeFromYUpdates(updates), [updates]); - if ( - currentStatus === "connected" || - currentStatus === "open" || // Same as "connected", but only sent by old clients (prior to 1.1) - currentStatus === "reconnecting" - ) { + if (currentStatus === "connected" || currentStatus === "reconnecting") { if (updates.length > 0) { return (
0) { return (
@@ -220,11 +212,7 @@ function YjsAwareness({ className, ...props }: ComponentProps<"div">) { [presence] ); - if ( - currentStatus === "connected" || - currentStatus === "open" || // Same as "connected", but only sent by old clients (prior to 1.1) - currentStatus === "reconnecting" - ) { + if (currentStatus === "connected" || currentStatus === "reconnecting") { if (presence.length > 0 && hasAwareness) { return (
) { if ( !isTransitionPending && - (currentStatus === "connected" || - currentStatus === "open" || // Same as "connected", but only sent by old clients (prior to 1.1) - currentStatus === "reconnecting") + (currentStatus === "connected" || currentStatus === "reconnecting") ) { if (edges.length > 0) { return (