yera.ui.rendering.views.sessions
Classify and render live, historical, and offline sessions.
Classification preserves the session store's ordering while separating active sessions, replayable history, and sessions whose app is no longer available. Renderers escape persisted titles, identifiers, statuses, and app names before returning trusted screen, sidebar, or mobile-detail fragments.
Symbols
classify_sessions
classify_sessions(
records: list[SessionRecord],
available_app_ids: Collection[str],
) → SessionGroupsClassify ordered session records without changing their order.
Parameters
Session records in their intended display order.
Apps currently available on this server.
Returns
Session records grouped by availability and persisted lifecycle state.
render_live_sessions
render_live_sessions(
apps: Mapping[str, AppReference],
live_by_app: dict[str, list[SessionRecord]],
) → TrustedHTMLRender active sessions for the canonical Live screen.
Parameters
Available applications keyed by stable identifier.
Active session records grouped by application identifier.
Returns
Trusted HTML containing the live-session groups.
render_mobile_session_detail
render_mobile_session_detail(
record: SessionRecord,
app_name: str,
app_available: bool,
) → TrustedHTMLRender persisted session metadata as a pushed mobile screen.
Parameters
Persisted session being inspected.
Human-readable app name or its stored identifier.
Whether the app is currently registered on this server.
Returns
Trusted HTML containing the mobile session detail.
Raises
If a required detail template placeholder is missing.
render_session_sidebar
render_session_sidebar(
record: SessionRecord,
app_name: str,
app_available: bool,
) → TrustedHTMLRender persisted metadata and navigation for one selected session.
Parameters
Persisted session being inspected.
Human-readable app name or its stored identifier.
Whether the app is currently registered on this server.
Returns
Contextual session-inspector HTML.
Raises
If a required sidebar template placeholder is missing.
render_sessions_home
render_sessions_home(
records: list[SessionRecord],
apps: Mapping[str, AppReference],
selected_session_id: str = '',
mode: SessionViewMode = SessionViewMode.CHRONOLOGICAL,
) → TrustedHTMLRender persisted sessions as main-screen navigation.
Parameters
Sessions ordered for display.
Apps currently available on this server.
Session to mark as selected, if any.
History ordering and grouping presentation.
Returns
Main-screen HTML for session exploration.
SessionGroups
Hold sessions grouped by lifecycle and app availability.
Fields
Running and waiting sessions grouped by app ID.
Completed, failed, interrupted, and unstarted sessions whose app remains available.
Sessions whose recorded app is unavailable.
Methods
SessionGroups.__init__
__init__(
live_by_app: dict[str, list[SessionRecord]],
historical_by_app: dict[str, list[SessionRecord]],
offline_by_app: dict[str, list[SessionRecord]],
) → NoneSessionViewMode
StrEnumChoose chronological or app-grouped history presentation.