# kurapikanlight/smart-arrow-tiling architecture

> Architecture diagram of the GitHub repository kurapikanlight/smart-arrow-tiling, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kurapikanlight/smart-arrow-tiling
- Repository: https://github.com/kurapikanlight/smart-arrow-tiling

## Overview

Smart Arrow Tiling is a GNOME Shell extension for keyboard-driven and drag-and-drop window tiling. Its main workflow routes keyboard commands or drag drops through the extension controller, updates per-monitor/workspace slot state, computes geometry, and applies it to windows; resizing and window removal update that state too. The snap overlay previews layouts using the shared layout engine. README-described settings and shortcut restoration are represented at the controller boundary. Evidence is limited to the README and sampled excerpts, so unsampled internal calls are omitted.

Main entry points: [`extension.js`](https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/extension.js) (Extension controller), [`snapOverlay.js`](https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/snapOverlay.js) (Snap overlay), [`layout.js`](https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/layout.js) (Slot transitions), [`schemas/org.gnome.shell.extensions.smart-arrow-tiling.gschema.xml`](https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/schemas/org.gnome.shell.extensions.smart-arrow-tiling.gschema.xml) (Extension settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_keyboard["Keyboard commands<br/>[extension.js]"]
  node_drag["Drag and resize<br/>[extension.js]"]
  node_overlay["Snap overlay<br/>[snapOverlay.js]"]
end

subgraph group_tiling["Layout and tiling"]
  node_layout["Slot transitions<br/>[layout.js]"]
  node_geometry["Tile geometry<br/>[layout.js]"]
end

subgraph group_extension["GNOME integration"]
  node_controller["Extension controller<br/>[extension.js]"]
  node_windowstate["Tracked window state<br/>[extension.js]"]
  node_gnome["GNOME Shell"]
  node_settings["Extension settings"]
end

node_user(("User"))

node_user -->|"presses shortcuts"| node_keyboard
node_user -->|"drags or resizes"| node_drag
node_keyboard -->|"dispatches commands"| node_controller
node_drag -->|"handles grabs"| node_controller
node_controller -->|"transitions slots"| node_layout
node_controller -.->|"computes window bounds"| node_geometry
node_controller -->|"tracks windows"| node_windowstate
node_controller -->|"updates and destroys"| node_overlay
node_overlay -->|"evaluates preview layouts"| node_layout
node_overlay -->|"computes previews"| node_geometry
node_controller -->|"registers bindings and moves windows"| node_gnome
node_controller -.->|"reads settings"| node_settings
node_user -->|"chooses drop zone"| node_overlay

click node_keyboard "https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/extension.js"
click node_drag "https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/extension.js"
click node_overlay "https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/snapOverlay.js"
click node_controller "https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/extension.js"
click node_layout "https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/layout.js"
click node_geometry "https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/layout.js"
click node_windowstate "https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/extension.js"
click node_settings "https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/schemas/org.gnome.shell.extensions.smart-arrow-tiling.gschema.xml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_keyboard,node_drag,node_overlay,node_user toneBlue
class node_layout,node_geometry toneAmber
class node_controller,node_windowstate,node_gnome,node_settings toneMint
```

## Components

### User interaction

- [Keyboard commands](https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/extension.js): `extension.js`
- [Drag and resize](https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/extension.js): `extension.js`
- [Snap overlay](https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/snapOverlay.js): `snapOverlay.js`

### Layout and tiling

- [Slot transitions](https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/layout.js): `layout.js`
- [Tile geometry](https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/layout.js): `layout.js`

### GNOME integration

- [Extension controller](https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/extension.js): `extension.js`
- [Tracked window state](https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/extension.js): `extension.js`
- **GNOME Shell**
- [Extension settings](https://github.com/kurapikanlight/smart-arrow-tiling/blob/main/schemas/org.gnome.shell.extensions.smart-arrow-tiling.gschema.xml): `schemas/org.gnome.shell.extensions.smart-arrow-tiling.gschema.xml`

### Other components

- **User**

## Connections

- User → Keyboard commands: presses shortcuts (evidence: `README.md`)
- User → Drag and resize: drags or resizes (evidence: `README.md`)
- Keyboard commands → Extension controller: dispatches commands (evidence: `extension.js`)
- Drag and resize → Extension controller: handles grabs (evidence: `extension.js`)
- Extension controller → Slot transitions: transitions slots (evidence: `layout.js`)
- Extension controller → Tile geometry: computes window bounds (evidence: `extension.js`)
- Extension controller → Tracked window state: tracks windows (evidence: `extension.js`)
- Extension controller → Snap overlay: updates and destroys (evidence: `extension.js`)
- Snap overlay → Slot transitions: evaluates preview layouts (evidence: `snapOverlay.js`)
- Snap overlay → Tile geometry: computes previews (evidence: `snapOverlay.js`)
- Extension controller → GNOME Shell: registers bindings and moves windows (evidence: `extension.js`)
- Extension controller → Extension settings: reads settings
- User → Snap overlay: chooses drop zone (evidence: `README.md`)
