Class: StudioUIMetadata¶
UI declarations for a Kind, consumed by Studio's manifest. Defaults are
conservative: no mode, no sidebar, no routes — the Kind is invisible in
Studio unless explicitly opted in. 1:1 with Python StudioUIMetadata.
Constructors¶
Constructor¶
Parameters¶
| Parameter | Type |
|---|---|
init |
StudioUIMetadataInit |
Returns¶
StudioUIMetadata
Properties¶
breadcrumb¶
description¶
display_order¶
feature_flag¶
icon¶
in_sidebar¶
label¶
mode¶
note¶
permissions¶
routes¶
Methods¶
fields()¶
static fields(): readonly (
| "mode"
| "in_sidebar"
| "display_order"
| "label"
| "icon"
| "description"
| "breadcrumb"
| "routes"
| "permissions"
| "note"
| "feature_flag")[];
The canonical field-name set (single source of truth for ui: validation).
Returns¶
readonly (
| "mode"
| "in_sidebar"
| "display_order"
| "label"
| "icon"
| "description"
| "breadcrumb"
| "routes"
| "permissions"
| "note"
| "feature_flag")[]
resolveLabel()¶
Resolve i18n label for the requested locale. Fallback order (mirrors
Python resolve_label):
1. Exact locale match (e.g. 'pt-BR').
2. Language-only fallback (e.g. 'pt' from 'pt-BR').
3. 'en' (project default).
4. null.
A plain-string label is returned as-is regardless of locale.
Parameters¶
| Parameter | Type | Default value |
|---|---|---|
locale |
string |
"en" |
Returns¶
string | null
toDict()¶
Serialize for the /kinds/manifest JSON response. Omits None/empty fields
so the wire payload stays small — EXACTLY the Python to_dict() omission
rules (studio_ui.py:161-192):
- mode: only if not null
- in_sidebar: only if true
- display_order: only if !== 100
- label/icon/description/note/feature_flag: only if not null
- breadcrumb: only if not null (an empty list IS kept, like Python)
- routes/permissions: only if non-empty
Returns¶
Record\<string, unknown>