← All @molecule/* packages · App templates
@molecule/app-ideCore interface · ide · App (browser) · v1.0.1 · Apache-2.0
IDE workspace layout and resizable panel management
npm install @molecule/app-ide@molecule/app-ide is the ide core interface on the app (browser) side: the API your app calls, with no vendor inside.
Choose the implementation by bonding one of its 1 provider: @molecule/app-ide-default.
import { setProvider, requireProvider } from '@molecule/app-ide'
import { provider } from '@molecule/app-ide-default'
setProvider(provider) // once, at app startup (bonds.ts)
const workspace = requireProvider()
workspace.togglePanel('terminal')
const unsubscribe = workspace.subscribe((state) => renderLayout(state))Providers (1): @molecule/app-ide-default
Works with: @molecule/app-bond, @molecule/app-i18n
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
IDE workspace core interface for molecule.dev.
Framework-agnostic contract for multi-panel workspace layouts (chat,
editor, preview, terminal, …): panel visibility, sizing, active panel,
and layout persistence. Bond a provider (e.g. @molecule/app-ide-default,
which persists layout in browser storage) at startup; a framework binding
(e.g. @molecule/app-ide-react) renders the layout from this state.
import { setProvider, requireProvider } from '@molecule/app-ide'
import { provider } from '@molecule/app-ide-default'
setProvider(provider) // once, at app startup (bonds.ts)
const workspace = requireProvider()
workspace.togglePanel('terminal')
const unsubscribe = workspace.subscribe((state) => renderLayout(state))
core
npm install @molecule/app-ide @molecule/app-bond @molecule/app-i18n
PanelConfigConfiguration for an individual workspace panel including position, sizing constraints, and visibility.
interface PanelConfig {
id: PanelId
position: PanelPosition
minWidth?: number
minHeight?: number
defaultSize?: number
resizable?: boolean
collapsible?: boolean
visible?: boolean
}
WorkspaceConfigConfiguration options for creating a workspace provider.
interface WorkspaceConfig {
defaultLayout: WorkspaceLayout
persistLayout?: boolean
storageKey?: string
}
WorkspaceLayoutComplete workspace layout describing panel arrangement and sizing.
interface WorkspaceLayout {
panels: PanelConfig[]
sizes: Record<PanelPosition, number[]>
}
WorkspaceProviderWorkspace provider interface that all IDE workspace bond packages must implement. Manages panel layout, sizing, and visibility.
interface WorkspaceProvider {
/** Provider name identifier. */
readonly name: string
/** Returns the current workspace layout. */
getLayout(): WorkspaceLayout
/** Sets the entire workspace layout. */
setLayout(layout: WorkspaceLayout): void
/** Toggles visibility of a panel by ID. */
togglePanel(panelId: PanelId): void
/** Resizes a panel to the given size. */
resizePanel(panelId: PanelId, size: number): void
/** Sets the active (focused) panel. */
setActivePanel(panelId: PanelId): void
/**
* Subscribes to workspace state changes.
*
* @returns An unsubscribe function.
*/
subscribe(callback: (state: WorkspaceState) => void): () => void
/** Resets layout to the default configuration. */
resetLayout(): void
}
WorkspaceStateCurrent workspace state including layout, active panel, collapsed panels, and fullscreen mode.
interface WorkspaceState {
layout: WorkspaceLayout
activePanel: PanelId | null
collapsedPanels: Set<PanelId>
isFullscreen: boolean
}
PanelIdIdentifier for a workspace panel (built-in names or custom strings).
type PanelId = 'chat' | 'editor' | 'preview' | 'terminal' | 'deploy' | 'files' | string
PanelPositionPosition of a panel within the workspace layout.
type PanelPosition = 'left' | 'center' | 'right' | 'bottom'
getProvider()Retrieves the bonded IDE workspace provider, or null if none is bonded.
function getProvider(): WorkspaceProvider | null
Returns: The bonded workspace provider, or null.
hasProvider()Checks whether an IDE workspace provider is currently bonded.
function hasProvider(): boolean
Returns: true if an IDE workspace provider is bonded.
requireProvider()Retrieves the bonded IDE workspace provider, throwing if none is configured.
function requireProvider(): WorkspaceProvider
Returns: The bonded workspace provider.
setProvider(provider)Registers an IDE workspace provider as the active singleton.
function setProvider(provider: WorkspaceProvider): void
provider — The workspace provider implementation to bond.| Provider | Package |
|---|---|
| Default | @molecule/app-ide-default |
Peer dependencies:
@molecule/app-bond ^1.0.1@molecule/app-i18n ^1.0.1@molecule/app-bond
@molecule/app-i18n
This core manages layout STATE only — panels render via a framework
binding (React: @molecule/app-ide-react) or your own components reading
getLayout() + subscribe(). Wire the bond before the workspace mounts.
subscribe() returns an unsubscribe function — call it on teardown to avoid
duplicate renders after remounts.
PanelId accepts custom strings beyond the built-ins ('chat' | 'editor' |
'preview' | 'terminal' | 'deploy' | 'files') — register custom panels in the
layout rather than hardcoding a parallel layout system.
Layout persistence is the provider's concern (the default bond uses browser
storage) — never write layout state to localStorage yourself.
Integration checklist — drive the real rendered UI (live preview, no mocks):
navigate_preview to the IDE, read_preview_ui to snapshot the panel
regions, interact_preview to drag dividers and toggle panels. Adapt each
item to this app's actual panels/layout and check every box off one by one.
A box you can't check is an integration bug to fix — not a skip:
Translation strings are provided by @molecule/app-locales-ide.