Workspace Layout & Panels
Relevant source files
The following files were used as context for generating this wiki page:
The workspace layout and panels system in Graphite constitutes the primary user interface framework for the editor. This system is responsible for organizing the visual environment where users interact with vector and raster tools, manage document layers, and manipulate node properties. Built using Svelte, the frontend acts as a lightweight presentation layer that displays interactive widgets and layouts based on state provided by the Rust-based editor backend.
The architecture follows a recursive structure where the main window contains a workspace, which in turn houses various panels such as the Layers panel, Properties panel, and the Viewport. This modular approach allows for a flexible GUI that can adapt to different creative workflows, including graphic design, motion graphics, and image editing.
Sources: frontend/src/README.md, website/content/volunteer/guide/codebase-overview/_index.md, website/content/learn/_outline_draft.md:4-16
UI Architecture and Component Hierarchy
The Graphite frontend is organized as a tree of Svelte components. The entry point, App.svelte, initializes the communication with the WebAssembly backend and renders Editor.svelte, which serves as the container for global styles and state stores.
Component Structure
The workspace is constructed through a hierarchy of specific layout components located in frontend/src/components/window/.
| Component | Responsibility |
|---|---|
| MainWindow | The top-level container for the entire editor application interface. |
| Workspace | Manages the layout area where panels are arranged and documents are edited. |
| Panel | Individual UI sections (e.g., Layers, Properties, Viewport) that contain specific tools or information. |
Sources: frontend/src/README.md, frontend/src/components/window/MainWindow.svelte, frontend/src/components/window/Workspace.svelte, frontend/src/components/window/Panel.svelte
Data Flow for Layout Updates
Communication between the UI layout and the backend uses a message-based system. The frontend sends user input to the backend via a Wasm wrapper API, and the backend responds by queuing FrontendMessage objects.
This diagram illustrates the cycle of a UI update. When a user interacts with a panel, the message travels to the Rust backend, which then sends back instructions to update the frontend state.
Sources: website/content/volunteer/guide/codebase-overview/_index.md, frontend/src/README.md
Core Workspace Panels
The workspace is divided into several specialized panels, each serving a distinct role in the document editing process.
Layers Panel
The Layers panel provides a hierarchical view of the document. It manages the stacking order of graphical data, allowing users to organize content into folders and adjust visibility.
- Functionality: Toggling visibility (eye icon), adding/deleting folders, and managing blend modes or opacity.
- Nomenclature: A "Group" is formed in this panel when a layer stack is fed into a parent stack via a connector.
Properties Panel
The Properties panel displays the parameters of the currently selected node or layer.
- Parameters: Includes value inputs and the "Expose" button, which allows a parameter to be linked to the node graph for procedural animation.
- Context: Displays visibility and deletion buttons for node sections.
Viewport and Graph
The Viewport is the primary area for visual editing on an infinite canvas. Users can switch between the standard Viewport and an overlaid Node Graph view.
- Viewport Navigation: Supports panning, tilting, and zooming.
- Node Graph: Shows the underlying structure of nodes and layers as a flowchart with input/output connectors.
Sources: website/content/learn/_outline_draft.md:4-29, website/content/blog/2024-07-31-graphite-progress-report-q2-2024.md:120-135
State Management and Lifecycle
Layout state is managed through Svelte stores located in frontend/src/stores/. These stores provide reactive data to components and survive Hot Module Replacement (HMR) during development.
Workspace Lifecycle
The initialization of the workspace and its components follows a specific sequence managed by Editor.svelte:
- Store Creation: Stores are created synchronously during initialization to allow child components
getContextaccess. - Manager Initialization: Managers (e.g., for input handling) are created in
onMount. - Cleanup:
destroy*()functions are called on unmount to prevent memory leaks and handle HMR updates.
This sequence ensures that UI components always have access to the necessary state and communication channels before they are rendered.
Sources: frontend/src/README.md, frontend/src/Editor.svelte
Upcoming Layout Features
The roadmap for the workspace includes significant enhancements to the panel system to support more complex workflows like animation and professional desktop publishing.
| Feature | Description | Status |
|---|---|---|
| Dockable Panels | Support for multi-window and dockable panel layouts. | Beta 2 |
| Timeline Panel | A dopesheet and curves interface for keyframe animation. | Early 2026 |
| Data Panel | For graphical introspection of document data. | Alpha 4 |
| Outliner Panel | A tree-view representation of the node graph. | Future |
Sources: website/content/features.md:100-250, website/content/blog/2024-07-31-graphite-progress-report-q2-2024.md:215-225
The "Workspace Layout & Panels" system serves as the bridge between the high-performance Rust node engine and the user. By utilizing a modular Svelte component architecture and a robust message-passing system with the WebAssembly backend, Graphite maintains a responsive and flexible interface suitable for both simple layer-based editing and complex procedural design.