cadrumo.entrypoints.tui.components.account_chrome module

The account chrome every workbench destination carries.

The account controls are performed by the workbench root; this module names them, declares the seam the root offers, and draws the one-line status bar and key footer that sit around each destination.

class AccountActionV1(*values)[source]

Bases: StrEnum

One account control the workbench offers, whatever surface invoked it.

The value doubles as the locale leaf under tui.root.account (the control’s name) and tui.root.account_help (what it does).

LANGUAGE
APPEARANCE
PROFILE
CHANGE_USER
PASSWORD
SIGN_OUT
account_action_label(action)[source]

Name one account control in the language now on screen.

Return type:

str

Parameters:

action (AccountActionV1)

account_key_label(action)[source]

Name one account control briefly, for the key footer.

The footer has to hold every account key on an eighty-column terminal, so it uses short names; the palette and help keep the full ones.

Return type:

str

Parameters:

action (AccountActionV1)

account_action_help(action)[source]

Describe what one account control does, in the language now on screen.

Return type:

str

Parameters:

action (AccountActionV1)

class TuiAccountHostV1(*args, **kwargs)[source]

Bases: Protocol

The root seam through which every account control is dispatched.

property account_actions_available: bool

Whether the account controls can act from the screen now in front.

property account_session: HomeAccountSession | None

The session the last Home projection described, once there is one.

run_account_action(action, /)[source]

Perform one account control through the session’s injected doors.

Return type:

None

Parameters:

action (AccountActionV1)

refresh_account_chrome()[source]

Re-word the account keys and bars after the page language changed.

Return type:

None

account_status_line(session)[source]

Say who is signed in, in what state, and until when if that is known.

Return type:

str

Parameters:

session (HomeAccountSession | None)

class AccountBar(*, id=None)[source]

Bases: Static

One status line above every destination: the signed-in profile and its session.

The controls themselves are reached through the key footer and the command palette, so the bar spends one row, not three. Hosted anywhere but the workbench root – a standalone screen host – it shows only the generic account label, because there is no session to describe.

Parameters:

id (str | None)

DEFAULT_CSS: ClassVar[str]

Default TCSS.

on_mount()[source]

Write the line in the language now on screen.

Return type:

None

refresh_copy()[source]

Re-read the session from the root and rewrite the line.

Return type:

None

can_focus: bool

Widget may receive focus.

can_focus_children: bool

Widget’s children may receive focus.

class AccountChromeScreen(name=None, id=None, classes=None)[source]

Bases: Screen[None]

A workbench destination: the account bar above it, the key footer below.

The chrome is mounted from a decorated Mount handler rather than an on_mount method, so it runs alongside – not instead of – whatever on_mount a destination defines, sync or async, and a destination gets its chrome without composing it itself. A destination that already composes a footer keeps that one.

Two widgets docked to the same edge share its first row, so the destination’s own banner is pushed one row down to sit beneath the bar: the bar is the application’s, the banner is this screen’s title.

Parameters:
  • name (str | None)

  • id (str | None)

  • classes (str | None)

SCOPED_CSS: ClassVar[bool]

Should default css be limited to the widget type?

DEFAULT_CSS: ClassVar[str]

Default TCSS.

refresh_account_chrome()[source]

Rewrite the account chrome after this page changed its language.

The root’s own key descriptions are rewritten too; they are shown in this page’s footer, and would otherwise stay in the old language until the operator returned to Home.

Return type:

None

can_focus: bool

Widget may receive focus.

can_focus_children: bool

Widget’s children may receive focus.