NotificationCenterScreen(
self,
notifications: list[PendingNotification],
suppressed: set[str] |ModalScreen[NotificationActionResult | None]| Name | Type | Description |
|---|---|---|
notifications* | list[PendingNotification] | |
suppressed | set[str] | None | Default: None |
| Name | Type |
|---|---|
| notifications | list[PendingNotification] |
| suppressed | set[str] | None |
Shared hub for pending notifications and warning preferences.
Each PendingNotification is a single row followed by a settings
disclosure row. Up/Down (or j/k) moves the cursor; Enter or click drills
into a notification or toggles the inline settings section. Expanded
settings hand key focus to their first checkbox (Space/Enter toggle); Esc
there collapses back to the row cursor. Esc on the row cursor returns
None.
Entries to render. Order is preserved.
Currently suppressed warning keys, used to render
checkbox state when the settings section expands. None
means the app has not supplied settings state; the screen
preloads it from config on mount so the first expand has
the values ready.
Whether the inline warning preferences are currently expanded.
Whether key focus is on one of the settings checkboxes.
Used by DeepAgentsApp.action_toggle_auto_approve to route
shift+tab into reverse checkbox traversal instead of the row cursor.
Compose the modal layout.
Apply ASCII borders, highlight the first row, preload settings.
Stand the screen's key bindings down while a checkbox has focus.
The screen-level enter/up/down/tab bindings are priority, so
without this gate they consume the key before the focused Checkbox
can use it: Enter/Space must toggle (Textual binds them on
ToggleButton), and up/down/tab must step between checkboxes.
Returning False disables the screen binding for that dispatch so
the key reaches the checkbox / focus system.
Drill into the highlighted notification or toggle settings.
Collapse expanded settings, else close without firing an action.
Move the cursor up one row (wraps at the top).
Move the cursor down one row (wraps at the bottom).
Step checkbox focus backward for the app's shift+tab router.
The app-level priority shift+tab -> toggle_auto_approve binding
wins dispatch, and action_toggle_auto_approve routes cursor-style
modals to action_move_up via _SupportsReverseNav. With settings
expanded that would only move the row cursor and strand focus on the
first checkbox, so the app branches here instead (see
DeepAgentsApp.action_toggle_auto_approve).
Toggle the settings section from the disclosure row.
Handles the message locally so the section stays responsive when the app has no handler of its own (e.g. widget tests on a bare host app).
Persist warning suppression toggle to config.toml on change.
Handle a mouse click on a notification row.
Rebuild the hub from a refreshed notification snapshot.
Preserves a notification selection by key and keeps the settings row selected across refreshes. When a selected notification disappears, the cursor clamps to the remaining notification rows before falling back to settings. Warning preferences are refreshed from config so an in-place suppression is reflected if the user expands settings next. An expanded settings section is remounted so the refresh never silently collapses it.