Elements
Sky: UI Component Layer
Sky is the UI component layer of Land - the Astro-based interface that renders the editor, side bar, activity bar, status bar, and panels inside the Tauri WebView, loading the VS Code workbench from Output.
Sky: UI Component Layer 🌌
Sky is the UI component layer of Land.
Skyis built with theAstroframework.- It renders the editor interface - editor, side bar, activity bar, status bar, and panels - inside the
TauriWebView. - It loads the VS Code workbench from
@codeeditorland/output. - It communicates via
SkyBridgefor event routing.
Table of Contents
- Overview
- Architecture
- Page Structure
- Workbench Variants
- SkyBridge
- Build-time Variant Selection
- Static Asset Layout
- Related Documentation
graph TB
subgraph Sky["Sky UI Component Layer"]
PAGES["pages/<br/>index.astro<br/>Mountain.astro<br/>Browser.astro<br/>Electron.astro"]
WB["Workbench Variants<br/>Mountain / Browser<br/>Electron / Default"]
BRIDGE["SkyBridge<br/>event routing<br/>Tauri <-> Workbench"]
BUILD["Build-time Selection<br/>TierWorkbench env var"]
PAGES --> BUILD
BUILD --> WB
WB --> BRIDGE
end
OUTPUT["@codeeditorland/output"] --> WB
MOUNTAIN["Mountain<br/>Tauri events"] -->|"IPC events"| BRIDGE
BRIDGE -->|"channel dispatch"| WORKBENCH["VS Code Workbench"]Overview 📋
Sky is the rendering layer that presents the Land editor to the user.
- It uses
Astrofor page composition. - It loads the VS Code workbench from
@codeeditorland/output. - It bridges
Taurievents to the workbench throughSkyBridge.
| Attribute | Value |
|---|---|
| Language | TypeScript (Astro v6, Vite v8) |
| Framework | Astro + Vite |
| IPC | Tauri events (via SkyBridge) |
| Dependencies | @codeeditorland/wind, @codeeditorland/output, @codeeditorland/cocoon, @codeeditorland/worker, @xterm/xterm, astro, vite, zod |
| Consumes | Wind (services), Output (bundles), Worker (service worker) |
Architecture 🏗️
+------------------------------------------------------------------+
| Sky |
| |
| +------------------+ +------------------+ +------------------+ |
| | pages/ | | Workbench/ | | Function/ | |
| | - index.astro | | - Mountain.astro | | - SkyBridge.ts | |
| | - entry points | | - Browser.astro | | - Debug.ts | |
| | | | - Electron.astro | | - Shared.ts | |
| +------------------+ +------------------+ +------------------+ |
| |
| +------------------+ +------------------+ |
| | Bundled/ | | astro.config.ts | |
| | Pre-compiled | | Vite/Rollup | |
| | workbench chunks | | compilation cfg | |
| +------------------+ +------------------+ |
+------------------------------------------------------------------+Module Map 🗺️
| Path | Purpose |
|---|---|
Source/pages/index.astro | Main entry page |
Source/pages/Mountain.astro | Mountain workbench variant |
Source/pages/Browser.astro | Browser workbench variant |
Source/pages/Electron.astro | Electron workbench variant |
Source/pages/Isolation.astro | Isolation mode variant |
Source/Workbench/Mountain.astro | Mountain workbench component |
Source/Workbench/Browser.astro | Browser workbench component |
Source/Workbench/Electron/ | Electron workbench component |
Source/Workbench/Bundled/ | Pre-compiled workbench chunks |
Source/Function/SkyBridge.ts | Tauri event routing bridge |
Source/Function/Debug.ts | Debug utilities |
Source/Function/Shared.ts | Shared UI utilities |
Source/Function/Build/ | Build-time compilation helpers |
Page Structure 📄
Sky provides multiple page entry points, each selecting a different workbench variant.
index.astro
The default entry point. It selects the active workbench at build time based on environment variables:
---
// Pseudo-code from Sky's build-time conditional import
const WorkbenchComponent =
TierWorkbench === "Mountain"
? MountainWorkbench
: TierWorkbench === "Electron"
? ElectronWorkbench
: TierWorkbench === "Browser"
? BrowserWorkbench
: DefaultWorkbench;
---
<WorkbenchComponent />Pages Overview
| Page | Workbench | Purpose |
|---|---|---|
index.astro | Dynamic | Default entry point, delegates to workbench selector |
Mountain.astro | Mountain | Production workbench for Tauri runtime |
Browser.astro | Browser | Development workbench with limited native features |
Electron.astro | Electron | Maximum VS Code compatibility variant |
BrowserProxy.astro | Browser | Proxy-mode workbench |
Isolation.astro | Isolation | Minimal workbench for testing |
Workbench Variants 🖥️
Sky supports multiple workbench variants compiled through Vite/Rollup:
| Variant | Astro Page | Feature Coverage | Build Profile |
|---|---|---|---|
| Mountain | Mountain.astro | 80-90% | debug-mountain |
| Browser | Browser.astro | 70-80% | debug |
| Electron | Electron.astro | 95%+ | debug-electron |
| Default | Default.astro | Base workbench | debug-workbench-bundled |
| BrowserProxy | BrowserProxy.astro | 70-80% | debug-browser |
| NLS | NLS.astro | Natural language search | (experimental) |
Variant Selection
The active variant is selected at build time and compiled by Vite. Unused variants are tree-shaken and do not enter the production module graph:
// astro.config.ts maps TierWorkbench to import path
const workbenchPath =
{
mountain: "./Workbench/Mountain.astro",
browser: "./Workbench/Browser.astro",
electron: "./Workbench/Electron.astro",
}[TierWorkbench] || "./Workbench/Default.astro";SkyBridge 🌉
SkyBridge (Source/Function/SkyBridge.ts, ~2900 lines) is the runtime event routing bridge between Tauri’s IPC system and the VS Code workbench’s internal message channel system.
Event Translation Table
| Tauri Event | VS Code Workbench Channel | Direction |
|---|---|---|
mountain:configurationChanged | onDidChangeConfiguration | Mountain -> Workbench |
mountain:extensionsChanged | onDidChangeExtensions | Mountain -> Workbench |
mountain:themeChanged | onDidChangeColorTheme | Mountain -> Workbench |
mountain:fileChanged | FileSystem watcher events | Mountain -> Workbench |
cocoon:commandExecuted | Extension command result | Cocoon -> Workbench |
Bridge Architecture
Mountain emits Tauri event
|
v
Tauri WebView event listener
|
v
SkyBridge intercepts event
|
+---> Translates to VS Code internal channel format
+---> Dispatches to registered workbench handlers
+---> Handles async responses if required
|
v
VS Code workbench service receives notificationWebview Panel Management
SkyBridge manages webview content injection through first-set-html logging:
Extension calls vscode.window.createWebviewPanel()
|
v
Cocoon sends gRPC createWebviewPanel request
|
v
Mountain creates Wry webview
|
v
SkyBridge sets HTML content:
applied=method -> Content reached real WebviewInput
applied=setter -> Content stored, view not yet parked
applied=skipped -> No parked view available (silent drop)Build-time Variant Selection 🔧
Sky uses Vite’s conditional dynamic imports to select the active workbench at build time:
// vite.config.ts / astro.config.ts
// The TierWorkbench env var determines which variant is compiled
const activeWorkbench = process.env.TierWorkbench || "Mountain";Bundle Output
Each variant produces its own bundle:
Sky/Target/Static/
+-- Bundled/
+-- Mountain/ # When TierWorkbench=Mountain
| +-- workbench.js
| +-- workbench.css
+-- Electron/ # When TierWorkbench=Electron
| +-- workbench.js
| +-- workbench.css
+-- Browser/ # When TierWorkbench=Browser
+-- workbench.js
+-- workbench.css
+-- Application/ # Static assets (non-bundled mode)Static Asset Layout 📁
After a successful build, Sky’s output is organized as:
Sky/Target/
+-- Static/
+-- Bundled/
| +-- {Variant}/
| +-- workbench.js # Compiled workbench bundle
| +-- workbench.css # Compiled workbench styles
| +-- chunks/ # Lazy-loaded code chunks
+-- Application/ # Dev mode static assets
+-- index.html # Compiled entry page
+-- assets/ # CSS, JS, fonts
+-- worker.js # Service worker scriptRelated Documentation 📚
- Wind - Service layer (
Skyconsumes) - Cocoon - Extension host (
SkyBridgetarget) - Worker - Service worker (
Skyintegrates) - Output - Compiled workbench source
- Mountain - Backend (IPC source)
- Polyfills -
SkyBridgeand preload shim details - BuildPipeline - Build pipeline for workbench variants
Project Maintainers: Source Open (Source/[email protected]) | GitHub Repository | Report an Issue
See Also
- 🟠 Low-Level Shim - Engine-level prototype hooks
- 🔵 Coverage / Telemetry - Application-level service routing