Workbench Architecture
hone-ide is the IDE workbench shell. It assembles the editor, terminal, and core services into the full IDE experience. Compiled to a native binary via Perry.
Entry Point
src/app.ts is the Perry App() entry point:
App({
title: 'Hone',
width: 1200,
height: 800,
icon: 'hone-icon.png',
body: body
})
Bootstrap sequence:
- Load and apply theme
- Detect platform (
__platform__compile-time constant: 0=macOS, 1=iOS, 2=Android) - Register commands and keybindings
- Initialize panel registry
- Check for first-run (show setup screen) or launch normal workbench
- Initialize plugin system (conditional on
__plugins__compile flag)
Render Tree
src/workbench/render.ts defines the main UI layout:
+--+---------------------+------------------+
| | | |
|A | Sidebar | Editor Area |
|c | (explorer, search, | (tab bar + |
|t | git, debug, etc.) | editors) |
|i | | |
|v | | |
|i | +------------------+
|t | | Panels |
|y | | (terminal, |
| | | output, debug) |
|B | | |
|a | | |
|r | | |
+--+---------------------+------------------+
| Status Bar |
+-------------------------------------------+
- Activity bar – Left icon strip for switching sidebar views
- Sidebar – Contextual panel selected by activity bar
- Editor area – Tab bar with open files, editor instances below
- Panels – Bottom area for terminal, output, debug console
- Status bar – Language mode, cursor position, encoding, git branch, sync status
Views
25+ views organized in src/workbench/views/:
| View | Purpose |
|---|---|
ai-chat | AI chat panel with multi-turn conversation |
ai-inline | AI inline completion UI |
debug | Debugger controls, call stack, variables, watch |
diff | Side-by-side and inline diff viewer |
explorer | File tree, open editors |
extensions | Installed and available extensions |
find | Find and replace across workspace |
git | Staging, commits, branches, remotes |
lsp | Language server UI components: |
– autocomplete: completion popover | |
– diagnostics: error/warning list | |
– hover: hover information card | |
– signature: function signature help | |
notifications | Toast notifications |
plugins | V2 plugin management |
pr-review | Pull request review with AI annotations |
quick-open | Fuzzy file finder (Cmd+P) |
recent | Recently opened files and workspaces |
search | Workspace-wide text search |
settings-ui | Visual settings editor |
setup | First-run configuration wizard |
sync | Cross-device sync status and settings |
tabs | Tab bar and tab management |
terminal | Integrated terminal |
update | Application update notifications |
welcome | Welcome tab with getting-started content |
status-bar | Status bar segments |
Command System
Commands are the primary way to expose IDE functionality:
- Command registry – central map of command ID to handler function
- Keybindings – modifier keys, chord sequences (e.g., Ctrl+K Ctrl+C), platform-specific defaults
- When-clauses – conditional activation (e.g.,
editorTextFocus,inDebugMode) - Commands are contributed by core, views, and extensions
Native Menu Bar
Platform-native menu bar setup with standard menus (File, Edit, Selection, View, Go, Run, Terminal, Help). Menu items map to commands.
Grid Layout System
The workbench uses a grid layout for arranging sidebar, editor area, and panels:
- Resizable splits between sidebar and editor area
- Resizable splits between editor area and bottom panels
- Collapsible sidebar and panels
- Persisted layout dimensions in settings
Panel Registry
Built-in panels are registered at startup:
- Terminal panel
- Output panel
- Debug console panel
- Additional panels contributed by extensions
Theme Engine
Loads and applies VSCode-compatible JSON themes:
- Theme colors accessed via getter functions (
getEditorBackground(),getSideBarBackground(), etc.) - Applied at two levels: workbench chrome colors and editor token colors
- Theme switching without restart
- See Theme Architecture for details
Settings
Layered settings with precedence:
- Language-specific (highest priority)
- Workspace (
.hone/settings.json) - User (
~/.hone/settings.json) - Defaults (lowest priority)
Perry UI Considerations
Perry’s UI system creates widgets once and mutates them imperatively (not declarative/virtual-DOM). Key constraints:
- Widgets are created in the render function and updated via property mutations
- Closures must follow Perry’s by-value capture rule – use module-level state and module-level functions
- No
requestAnimationFrame– usesetIntervalfor animation loops - No
setTimeoutself-recursion – usesetInterval