Registries
Basalt is architected as a registry-driven workbench (ADR-018). Instead of hardcoding UI panels, tab renderers, or commands into layout components, the application shell renders declaratively from central registries.
This enables clean modularity across core features and allows runtime extensions (including WASM plugins) to contribute views, commands, and custom tab types seamlessly.
Core Registries
1. View Registry (viewRegistry)
Manages side-dock panels mounted in the collapsible left and right docks:
- Location:
packages/views/ - Core Registrations:
file-explorer— Vault directory tree navigationsearch— Full-text and fuzzy search interfacebookmarks— Pinned notes and saved queriesbacklinks— Inbound links to active notetags— Vault tag cloud and frequency listcalendar— Daily notes and date-based entriesassets— Vault media and attachment gallerynote-properties— Structured frontmatter inspector
Each view defines an icon, title, initial dock placement (left/right), and a React component that mounts when focused.
2. Leaf Registry (leafRegistry)
Controls the content rendered inside split-pane tabs:
- Core Leaf Types:
markdown— CodeMirror 6 live-preview and source editorcanvas— Infinite spatial layout canvas (ADR-035)drawing— Vector sketchpad / Excalidraw integrationkanban— Dedicated board view for tasks and cardsgraph— 2D/3D force-directed link graphplugin-iframe— Sandboxed iframe host for third-party guest plugins (ADR-058)
When a tab is opened, its tab.leafType is matched against the registry to resolve the appropriate view component and state controller.
3. Command Registry (commandRegistry)
The single source of truth for all user actions, shortcuts, and menu triggers:
- Location:
packages/commands/ - Responsibilities:
- Command palette (
Ctrl+P/Cmd+P) indexing and fuzzy matching. - Keybinding registration and chord resolution.
- Action execution with dependency injection of active workspace context.
- Command palette (
4. Settings Registry (settingsRegistry)
Declaratively describes all configurable preferences across the workspace:
- Features contribute settings schemas (type, default, label, description, validator).
- The Settings modal dynamically renders forms, inputs, switches, and sliders directly from the schema without custom UI per feature.
5. Benchmark Registry (registerBenchmark)
Registers performance benchmark entries with the bench kernel (ADR-053):
- Enables automated micro-benchmarks and latency tests for any surface across 1k, 5k, and 25k note tiers.
Runtime Extensibility (Plugins)
With ADR-057 and ADR-058, WASM plugins can register dynamic leaf kinds at runtime:
┌────────────────────────────────────────────────────────┐
│ Guest Plugin (WASM) │
│ Calls plugin_api.register_leaf_type("pomodoro") │
├────────────────────────────────────────────────────────┤
│ Host (Rust wasmtime host) │
│ Validates manifest capability ("leaf:register") │
├────────────────────────────────────────────────────────┤
│ Frontend Shell │
│ Registers entry in leafRegistry │
│ Mounts sandboxed PluginIframeLeaf upon tab selection │
└────────────────────────────────────────────────────────┘
The shell requires zero code changes or rebuilds to support new tab or panel types introduced by plugins.