Skip to content

Views

Immutable navigation, result, detail, status, and selection models rendered by the workbench. The page guide maps information shapes to useful views.

Generic presentation models rendered by the shared workbench.

MAX_VIEW_ACTIONS module-attribute

MAX_VIEW_ACTIONS = 6

DetailView

DetailView = TextView | KeyValueView | TableView

NavigationItem

NavigationItem = SectionItem | CatalogueItem

PageNavigation

PageNavigation = SectionNavigation | CatalogueNavigation

SelectionMode

SelectionMode = Literal[
    "single", "multiple", "all_or_specific"
]

SurfaceView

SurfaceView = (
    TableView
    | SelectionTableView
    | TreeView
    | EmptyView
    | LoadingView
)

ViewActionVariant

ViewActionVariant = Literal[
    "default", "primary", "success", "warning", "error"
]

CatalogueItem dataclass

CatalogueItem(
    key: str,
    label: str,
    kind: str,
    ref: object | None = None,
    status: SemanticStatus = SemanticStatus.INFO,
    children: tuple[CatalogueItem, ...] = (),
)

One navigable item in a page's catalogue tree.

children class-attribute instance-attribute

children: tuple[CatalogueItem, ...] = ()

key instance-attribute

key: str

kind instance-attribute

kind: str

label instance-attribute

label: str

ref class-attribute instance-attribute

ref: object | None = None

status class-attribute instance-attribute

status: SemanticStatus = SemanticStatus.INFO

CatalogueNavigation dataclass

CatalogueNavigation(
    items: tuple[CatalogueItem, ...],
    title: str = "Catalogue",
)

Hierarchical page navigation rendered as a catalogue tree.

items instance-attribute

items: tuple[CatalogueItem, ...]

title class-attribute instance-attribute

title: str = 'Catalogue'

EmptyView dataclass

EmptyView(
    title: str,
    message: str,
    status: SemanticStatus = SemanticStatus.IDLE,
    command: str | None = None,
    actions: tuple[ViewAction, ...] = (),
)

A surface view explaining that no rows are available.

actions class-attribute instance-attribute

actions: tuple[ViewAction, ...] = ()

command class-attribute instance-attribute

command: str | None = None

message instance-attribute

message: str

status class-attribute instance-attribute

status: SemanticStatus = SemanticStatus.IDLE

title instance-attribute

title: str

KeyValueView dataclass

KeyValueView(
    rows: tuple[tuple[str, str], ...], title: str = "Detail"
)

Structured detail content rendered as a two-column table.

rows instance-attribute

rows: tuple[tuple[str, str], ...]

title class-attribute instance-attribute

title: str = 'Detail'

LoadingView dataclass

LoadingView(
    title: str,
    message: str,
    detail: str | None = None,
    command: str | None = None,
    actions: tuple[ViewAction, ...] = (),
)

A surface view for in-progress page work.

actions class-attribute instance-attribute

actions: tuple[ViewAction, ...] = ()

command class-attribute instance-attribute

command: str | None = None

detail class-attribute instance-attribute

detail: str | None = None

message instance-attribute

message: str

title instance-attribute

title: str

SectionItem dataclass

SectionItem(
    key: str,
    label: str,
    status: SemanticStatus = SemanticStatus.INFO,
    description: str | None = None,
)

One flat, navigable section within a page.

description class-attribute instance-attribute

description: str | None = None

key instance-attribute

key: str

label instance-attribute

label: str

status class-attribute instance-attribute

status: SemanticStatus = SemanticStatus.INFO

SectionNavigation dataclass

SectionNavigation(
    items: tuple[SectionItem, ...], title: str = "Sections"
)

Flat page navigation rendered as a selectable section list.

items instance-attribute

items: tuple[SectionItem, ...]

title class-attribute instance-attribute

title: str = 'Sections'

SelectionTableRow dataclass

SelectionTableRow(
    key: str,
    cells: tuple[str, ...],
    selected: bool = False,
    disabled: bool = False,
    selection_group: str | None = None,
    detail: object | None = None,
)

One selectable row in a workbench-owned selection table.

cells instance-attribute

cells: tuple[str, ...]

detail class-attribute instance-attribute

detail: object | None = None

disabled class-attribute instance-attribute

disabled: bool = False

key instance-attribute

key: str

selected class-attribute instance-attribute

selected: bool = False

selection_group class-attribute instance-attribute

selection_group: str | None = None

SelectionTableView dataclass

SelectionTableView(
    title: str,
    columns: tuple[str, ...],
    rows: tuple[SelectionTableRow, ...],
    status: SemanticStatus = SemanticStatus.INFO,
    message: str | None = None,
    actions: tuple[ViewAction, ...] = (),
    selection_mode: SelectionMode = "multiple",
    all_row_key: str | None = None,
)

A table-shaped surface where Groundskeeping owns row toggle semantics.

actions class-attribute instance-attribute

actions: tuple[ViewAction, ...] = ()

all_row_key class-attribute instance-attribute

