cadrumo.entrypoints.tui.profile.overview module¶
The profile manager: your profile as data you can edit, not steps to finish.
This is what the operator lands on after registering, and what
config profile edit opens directly. It replaces the wizard’s review
page, which enumerated the questions of a setup flow with a status
glyph each — a progress meter for a process, telling the operator where
they were in a walk but never what their profile actually held.
The page here is the profile itself: every schema section, every declared field, and the value on record for it — including one row per instance of a fact the taxpayer holds several of, so three socios read as three rows rather than one. A field the operator has not filled in is a visible empty row, because “what is still blank” is the question this page exists to answer. Selecting any row edits it in place and writes immediately; there is no submit step, no final commit, and no ordering. Completeness names the schema-required information still missing — never arithmetic and never a gate on viewing or editing.
The screen owns no profile logic. The page content is
build_profile_overview(), and an
edit is an authenticated revision-bound fact command.
See also
ProfileOverviewThe typed projection this screen renders.
- class FieldEditScreen(field, *, prompt=None, choice_labels=None, validate=None)[source]¶
Bases:
ModalScreen[str|None]Edit one projected profile field without owning profile policy.
- Parameters:
- DEFAULT_CSS: ClassVar[str]¶
Default TCSS.
- BINDINGS: ClassVar¶
A list of key bindings.
- on_option_list_option_selected(event)[source]¶
Submit the option explicitly selected by the operator.
- Return type:
- Parameters:
event (OptionSelected)
- can_focus: bool¶
Widget may receive focus.
- can_focus_children: bool¶
Widget’s children may receive focus.
- class ProfileManagerScreen(overview, *, persist, complete_setup=None, validate=None, launch_source=None, credential_postures=None, open_document_reader=None)[source]¶
Bases:
TypedAppAccess,AccountChromeScreenFull-screen profile overview with in-place editing.
- Parameters:
overview (ProfileOverview)
persist (Callable[[str, str], ProfileOverview])
complete_setup (Callable[[], ProfileOverview] | None)
launch_source (Callable[[ProfileAcquisitionSourceV1], Awaitable[None]] | None)
credential_postures (Sequence[AcquisitionSourceCredentialPostureV1] | None)
open_document_reader (Callable[[], Screen[None]] | None)
- SCOPED_CSS: ClassVar[bool]¶
Should default css be limited to the widget type?
- DEFAULT_CSS: ClassVar[str]¶
Default TCSS.
- BINDINGS: ClassVar¶
A list of key bindings.
- compose()[source]¶
Called by Textual to create child widgets.
This method is called when a widget is mounted or by setting recompose=True when calling [refresh()][textual.widget.Widget.refresh].
Note that you don’t typically need to explicitly call this method.
Example
def compose(self) -> ComposeResult: yield Header() yield Label("Press the button below:") yield Button() yield Footer()
- async on_mount()[source]¶
Install the presentation theme and render the supplied overview.
- Return type:
- async on_button_pressed(event)[source]¶
Launch the pressed source’s operation through the injected door only.
Refused while a field write is in flight, for the reason the edit entry points give: an acquisition source rewrites profile facts by merging into the record as it loads it, so one started before the operator’s edit had landed would merge into the pre-edit facts and drop that field. This was the one mutation entry point without the guard, and the omission is currently masked rather than harmless – the installed launcher supplies no
launch_source, so the button is disabled and the handler returns above. It becomes reachable the moment that door is wired.
- can_focus: bool¶
Widget may receive focus.
- can_focus_children: bool¶
Widget’s children may receive focus.
- on_data_table_row_selected(event)[source]¶
Open the edit dialog for the selected field.
Refused while a write is in flight: the door merges into the record as it loads it, so a second edit started before the first landed would merge into the pre-edit facts and drop the first field.
- Return type:
- Parameters:
event (RowSelected)
- check_action(action, parameters)[source]¶
Hide the completion key once there is nothing to complete.
- action_complete_setup()[source]¶
Ask the store to declare this profile’s setup complete, off the event loop.
- Return type:
- async on_worker_state_changed(event)[source]¶
Land one finished worker back on Textual’s UI task.
Widgets are only safe to touch from this task, so every repaint waits until here rather than happening in the worker.
- Return type:
- Parameters:
event (StateChanged)
- async action_quit()[source]¶
Leave the manager, unless a field write is still landing.
A thread-backed write cannot be cancelled safely: quitting would only detach its result while encrypted storage may still complete the save, so the operator would leave believing an edit was lost that in fact landed. Waiting for the one in-flight write is the honest behaviour, and it is bounded by a single storage round trip.
- Return type:
- action_choose_language()[source]¶
Open the language chooser on the field that already holds it.
The language is an ordinary profile field and is written through the ordinary door: this opens the same dialog selecting a row would open, on the same field, and hands the answer to the same callback, so there is no second way for the language to be set. What the binding adds is reachability — the setting that decides what every other row says should not itself be findable only by reading them.
The tokens are shown as language names, because an operator whose page is in a language they do not read is exactly the one who cannot be asked to recognise
hu. Each name is written in its own language for the same reason: that operator cannot read “Húngaro” on a Spanish page either, but does read “Magyar”.- Return type: