Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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:

  1. Load and apply theme
  2. Detect platform (__platform__ compile-time constant: 0=macOS, 1=iOS, 2=Android)
  3. Register commands and keybindings
  4. Initialize panel registry
  5. Check for first-run (show setup screen) or launch normal workbench
  6. 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/:

ViewPurpose
ai-chatAI chat panel with multi-turn conversation
ai-inlineAI inline completion UI
debugDebugger controls, call stack, variables, watch
diffSide-by-side and inline diff viewer
explorerFile tree, open editors
extensionsInstalled and available extensions
findFind and replace across workspace
gitStaging, commits, branches, remotes
lspLanguage server UI components:
autocomplete: completion popover
diagnostics: error/warning list
hover: hover information card
signature: function signature help
notificationsToast notifications
pluginsV2 plugin management
pr-reviewPull request review with AI annotations
quick-openFuzzy file finder (Cmd+P)
recentRecently opened files and workspaces
searchWorkspace-wide text search
settings-uiVisual settings editor
setupFirst-run configuration wizard
syncCross-device sync status and settings
tabsTab bar and tab management
terminalIntegrated terminal
updateApplication update notifications
welcomeWelcome tab with getting-started content
status-barStatus 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:

  1. Language-specific (highest priority)
  2. Workspace (.hone/settings.json)
  3. User (~/.hone/settings.json)
  4. 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 – use setInterval for animation loops
  • No setTimeout self-recursion – use setInterval