yera.ui.rendering.context

Define the trusted rendering boundary and complete shell input.

TrustedHTML identifies fragments already assembled by Yera renderers. The type adds no runtime sanitization: callers must escape untrusted values before marking a fragment trusted. ShellContext keeps those fragments distinct from plain values that the shell renderer escapes itself.

Symbols

class ShellContext — Supply all dynamic content required to render one browser shell.

ShellContext

Supply all dynamic content required to render one browser shell.

Fields typed as TrustedHTML are inserted as complete fragments. Plain string fields are data and are escaped by render_shell before template substitution.

Fields

composer
type: yera.ui.rendering.context.TrustedHTML (required)

Trusted input-composer fragment.

listener
type: yera.ui.rendering.context.TrustedHTML (required)

Trusted SSE-listener fragment.

page_title
type: str = ''

Plain browser-page title.

current_screen
type: str = ''

Stable key of the active top-level screen.

initial_sidebar
type: str = ''

Plain sidebar context identifier.

sidebar_open
type: bool = False

Whether the desktop sidebar starts expanded.

session_id
type: str = ''

Plain active-session identifier.

session_title
type: str = ''

Plain user-facing session title.

app_id
type: str = ''

Plain active-app identifier.

main_content
type: yera.ui.rendering.context.TrustedHTML = ''

Trusted primary-screen fragment.

initial_sidebar_url
type: str = ''

Plain URL used to load contextual sidebar content.

live_workspace_content
type: yera.ui.rendering.context.TrustedHTML = ''

Trusted Live-screen workspace fragment.

activity_drawer_content
type: yera.ui.rendering.context.TrustedHTML = ''

Trusted optional activity-drawer fragment.

activity_drawer_refresh_url
type: str = ''

URL used to refresh the drawer content.

Methods


ShellContext.__init__

__init__(
    composer: TrustedHTML,
    listener: TrustedHTML,
    page_title: str = '',
    current_screen: str = '',
    initial_sidebar: str = '',
    sidebar_open: bool = False,
    session_id: str = '',
    session_title: str = '',
    app_id: str = '',
    main_content: TrustedHTML = TrustedHTML(''),
    initial_sidebar_url: str = '',
    live_workspace_content: TrustedHTML = TrustedHTML(''),
    activity_drawer_content: TrustedHTML = TrustedHTML(''),
    activity_drawer_refresh_url: str = '',
) → None