Fork resource subscriptions by protocol era: legacy keeps resources/subscribe; modern (2026-07-28) models subscriptions as a filter over one long-lived subscriptions/listen stream with reconnect-by-re-listen (capped backoff), an optimistic Connecting→Listening header badge, and a fix so the browser proxy no longer blocks listen() ~60s. Closes #1630.
This commit is contained in:
parent
a71e6d2012
commit
320daf2f67
1 changed files with 1656 additions and 90 deletions
|
|
@ -0,0 +1,27 @@
|
|||
import { Badge, Tooltip } from "@mantine/core";
|
||||
import type { ResourceSubscriptionStreamStatus } from "../../../../../../core/mcp/types.js";
|
||||
import { subscriptionStreamPresentation } from "./subscriptionStreamUtils";
|
||||
|
||||
export interface SubscriptionStreamBadgeProps {
|
||||
/** Lifecycle status of the modern `subscriptions/listen` stream. */
|
||||
status: ResourceSubscriptionStreamStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status indicator for the modern-era resource-subscription listen stream
|
||||
* (#1630). Only meaningful on the modern era — the caller gates rendering on
|
||||
* `streamState.active`. Renders a labelled dot badge (green/yellow/gray) in the
|
||||
* Subscriptions section header, explaining the stream in a tooltip.
|
||||
*/
|
||||
export function SubscriptionStreamBadge({
|
||||
status,
|
||||
}: SubscriptionStreamBadgeProps) {
|
||||
const { color, label, tooltip } = subscriptionStreamPresentation(status);
|
||||
return (
|
||||
<Tooltip label={tooltip} multiline w={260} withArrow>
|
||||
<Badge variant="dot" color={color}>
|
||||
{label}
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue