Home /Modules/ide-workbench/IDE-WORKBENCH.md

IDE-WORKBENCH.md

lib/ide-workbench/IDE-WORKBENCH.md · 137 line(s) · markdown

SLeeLa IDE Workbench — Architecture & Gap-Closure Plan

Revision: 0.1 · Family: ide-workbench

This package is the composition layer that turns the existing SLeeLa library contracts into a fully functional IDE for SLeeLa development. It does not reimplement windowing, compilation, or the document model — it wires together the authoritative packages that already exist:

            +---------------------------- IDE Workbench ----------------------------+
            |                                                                        |
  edit ---> | SLIdeEditor  --+                                                       |
            | SLIdeTabGroup  |  SLIdeCommandRegistry  (Save / Compile / Run / Open)  |
            | SLIdeProjectTree                                                        |
            | SLIdeDiagnosticsPanel                                                   |
            | SLIdeWorkbench  (owns the window, panels, lifecycle)                    |
            +----|-----------------|------------------|----------------|-------------+
                 |                  |                  |                |
          lib/gui (window,   lib/user-interface  lib/nordshrift   lib/sldocument
          actions, 1..14     + lib/ui (widgets)   (.sst -> .sleela) lib/compiler
          doc listener)                            = "SST Nordshrit" (compile/save/load)

Division of authority (unchanged from the repo's posture)

ConcernOwnerPackage
Window / actions / desktop lifecyclethe GUI integration layerlib/gui, lib/user-interface, lib/ui
.sst authoring → .sleela → compileNordshrift + the SLeeLa compilerlib/nordshrift, lib/compiler
Save / load / document modelthe document layerlib/sldocument
IDE composition (editor, tabs, tree, commands, panels)this packagelib/ide-workbench (new)

The IDE never becomes a second business-logic implementation: SLeeLa owns meaning, the compiler stays authoritative for the language, and Nordshrift stays authoritative for .sst.

What already existed (why we are not starting from scratch)

The gaps this package closes

#Gap in the pre-existing librariesNew class
1No real code editor (SLTextArea is a stub: no caret/selection/dirty/undo)SLIdeEditor
2No multi-document / tab model; SLGuiWindow is single-text; listener caps at 1..14SLIdeTabGroup
3No project / file explorer composition bound to a tree widgetSLIdeProjectTree
4No command registry mapping Save/Compile/Run/Open to servicesSLIdeCommandRegistry
5No diagnostics-in-editor surface for compiler outputSLIdeDiagnosticsPanel
6No top-level composition owning window + panels + the edit→compile→save loopSLIdeWorkbench

The 1..14 document limit

lib/gui's SLGuiDocumentListener enforces a hard 1..14 watched-document contract. An IDE routinely has more files open than that. The workbench does not break that contract — instead SLIdeTabGroup owns an unbounded set of open editors and only ever registers the active + recently-focused editors (≤14) with the OS watch, re-subscribing as focus changes. The 1..14 bound remains the OS-watch contract; the IDE's open-file count is separate.

The core edit → compile → save loop

SLIdeEditor.setText(...)        -> buffer dirty
SLIdeCommandRegistry "compile"  -> NordshriftCompilerBridge.prepare()/compileToSleela()
                                   (.sst) OR SLCompiler directly (.sleela)
compiler diagnostics            -> SLIdeDiagnosticsPanel.publish(...)
SLIdeCommandRegistry "save"     -> SLDocument / SLDocumentConverter persist
SLGuiDocumentListener           -> external change -> active editor refresh

The GUI is written in SLeeLa (SleelaUI)

The IDE's user interface is authored entirely in SLeeLa on top of SleelaUI™ (/lib/user-interface), SLeeLa's own cross-platform toolkit whose ui*/draw* built-ins drive real native windows (X11/Cocoa/Win32). Nothing in the GUI is deferred to a foreign toolkit.

LayerClassRole
GUI shellSLIdeWorkbenchUIBuilt on the lib/gui support structure (SLGuiApp/SLGuiDom): the header + Open/Compile/Save/Close commands are DOM button nodes with onClick handlers bound through the event bus, so clicks flow widget → SLGuiHostAdapter → SLGuiEvent → handler → command. The rich controls (tree, editor notebook, status/loading) mount into the DOM's container handles. SLGuiApp runs the loop (pump → poll activations → reconcile).
state modelSLIdeEditor, SLIdeTabGroup, SLIdeDiagnosticsPanel, SLIdeProjectTreeThe IDE's logic/state (dirty tracking, the 1..14 watch cap, the diagnostics failure rule, language routing).
service contractSLIdeWorkbenchThe headless openFile -> compileActive -> saveActive loop and the Nordshrift/compiler handoff (toolkit-independent).

The IDE shell is the first full consumer of the lib/gui dynamic stack: its chrome is an SLGuiApp DOM, its commands are onClick handlers dispatched through SLGuiEventBus, and the SLGuiMount reconciler + SLGuiHostAdapter project the DOM onto widgets and feed real activations back — no ad-hoc .clicked() polling.

The content controls are DOM-driven too. The tree and notebook have proxy DOM nodes (ide-tree, ide-notebook); a tree row selection raises a CHANGE("ide-tree", <nodeId>) event and a tab switch raises a TOGGLE("ide-notebook", <index>) event onto the same bus, handled by onTreeActivate / onTabChange. So every interaction in the shell — commands and content — travels one dispatch path.

The GUI shell is built from these competent SleelaUI widgets, all written in SLeeLa over the toolkit primitives (no new C ABI):

Run it: impl/build/sleela run lib/ide-workbench/ide-workbench-gui-demo.sleela (exits cleanly on a headless host with no display, like SLGalleryDemo).

Scaffolding status

The GUI shell and widgets are complete SLeeLa source. The remaining host work is the toolchain glue the service layer calls out to (Nordshrift + sleela check, and the real OS WatchService), which the /ide IntelliJ layer and the gui/ native host provide; the SLeeLa side no longer defers any widget work to a foreign toolkit.

Build / verify

Every lib/ide-workbench/*.sleela is intended to pass impl/build/sleela check at library parity, exactly like lib/gui. The runnable walkthrough is ide-workbench-demo.sleela.

SLeeLa — MEARVK LLC — 2026