Phials plugin documentation
User guide
AI Disclosure: This page was generated by an LLM and may contain inaccuracies. Hand-crafted documentation will be implemented over time on the road to 1.0

ModuleProvider

Since Plugin API: 1.0.0

Module provider - provides a UI module for panels and center tab groups

Modules are self-contained UI components like Navigator, File Preview, or Terminal that can be arranged in panel tabs or modular center groups.

Signature

interface ModuleProvider {
    type: "module";
    id: string;
    name: string;
    icon: string;
    allowedPositions?: ModulePosition[];
    defaultPosition?: ModulePosition;
    component: import("svelte").Component<ModuleProviderProps>;
    allowMultiple?: boolean;
    requiresRemount?: boolean;
    getDefaultState?: () => unknown;
    shortcut?: ItemShortcutConfig;
    getTabTitle?: (state?: unknown) => string;
    getTabIcon?: (state?: unknown) => string;
    getCenterTabIdentity?: (state?: unknown) => string | undefined;
    canReplaceCenterTab?: (currentState: unknown, requestedState: unknown) => boolean;
    finalizeCenterTab?: (moduleInstance: ModuleInstance) => Promise<boolean>;
    getTabBarMenuItems?: (moduleInstance: ModuleInstance, api: ModuleAPI) => import("phoundry-ui").MenuItem[];
}

Members

NameTypeRequiredDescription
type"module"yes-
idstringyesUnique module identifier (e.g., ‘phials.module.navigator’)
namestringyesHuman-readable name for display
iconstringyesIcon for tabs and headers
allowedPositionsModulePosition[]noPositions where this module can be placed (default: all panels, not center)
defaultPositionModulePositionnoDefault position for new instances
componentimport("svelte").Component<ModuleProviderProps>yesThe module component
allowMultiplebooleannoWhether multiple instances of this module are allowed (default: false)
requiresRemountbooleannoIf true, the center host fully remounts the component when the remount key changes: getCenterTabIdentity(state) when defined, otherwise the module instance id. Needed for lifecycle-heavy modules (Terminal, Page, Preview) so center tab replacement reloads content when only state changes. Default: false.
getDefaultState() => unknownnoDefault state for new module instances
shortcutItemShortcutConfignoKeyboard shortcut to toggle/focus this module
getTabTitle(state?: unknown) => stringnoDynamic tab title when rendered in center (falls back to name)
getTabIcon(state?: unknown) => stringnoDynamic tab icon when rendered in center (falls back to icon)
getCenterTabIdentity(state?: unknown) => string | undefinednoStable content identity used to focus an equivalent center tab before creating one.
canReplaceCenterTab(currentState: unknown, requestedState: unknown) => booleannoOpt in to same-type replacement of an active, unpinned center tab.
finalizeCenterTab(moduleInstance:ModuleInstance) => Promise<boolean>noFinalize or refuse unresolved state before close or center-tab replacement.
getTabBarMenuItems(moduleInstance:ModuleInstance, api:ModuleAPI) => import("phoundry-ui").MenuItem[]noOptional panel module tab bar menu items (phoundry-ui context menu rows).