Widgets¶
Textual renderers for the workbench, primitive views, and normalized telemetry. Pass them presentation-safe contracts rather than application service objects.
Catalogue, rows, and detail surface shared by consumer-owned pages.
Workbench ¶
Workbench(labels: WorkbenchLabels | None = None)
Bases: Widget
Shared page surface with navigation left and rows/detail right.
SelectionChanged ¶
SelectionChanged(
workbench: Workbench,
row_key: str,
selected_keys: tuple[str, ...],
)
SelectionHighlighted ¶
SelectionHighlighted(workbench: Workbench, row_key: str)
on_selection_list_selection_highlighted ¶
on_selection_list_selection_highlighted(
event: SelectionHighlighted[str],
) -> None
on_selection_list_selection_toggled ¶
on_selection_list_selection_toggled(
event: SelectionToggled[str],
) -> None
refresh_rows ¶
refresh_rows(view: TableView) -> None
Reconcile table rows in place while preserving the highlighted row by key.
Existing cells are updated without rebuilding the DataTable. Added and removed
rows are reconciled by their stable keys; if the highlighted row disappears, the
cursor stays at its previous position where possible. Cursor changes caused by
this reconciliation are deliberately silent, so a refresh cannot re-enter a
page's row_highlighted handler.
refresh_view ¶
refresh_view(view: SurfaceView) -> None
Refresh a surface, preserving cursor state when it is a table.
Consumer pages should use this for ordinary data refreshes. Table surfaces reconcile rows in place, and a loading surface already showing another loading view patches its text in place, since a long-running job may refresh this surface many times a second. Every other surface still uses the normal replacement path because it has no in-place identity to retain.
show_context_table ¶
show_context_table(
rows: Iterable[tuple[str, str]],
*,
columns: tuple[str, ...] | None = None,
) -> None
show_selection_rows ¶
show_selection_rows(
view: SelectionTableView,
*,
highlight_first: bool = True,
) -> None
update_loading ¶
update_loading(view: LoadingView) -> None
Patch an already-shown loading surface without re-hiding other widgets.
A long-running job may call this many times a second through
refresh_view(); only the pieces that actually changed are touched so the
result panel does not flicker.