Rename ctx.notify to broadcast_raw_notification#9581
Open
manzt wants to merge 3 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Renames the low-level code-mode context method for sending fully constructed frontend Notification payloads, clarifying that it is a raw “escape hatch” rather than a higher-level UI helper.
Changes:
- Renamed
ctx.notify(...)toctx.broadcast_raw_notification(...)in code-mode transaction broadcasting. - Expanded the method docstring to describe intended use, tradeoffs, and example notification types.
Comment on lines
+1725
to
+1726
| notification: A typed ``Notification`` instance. See module | ||
| docstring above for the available subtypes. |
Contributor
There was a problem hiding this comment.
No issues found across 1 file
Architecture diagram
sequenceDiagram
participant CM as Code Mode
participant Kernel as Kernel
participant Stream as Outbound Stream
participant Frontend as Frontend UI
Note over CM,Frontend: Code Transaction Flow
CM->>CM: _apply_ops() builds doc_ops
CM->>CM: Create Transaction from doc_ops
CM->>CM: Apply transaction to local document
CM->>Kernel: broadcast_raw_notification(NotebookDocumentTransactionNotification)
Note over CM,Kernel: Takes fully-constructed Notification payload
Kernel->>Stream: broadcast_notification(notification, stream)
Note over Kernel: No validation, batching, or debouncing
Stream-->>Frontend: Deliver transaction notification
Frontend->>Frontend: Apply document transaction to UI state
Note over CM,Stream: Other callers
alt Enqueueing commands
CM->>CM: enqueue_command(CommandMessage)
CM->>Kernel: broadcast_raw_notification(…)
end
alt Banner notifications
CM->>Kernel: broadcast_raw_notification(BannerNotification)
end
alt Alert dialogs
CM->>Kernel: broadcast_raw_notification(AlertNotification)
end
alt Package install progress
CM->>Kernel: broadcast_raw_notification(InstallingPackageAlertNotification)
end
alt Missing package prompts
CM->>Kernel: broadcast_raw_notification(MissingPackageAlertNotification)
end
alt Reload notification
CM->>Kernel: broadcast_raw_notification(ReloadNotification)
end
Note over CM,Frontend: All notifications flow through same path
mscolnick
approved these changes
May 18, 2026
The old name read like a toast helper, but the method is a low-level escape hatch that takes a fully-constructed `Notification` payload and puts it on the kernel's outbound stream.
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The old name read like a toast helper, but the method is a low-level escape hatch that takes a fully-constructed
Notificationpayload and puts it on the kernel's outbound stream.