The UI Component Layer for Land ποΈ
Welcome to Sky, the declarative UI component layer of the Land Code
Editor. Built with the Astro framework, Sky renders the user interface
including the editor, side bar, activity bar, status bar, and panels. It
operates within the Tauri webview alongside Wind, consuming state and
services from the Wind service layer to display and manage the editor's visual
presentation.
Sky is engineered to:
- Render UI Components: Provide a comprehensive set of Astro-based components that compose the Land editor interface.
- Support Multiple Workbench Variants: Offer distinct workbench approaches (Browser, Mountain, Electron) for different deployment scenarios.
- Integrate with Wind Services: Consume
Wind's Effect-TS powered services for state management and backend communication. - Enable Page Routing: Manage application navigation and page transitions within the Tauri webview.
- Astro-Based Component Architecture: Leverages Astro's component islands architecture for efficient, content-driven UI development with zero JavaScript by default and selective hydration for interactive components.
- VSCode UI Compatibility: Provides multiple workbench approaches that load
and integrate VSCode's core UI components from
@codeeditorland/output, ensuring high-fidelity editor experience. - Wind Service Layer Integration: Seamlessly consumes
Wind's Effect-TS services for file operations, dialogs, configuration, and state management, enabling a clean separation between UI and business logic. - Tauri Webview Integration: Runs within the Tauri webview, communicating
with the
Mountainbackend through Tauri's IPC mechanism and event system for native OS capabilities. - Flexible Workbench Variants: Supports multiple workbench approaches
through environment-based selection:
- A1 (Browser/BrowserProxy): Browser-based workbench with optional service proxy
- A2 (Mountain - RECOMMENDED): Browser workbench with Mountain-backed providers
- A3 (Electron): Electron workbench with polyfills for VSCode
- Component Modularity: Organized into Pages (routes), Workbenches (components), and Workbench Implementations (BrowserProxy/, Electron/ subdirectories) for clear separation of concerns and maintainability.
| Principle | Description | Key Components Involved |
|---|---|---|
| Compatibility | Provide high-fidelity VSCode UI rendering to maximize compatibility with VSCode extensions and workflows. | Workbench/*, Workbench/BrowserProxy/*, Workbench/Electron/*, @codeeditorland/output |
| Modularity | Components (pages, workbenches, layouts) are organized into distinct, cohesive modules for clarity and maintainability. | pages/*, Workbench/*, Workbench/BrowserProxy/*, Workbench/Electron/*, Function/* |
| Performance | Leverage Astro's static generation and selective hydration to minimize JavaScript payload and maximize rendering performance. | Astro build system, Component Islands |
| Integration | Seamlessly connect with Wind services and Mountain backend through Tauri events and IPC for state updates and user actions. |
Install, Bootstrap, Tauri event listeners |
| Maintainability | Clear separation between UI components and business logic, with UI state driven by Wind services for predictable data flow. |
Service consumption pattern, Event-driven updates |
| Component | Role & Key Responsibilities |
|---|---|
| Astro Components | The declarative UI building blocks that compose the editor interface, from activity bar to status bar. |
| Tauri Webview | The runtime environment where Sky executes, providing access to Tauri APIs and OS integration. |
| Wind Integration | Consumes Wind's Effect-TS services for file operations, dialogs, configuration, and state management. |
| Workbench Variants | Multiple approaches (A1-A3) for loading and integrating VSCode's core editor components: Browser, Mountain (recommended), and Electron. |
| Page Routing | Manages navigation between index (default), Browser, BrowserProxy, Electron, Mountain, and Isolation pages. |
| Event Handling | Listens for Tauri events from Mountain to update UI state (terminal output, SCM updates, etc.). |
Here's a step-by-step example of how Sky renders the UI based on Wind's
state:
- Page Load: User navigates to
/, which loadsindex.astro. - Workbench Selection: The page reads environment variables to determine
which workbench to load:
Mountain=trueβ Loads the recommended A2: Mountain workbenchElectron=trueβ Loads A3: Electron workbenchBrowserProxy=trueβ Loads A1: Browser Proxy workbenchBrowser=trueβ Loads A1: Browser workbench- Default β Loads
Workbench/Default.astro
- Wind Bootstrap: The workbench imports and executes
@codeeditorland/windbootstrap, which installs thePreload.tsenvironment shim and initializes Effect-TS runtime and service layers. - Service Consumption:
Skycomponents subscribe toWindservices:StatusBarServiceβ Updates status bar itemsActivityBarServiceβ Manages activity bar stateFileSystemServiceβ Provides file tree data to sidebar
- Event Listening:
Skylistens for Tauri events fromMountain:sky://terminal/dataβ Renders terminal output in panelsky://scm/update-groupβ Updates source control viewsky://configuration/changedβ Re-renders affected UI components
- User Interaction: When user clicks "Open File":
Skycomponent callsWind'sDialogService.showOpenDialog()Windinvokes Tauri's native dialog via@tauri-apps/plugin-dialog- Selected file URI is returned through
WindtoSky Skyupdates the editor component to display the opened file
graph LR
classDef sky fill:#9cf,stroke:#333,stroke-width:2px;
classDef wind fill:#ffc,stroke:#333,stroke-width:2px;
classDef tauri fill:#f9d,stroke:#333,stroke-width:2px;
classDef mountain fill:#f9f,stroke:#333,stroke-width:2px;
classDef external fill:#ddd,stroke:#666,stroke-dasharray: 5 5;
subgraph "Sky π (UI Component Layer - Tauri Webview)"
Pages["Pages (index, Browser, Electron, Mountain, Isolation)"]:::sky
Workbenches["Workbench Components (Browser, Mountain, Default, NLS)"]:::sky
WorkbenchImpl["Workbench Implementations (BrowserProxy/, Electron/)"]:::sky
end
subgraph "Wind π (Service Layer - Tauri Webview)"
PreloadJS["Preload.js (Environment Shim)"]:::wind
WindServices[Wind Effect-TS Services]:::wind
TauriIntegrations[Wind/Tauri Integrations]:::wind
end
subgraph "Tauri Shell & Mountain π (Rust Backend)"
TauriWindow[Tauri Window API]:::tauri
TauriEvents[Tauri Event System]:::tauri
MountainCore[Mountain Rust Core]:::mountain
end
subgraph "External"
VSCodeComponents[VSCode Core UI Components from Output]:::external
end
Pages --> Workbenches
Pages --> WorkbenchImpl
Workbenches --> PreloadJS
WorkbenchImpl --> PreloadJS
Workbenches -- Consumes services from --> WindServices
WorkbenchImpl -- Consumes services from --> WindServices
WindServices -- Uses --> TauriIntegrations
TauriIntegrations -- Calls --> TauriWindow
TauriIntegrations -- Listens to --> TauriEvents
TauriWindow -- IPC --> MountainCore
TauriEvents -- Emits from --> MountainCore
Workbenches -- Loads --> VSCodeComponents
WorkbenchImpl -- Loads --> VSCodeComponents
Sky/
βββ Source/
β βββ pages/ # Page routes
β β βββ index.astro # Home page (default workbench entry)
β β βββ Browser.astro # A1: Browser workbench page
β β βββ BrowserProxy.astro # A1: Browserβ+βservices proxy page
β β βββ Electron.astro # A3: Electronβ+βpolyfills page
β β βββ Isolation.astro # Isolated mode page
β β βββ Mountain.astro # A2: Mountain providers page (RECOMMENDED)
β βββ Workbench/ # Workbench component implementations
β β βββ Default.astro # Deprecated entry point
β β βββ Browser.astro # Browser workbench component
β β βββ BrowserTest.astro # Test workbench component
β β βββ Mountain.astro # A2: Mountain workbench component (RECOMMENDED)
β β βββ NLS.astro # Natural Language Support component
β β βββ BrowserProxy/ # A1: Browser Proxy implementation
β β β βββ Bootstrap.ts
β β β βββ Layout.astro
β β β βββ ServicesProxy.ts
β β β βββ WindPreload.ts
β β β βββ Workbench.ts
β β βββ Electron/ # A3: Electron implementation
β β βββ Bootstrap.ts
β β βββ Layout.astro
β β βββ Polyfills.ts
β β βββ WindPreload.ts
β β βββ Workbench.ts
β βββ Function/ # Utility functions and base components
β β βββ Debug.ts
β β βββ Shared.ts
β β βββ Meta.astro
β β βββ Markup/
β β βββ Base.astro
β βββ env.d.ts # TypeScript definitions
βββ Public/ # Static assets served directly
βββ Target/ # Build output directory
βββ .env.example # Environment variables template
βββ astro.config.ts # Astro configuration
βββ package.json
βββ tsconfig.json
pnpm add @codeeditorland/skyKey Dependencies:
astro:5.17.3@codeeditorland/wind:0.0.1(service layer)@codeeditorland/common:0.0.6(Rust core bindings)@codeeditorland/output:0.0.1(VSCode output bundle)@codeeditorland/worker:0.0.1(Web worker implementations)
Select the workbench at runtime via environment variables:
# Use Mountain workbench (A2 - RECOMMENDED)
Mountain=true pnpm run Run
# Use Electron workbench (A3)
Electron=true pnpm run Run
# Use Browser Proxy workbench (A1)
BrowserProxy=true pnpm run RunOr import workbench components directly:
---
import MountainWorkbench from "../Workbench/Mountain.astro";
---
<html>
<body>
<MountainWorkbench />
</body>
</html>This project is released into the public domain under the Creative Commons CC0
Universal license. You are free to use, modify, distribute, and build upon
this work for any purpose, without any restrictions. For the full legal text,
see the LICENSE
file.
Stay updated with our progress! See CHANGELOG.md for a
history of changes specific to Sky.
Sky is a core element of the Land ecosystem. This project is funded through NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.
The project is operated by PlayForm, based in Sofia, Bulgaria.
PlayForm acts as the open-source steward for Code Editor Land under the NGI0 Commons Fund grant.
| Land | PlayForm | NLnet | NGI0 Commons Fund |
|---|---|---|---|
|
|
|
|
|
Project Maintainers: Source Open (Source/Open@Editor.Land) | GitHub Repository | Report an Issue | Security Policy