Skip to content

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

new StudioUIMetadata(init?): StudioUIMetadata;

Parameters

Parameter Type
init StudioUIMetadataInit

Returns

StudioUIMetadata

Properties

readonly breadcrumb: string[] | null;

description

readonly description: string | LabelI18n | null;

display_order

readonly display_order: number;

feature_flag

readonly feature_flag: string | null;

icon

readonly icon: string | null;

in_sidebar

readonly in_sidebar: boolean;

label

readonly label: string | LabelI18n | null;

mode

readonly mode: ModeId | null;

note

readonly note: string | null;

permissions

readonly permissions: Record<string, string[] | string>;

routes

readonly routes: Record<string, string>;

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()

resolveLabel(locale?): string | null;

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()

toDict(): Record<string, unknown>;

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>