all_row_key: str | None = None

columns instance-attribute

columns: tuple[str, ...]

message class-attribute instance-attribute

message: str | None = None

rows instance-attribute

rows: tuple[SelectionTableRow, ...]

selection_mode class-attribute instance-attribute

selection_mode: SelectionMode = 'multiple'

status class-attribute instance-attribute

status: SemanticStatus = SemanticStatus.INFO

title instance-attribute

title: str

SemanticStatus

Bases: StrEnum

Small health/status vocabulary understood by shared widgets.

ERROR class-attribute instance-attribute

ERROR = 'error'

IDLE class-attribute instance-attribute

IDLE = 'idle'

INFO class-attribute instance-attribute

INFO = 'info'

OK class-attribute instance-attribute

OK = 'ok'

RUNNING class-attribute instance-attribute

RUNNING = 'running'

WARNING class-attribute instance-attribute

WARNING = 'warning'

TableRow dataclass

TableRow(
    key: str,
    cells: tuple[str, ...],
    detail: object | None = None,
)

One row in a selectable workbench table.

cells instance-attribute

cells: tuple[str, ...]

detail class-attribute instance-attribute

detail: object | None = None

key instance-attribute

key: str

TableView dataclass

TableView(
    title: str,
    columns: tuple[str, ...],
    rows: tuple[TableRow, ...],
    status: SemanticStatus = SemanticStatus.INFO,
    message: str | None = None,
    actions: tuple[ViewAction, ...] = (),
)

A table-shaped surface view.

TableRow.key is the stable identity used by the workbench when a consumer calls its refresh API. Keep keys stable for rows that remain in the underlying data set so the operator's cursor can follow the same row as cells and row membership change.

actions class-attribute instance-attribute

actions: tuple[ViewAction, ...] = ()

columns instance-attribute

columns: tuple[str, ...]

message class-attribute instance-attribute

message: str | None = None

rows instance-attribute

rows: tuple[TableRow, ...]

status class-attribute instance-attribute

status: SemanticStatus = SemanticStatus.INFO

title instance-attribute

title: str

TextView dataclass

TextView(title: str, body: str)

Free-text detail content.

body instance-attribute

body: str

title instance-attribute

title: str

TreeNode dataclass

TreeNode(
    label: str,
    status: SemanticStatus = SemanticStatus.INFO,
    fields: Mapping[str, object] = dict(),
    children: tuple[TreeNode, ...] = (),
)

A tree-shaped detail node.

children class-attribute instance-attribute

children: tuple[TreeNode, ...] = ()

fields class-attribute instance-attribute

fields: Mapping[str, object] = field(default_factory=dict)

label instance-attribute

label: str

status class-attribute instance-attribute

status: SemanticStatus = SemanticStatus.INFO

TreeView dataclass

TreeView(
    title: str,
    rows: tuple[TreeNode, ...] = (),
    status: SemanticStatus = SemanticStatus.INFO,
    message: str | None = None,
    notes: tuple[str, ...] = (),
    actions: tuple[ViewAction, ...] = (),
)

A nested, heterogeneous surface view.

actions class-attribute instance-attribute

actions: tuple[ViewAction, ...] = ()

message class-attribute instance-attribute

message: str | None = None

notes class-attribute instance-attribute

notes: tuple[str, ...] = ()

rows class-attribute instance-attribute

rows: tuple[TreeNode, ...] = ()

status class-attribute instance-attribute

status: SemanticStatus = SemanticStatus.INFO

title instance-attribute

title: str

ViewAction dataclass

ViewAction(
    key: str,
    label: str,
    variant: ViewActionVariant = "default",
    disabled: bool = False,
)

One command rendered with the current workbench view.

The shared workbench renders at most MAX_VIEW_ACTIONS actions. Extra actions remain part of the view model but are not assigned visible buttons.

disabled class-attribute instance-attribute

disabled: bool = False

key instance-attribute

key: str

label instance-attribute

label: str

variant class-attribute instance-attribute

variant: ViewActionVariant = 'default'

WorkbenchLabels dataclass

WorkbenchLabels(
    navigation_panel: str = "Sections",
    result_panel: str = "Rows",
    detail_panel: str = "Detail",
    initial_result_summary: str = "Select a section to inspect it.",
    key_value_columns: tuple[str, str] = ("Field", "Value"),
)

Operator-facing labels for reusable workbench chrome.

Page-owned content still supplies its own titles through navigation and view contracts. These labels only cover structural defaults in the shared shell.

detail_panel class-attribute instance-attribute

detail_panel: str = 'Detail'

initial_result_summary class-attribute instance-attribute

initial_result_summary: str = (
    "Select a section to inspect it."
)

key_value_columns class-attribute instance-attribute

key_value_columns: tuple[str, str] = ('Field', 'Value')

navigation_panel class-attribute instance-attribute

navigation_panel: str = 'Sections'

result_panel class-attribute instance-attribute

result_panel: str = 'Rows'