Skip to content

Commit 5460b7c

Browse files
cliffhallclaude
andcommitted
feat(network): show orange SSE badge for long-lived stream entries
Adds a small "SSE" badge to the right side of the NetworkEntry header (left of the HTTP status badge) when the response is a long-lived streaming channel (GET + text/event-stream or application/x-ndjson) — the only case where the body genuinely isn't captured. Makes the "not captured" placeholder less surprising at a glance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a25bd4d commit 5460b7c

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

clients/web/src/components/groups/NetworkEntry/NetworkEntry.test.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,24 @@ describe("NetworkEntry", () => {
126126
).toBeInTheDocument();
127127
});
128128

129+
it("shows an SSE badge on long-lived GET event-stream entries", () => {
130+
const sse: FetchRequestEntry = {
131+
...baseEntry,
132+
method: "GET",
133+
responseHeaders: { "content-type": "text/event-stream" },
134+
responseBody: undefined,
135+
};
136+
renderWithMantine(<NetworkEntry entry={sse} isListExpanded={false} />);
137+
expect(screen.getByText("SSE")).toBeInTheDocument();
138+
});
139+
140+
it("does not show an SSE badge on bounded POST entries", () => {
141+
renderWithMantine(
142+
<NetworkEntry entry={baseEntry} isListExpanded={false} />,
143+
);
144+
expect(screen.queryByText("SSE")).not.toBeInTheDocument();
145+
});
146+
129147
it("shows '(empty)' for a POST SSE response with no body (bounded stream where capture failed)", async () => {
130148
const user = userEvent.setup();
131149
const sse: FetchRequestEntry = {

clients/web/src/components/groups/NetworkEntry/NetworkEntry.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ export function NetworkEntry({ entry, isListExpanded }: NetworkEntryProps) {
161161
{entry.duration != null && (
162162
<DurationText>{formatDuration(entry.duration)}</DurationText>
163163
)}
164+
{isLongLivedStream(entry) && <Badge color="orange">SSE</Badge>}
164165
<Badge color={statusColor(entry)}>{statusLabel(entry)}</Badge>
165166
</Group>
166167
</HeaderRow>

0 commit comments

Comments
 (0)