LabKit MATLAB Workbench

explanation

LabKit App SDK

labkit.app is the MATLAB App SDK above LabKit's GUI-free domain libraries. Apps own scientific workflow, calculations, units, wording, plots, and exports. The SDK owns semantic layout, transactions, project documents, portable sources, dialogs, resources, results, and native component lifecycle.

Start Here

GoalDocumentation
Build or refactor an AppBuild a Complete App
Understand ownership boundariesArchitecture
Declare compatible LabKit modulesCompatibility contracts
Look up exact MATLAB syntaxPublic API reference
Browse the App SDK API by capabilityApp SDK API
Validate framework or GUI changesTesting

SDK Map

The required path has three concepts:

APIPurpose
labkit.app.DefinitionApp identity, lifecycle callbacks, layout, and launch
labkit.app.layout.*Semantic inputs, displays, containers, and workbench structure
labkit.app.view.SnapshotDerived visible state and App-owned rendering

Read an App in this order: definition.m shows its complete contract, +workbench/buildLayout.m shows the user workflow, and its capability packages show the controls, state transitions, presentation, and rendering owned by each feature. Open projectSpec.m or createSession.m only when the definition names those optional capabilities.

Layout controls bind directly to named App callbacks, and plot areas bind directly to their renderer. Apps do not maintain handler, renderer, or capability registries. Runtime-injected values are labkit.app.CallbackContext and typed labkit.app.event.* payloads. Callbacks name those boundary values explicitly and delegate domain work through narrow inputs.

Optional capabilities are grouped by purpose:

PackagePurpose
labkit.app.event.*Typed callback payloads
labkit.app.interaction.*Managed plot gestures with direct callbacks
labkit.app.plot.*Domain-neutral axes redraw, message, fit, and annotation mechanics
labkit.app.project.*Durable project schema and migration
labkit.app.result.*Exported files and result packages
labkit.app.dialog.*Explicit dialog outcomes
labkit.app.CallbackContextRuntime operations available inside callbacks

Smallest App

function app = definition()
    workbench = labkit.app.layout.workbench({ ...
        labkit.app.layout.field("gain", Label="Gain", ...
            Kind="numeric", Bind="project.parameters.gain"), ...
        labkit.app.layout.button("run", "Run", @runAnalysis, ...
            Tooltip="Compute the result from the current gain.")});
    app = labkit.app.Definition( ...
        Entrypoint="labkit_Example_app", AppId="example", ...
        Title="Example", Family="Examples", ...
        AppVersion="1.0.0", Updated="2026-07-19", ...
        Requirements=labkit.contract.requirements("app", ">=1 <2"), ...
        Workbench=workbench);
end

The entrypoint calls definition().launch(...). Definition compiles the immutable semantic graph before creating a figure, validates direct callback and renderer signatures, and builds one private native platform plan.

Paved Road

Runtime validates candidate state and the complete view snapshot before publishing either. The private MATLAB adapter maps semantic IDs to native components, preserves plot viewports, normalizes native event differences, and never exposes component registries to Apps.

Normal App launches show the completed native window. Official GUI validation uses the same launch path with a framework-owned visibility policy: hidden keeps the final window off screen and minimized minimizes it after startup. Tests therefore exercise real controls without individual Apps or test methods having to hide the window after launch.

Built-in App Tools

The native runtime installs one top-level Tools menu so framework-owned utilities do not compete with the App's workflow controls:

These actions are framework-owned native behavior. Apps do not declare menu items, implement clipboard integration, or duplicate project persistence callbacks.

Framework concepts and source names are versionless. Compatibility belongs to labkit.app.version; saved-data versions belong to labkit.app.project.Schema.

Change history