Skip to content

Commit 7dcaa53

Browse files
committed
fix: change size-changed to be in correct tense
1 parent 19b9360 commit 7dcaa53

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

specification/draft/apps.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,12 +632,12 @@ Host MUST send this notification if the tool execution was cancelled, for any re
632632
Host MUST send this notification before tearing down the UI resource, for any reason, including user action, resource re-allocation, etc. The Host MAY specify the reason.
633633
Host SHOULD wait for a response before tearing down the resource (to prevent data loss).
634634

635-
`ui/notifications/size-change` - UI’s size changed
635+
`ui/notifications/size-changed` - UI’s size changed
636636

637637
```typescript
638638
{
639639
jsonrpc: "2.0",
640-
method: "ui/notifications/size-change",
640+
method: "ui/notifications/size-changed",
641641
params: {
642642
width: number, // Viewport width in pixels
643643
height: number // Viewport height in pixels
@@ -774,7 +774,7 @@ sequenceDiagram
774774
H --> UI: resources/read response
775775
end
776776
opt UI notifications
777-
UI ->> H: notifications (e.g., ui/notifications/size-change)
777+
UI ->> H: notifications (e.g., ui/notifications/size-changed)
778778
end
779779
opt Host notifications
780780
H ->> UI: notifications (e.g., ui/notifications/host-context-change)

src/app-bridge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export class AppBridge extends Protocol<Request, Notification, Result> {
265265
/**
266266
* Register a handler for size change notifications from the Guest UI.
267267
*
268-
* The Guest UI sends `ui/notifications/size-change` when its rendered content
268+
* The Guest UI sends `ui/notifications/size-changed` when its rendered content
269269
* size changes, typically via ResizeObserver. Set this callback to dynamically
270270
* adjust the iframe container dimensions based on the Guest UI's content.
271271
*

src/app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type AppOptions = ProtocolOptions & {
8888
* Automatically report size changes to the host using ResizeObserver.
8989
*
9090
* When enabled, the App monitors `document.body` and `document.documentElement`
91-
* for size changes and automatically sends `ui/notifications/size-change`
91+
* for size changes and automatically sends `ui/notifications/size-changed`
9292
* notifications to the host.
9393
*
9494
* @default true
@@ -719,7 +719,7 @@ export class App extends Protocol<Request, Notification, Result> {
719719
*/
720720
sendSizeChange(params: McpUiSizeChangeNotification["params"]) {
721721
return this.notification(<McpUiSizeChangeNotification>{
722-
method: "ui/notifications/size-change",
722+
method: "ui/notifications/size-changed",
723723
params,
724724
});
725725
}
@@ -728,7 +728,7 @@ export class App extends Protocol<Request, Notification, Result> {
728728
* Set up automatic size change notifications using ResizeObserver.
729729
*
730730
* Observes both `document.documentElement` and `document.body` for size changes
731-
* and automatically sends `ui/notifications/size-change` notifications to the host.
731+
* and automatically sends `ui/notifications/size-changed` notifications to the host.
732732
* The notifications are debounced using requestAnimationFrame to avoid duplicates.
733733
*
734734
* Note: This method is automatically called by `connect()` if the `autoResize`

src/react/useAutoResize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { App } from "../app";
55
* React hook that automatically reports UI size changes to the host.
66
*
77
* Uses ResizeObserver to watch `document.body` and `document.documentElement` for
8-
* size changes and sends `ui/notifications/size-change` notifications.
8+
* size changes and sends `ui/notifications/size-changed` notifications.
99
*
1010
* **Note**: This hook is rarely needed since the {@link useApp} hook automatically enables
1111
* auto-resize by default. This hook is provided for advanced cases where you

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ type _VerifySandboxResourceReadyNotification = VerifySchemaMatches<
262262
* @see {@link app.App.setupSizeChangeNotifications} for automatic size reporting
263263
*/
264264
export interface McpUiSizeChangeNotification {
265-
method: "ui/notifications/size-change";
265+
method: "ui/notifications/size-changed";
266266
params: {
267267
/** New width in pixels */
268268
width?: number;
@@ -276,7 +276,7 @@ export interface McpUiSizeChangeNotification {
276276
* @internal
277277
*/
278278
export const McpUiSizeChangeNotificationSchema = z.object({
279-
method: z.literal("ui/notifications/size-change"),
279+
method: z.literal("ui/notifications/size-changed"),
280280
params: z.object({
281281
width: z.number().optional(),
282282
height: z.number().optional(),

0 commit comments

Comments
 (0)