cadrumo.entrypoints.tui.app module

The projection-only navigation join for one dedicated TUI session.

The root receives an immutable Home projection refresh door and a closed, already-admitted destination catalogue. It mounts one destination at a time, returns from real child dismissals to refreshed Home, and preserves the Home row’s semantic identity without taking on business, persistence, or network authority.

class RootBindingV1(destination_catalogue, refresh_home, workbench_search_service, refresh_workbench_search, refresh_destination_catalogue, account_factories, read_account_session)[source]

Bases: object

Every door the root needs for one authenticated session, built off the loop.

Parameters:
destination_catalogue: TuiDestinationCatalogueV1
refresh_home: TypeAliasType
workbench_search_service: WorkbenchSearchDoorV1 | None
refresh_destination_catalogue: TypeAliasType | None
account_factories: AccountFactoriesV1
read_account_session: Callable[[], HomeAccountSession] | None
class CadrumoTuiApp(*, services, destination_catalogue=None, refresh_home=None, workbench_search_service=None, refresh_workbench_search=None, refresh_destination_catalogue=None, account_factories=None, read_account_session=None, load_root=None)[source]

Bases: App[AccountRecomposeRequiredV1 | None]

Host one composed TUI session and whichever areas are joinable.

Parameters:
CSS: ClassVar[str]

Inline CSS, useful for quick scripts. This is loaded after CSS_PATH, and therefore takes priority in the event of a specificity clash.

BINDINGS: ClassVar

The default key bindings.

COMMANDS: ClassVar[set[type[Provider] | Callable[[], type[Provider]]]]

Command providers used by the [command palette](/guide/command_palette).

Should be a set of [command.Provider][textual.command.Provider] classes.

property services: OperationComposedServices

The composed operation services an area receives when it mounts.

property destination_catalogue: TuiDestinationCatalogueV1

Return the caller-composed closed catalogue for palette navigation.

property workbench_search_service: WorkbenchSearchDoorV1

Return the caller-composed application search door for the palette.

property home_refresh_refusal_code: str | None

Expose only a sanitized refusal code for host presentation.

property workbench_search_refusal_code: str | None

Expose only a sanitized availability code for host presentation.

compose()[source]

Yield child widgets for a container.

This method should be implemented in a subclass.

Return type:

Iterable[Widget]

on_mount()[source]

Install the shared appearance for this session.

Return type:

None

property account_actions_available: bool

Whether the account controls can act right now.

False without account doors, and while a credential or modal screen is open, so the palette withholds them exactly where the keys are hidden.

property account_session: HomeAccountSession | None

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

refresh_account_chrome()[source]

Re-word the account keys and every account bar after a language change.

Return type:

None

check_action(action, parameters)[source]

Hide the account keys wherever the controls would not act.

Return type:

bool | None

Parameters:
get_system_commands(screen)[source]

Offer only Cadrumo’s own session commands, in the operator’s language.

Textual’s defaults are English whatever the page says, and its theme switcher leaves Cadrumo’s light and dark pair for themes the product does not style. Appearance is listed here rather than with the account controls because it needs no profile.

Return type:

Iterable[SystemCommand]

Parameters:

screen (Screen[object])

action_command_palette()[source]

Open the palette with its prompt in the operator’s language.

Return type:

None

action_toggle_appearance()[source]

Flip between the light and dark appearance.

Return type:

None

action_account(action)[source]

Run the account control a key names.

Return type:

None

Parameters:

action (str)

run_account_action(action, /)[source]

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

Every surface that offers a control – the keys, the palette – ends here, so none of them can reach a door the others cannot, or refuse differently.

Return type:

None

Parameters:

action (AccountActionV1)

navigate_to(target, /)[source]

Mount only the current admitted destination with its semantic focus.

Return type:

None

Parameters:

target (TuiNavigationTargetV1)

on_home_target_selected(event)[source]

Open what the selected Home row points at, and remember the row.

The row is remembered by its domain identity, never its position, so the return journey lands on it again. Selecting a row used to do only that, which left Home’s suggested actions, resumable declarations and agenda looking selectable while leading nowhere.

Return type:

None

Parameters:

event (HomeTargetSelected)

on_home_back_requested(_)[source]

Refresh Home after a completed or dismissed journey.

Return type:

None

Parameters:

_ (HomeBackRequested)

replace_workspace_body(screen, /)[source]

Show another body of the destination the operator is already inside.

The destination does not change, so the return journey does not either: the replacement keeps the same dismissal callback, and Escape from any internal body returns to Home exactly as it does from the entry body. The root never learns which body this is – the workspace resolved it.

The swap is deferred onto this application’s own message pump, and that is load-bearing rather than tidiness. A screen’s result callback is dispatched through whichever pump was active when the screen was pushed, so pushing directly from inside the outgoing screen’s handler registers the return journey against a screen that is about to be popped. The callback then belongs to a stopped pump and never runs, and Escape from an internal area strands the operator on an empty root with no way back.

Return type:

None

Parameters:

screen (Screen[None])