# favo02/workspaces-by-open-apps architecture

> Architecture diagram of the GitHub repository favo02/workspaces-by-open-apps, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/favo02/workspaces-by-open-apps
- Repository: https://github.com/favo02/workspaces-by-open-apps

## Overview

##### Component Interactions

- GNOME Shell → Extension Manager: Extension lifecycle events (enable/disable)
- Extension Manager → Workspace Handler: Workspace state management
- Extension Manager ↔ GSettings: Configuration storage/retrieval
- Application Handler ↔ GNOME Shell: Window tracking and app state

##### Data Flow Highlights

Specific data flows for:
- Window state changes
- Workspace switching events
- Configuration updates
- User interaction events

##### Technical Details

- GSchema integration points
- CSS styling connection (stylesheet.css)
- Metadata handling (metadata.json)
- Extension preferences interface

Important considerations:
- Event-driven nature of the extension
- Clear boundaries between extension code and GNOME Shell
- Configuration persistence flow
- User interaction paths

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Define styles
    classDef core fill:#e1f5fe,stroke:#0288d1
    classDef system fill:#c8e6c9,stroke:#388e3c
    classDef config fill:#ffe0b2,stroke:#f57c00
    classDef external fill:#f5f5f5,stroke:#9e9e9e
    classDef ui fill:#e1bee7,stroke:#7b1fa2

    %% System Integration Layer
    subgraph SystemLayer
        GS[GNOME Shell]:::external
        DS[Display Server]:::external
        WM[Window Manager]:::external
    end

    %% Core Extension Components
    subgraph CoreExtension
        EM[Extension Manager]:::core
        WH[Workspace Handler]:::core
        AH[Application Handler]:::core
    end

    %% Configuration Layer
    subgraph ConfigLayer
        GSchema[GSettings Schema]:::config
        Prefs[Preferences UI]:::config
        Const[Constants]:::config
        Style[Stylesheet]:::config
        Meta[Metadata]:::config
    end

    %% Interactions
    GS --> EM
    EM --> WH
    WH --> AH
    EM <--> GSchema
    AH <--> GS
    WM --> WH
    DS --> AH
    Prefs --> GSchema
    Const --> EM
    Const --> WH
    Const --> AH
    Style --> EM

    %% Features and Events
    Events[("User Events<br/>- Click Handlers<br/>- Drag & Drop<br/>- Scrolling")]:::ui
    Monitor[("Multi-Monitor<br/>Support")]:::system
    WSEvents[("Workspace<br/>Events")]:::system

    Events --> EM
    Monitor --> WH
    WSEvents --> WH

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[System Integration]:::system
        L3[Configuration]:::config
        L4[External Systems]:::external
        L5[UI Elements]:::ui
    end

    %% Click Events
    click EM "https://github.com/favo02/workspaces-by-open-apps/blob/main/src/extension.js"
    click WH "https://github.com/favo02/workspaces-by-open-apps/blob/main/src/workspace.js"
    click AH "https://github.com/favo02/workspaces-by-open-apps/blob/main/src/application.js"
    click GSchema "https://github.com/favo02/workspaces-by-open-apps/blob/main/src/schemas/org.gnome.shell.extensions.workspaces-indicator-by-open-apps.gschema.xml"
    click Prefs "https://github.com/favo02/workspaces-by-open-apps/blob/main/src/prefs.js"
    click Const "https://github.com/favo02/workspaces-by-open-apps/blob/main/src/constants.js"
    click Style "https://github.com/favo02/workspaces-by-open-apps/blob/main/src/stylesheet.css"
    click Meta "https://github.com/favo02/workspaces-by-open-apps/blob/main/src/metadata.json"
```
