Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions marimo/_code_mode/_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ async def _apply_ops(
tx = Transaction(changes=tuple(doc_ops), source="code-mode")
# Apply to local snapshot so _cell_label can read names.
self._document.apply(tx)
self.notify(
self.broadcast_raw_notification(
NotebookDocumentTransactionNotification(transaction=tx)
)

Expand Down Expand Up @@ -1691,8 +1691,17 @@ def enqueue_command(self, command: CommandMessage) -> None:
type(command).__name__,
)

def notify(self, notification: Notification) -> None:
"""Send a notification to the frontend."""
def broadcast_raw_notification(self, notification: Notification) -> None:
"""Low-level: broadcast a fully-constructed ``Notification`` to the frontend.

Escape hatch for emitting notification payloads directly; the
payload is delivered as-is, with no validation, batching, or
debouncing. Prefer a higher-level helper on ``ctx`` when one exists.

See ``marimo._messaging.notification`` for the full discriminated
union. Agent-facing subtypes include ``BannerNotification`` (persistent
banner) and ``AlertNotification`` (modal dialog).
"""
broadcast_notification(notification, stream=self._kernel.stream) # type: ignore[arg-type]


Expand Down
Loading