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:
StrEnumOne account control the workbench offers, whatever surface invoked it.
The value doubles as the locale leaf under
tui.root.account(the control’s name) andtui.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:
- 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:
- Parameters:
action (AccountActionV1)
- account_action_help(action)[source]¶
Describe what one account control does, in the language now on screen.
- Return type:
- Parameters:
action (AccountActionV1)
- class TuiAccountHostV1(*args, **kwargs)[source]¶
Bases:
ProtocolThe 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:
- Parameters:
action (AccountActionV1)
- account_status_line(session)[source]¶
Say who is signed in, in what state, and until when if that is known.
- Return type:
- Parameters:
session (HomeAccountSession | None)
- class AccountBar(*, id=None)[source]¶
Bases:
StaticOne 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.
- 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]¶
-
A workbench destination: the account bar above it, the key footer below.
The chrome is mounted from a decorated
Mounthandler rather than anon_mountmethod, so it runs alongside – not instead of – whateveron_mounta 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.
- 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:
- can_focus: bool¶
Widget may receive focus.
- can_focus_children: bool¶
Widget’s children may receive focus.