# jiuyang5354/snapline-windows architecture

> Architecture diagram of the GitHub repository jiuyang5354/snapline-windows, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jiuyang5354/snapline-windows
- Repository: https://github.com/jiuyang5354/snapline-windows

## Overview

Snapline is a Windows screenshot-capture shelf. Its main workflow collects clipboard images or new files from watched folders, stores and displays recent shots, then lets users copy, preview, edit, remove, or drag them into other apps. The controller coordinates capture, tray and shelf interactions, settings, startup registration, and update checks; separate modules handle persistence, UI, and update downloads. The README documents major behavior not fully visible in the excerpts; arrows are limited to relationships supported by excerpts or that documentation.

Main entry points: [`windows/src/Controller.cs`](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/Controller.cs) (Controller), [`windows/src/ShotCard.cs`](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/ShotCard.cs) (Screenshot card), [`windows/src/CaptureWatch.cs`](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/CaptureWatch.cs) (Folder watcher), [`windows/src/ImageStore.cs`](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/ImageStore.cs) (Image and settings store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App coordination"]
  node_program["Application entry<br/>[Program.cs]"]
  node_controller["Controller<br/>[Controller.cs]"]
  node_native["Windows interop<br/>[Native.cs]"]
end

subgraph group_capture["Capture and storage"]
  node_capturewatch["Folder watcher<br/>[CaptureWatch.cs]"]
  node_store[("Image and settings store<br/>[ImageStore.cs]")]
end

subgraph group_shelf["Shelf interaction"]
  node_line["Screenshot shelf<br/>[LineWindow.cs]"]
  node_card["Screenshot card<br/>[ShotCard.cs]"]
end

subgraph group_preferences["Settings and startup"]
  node_settings["Settings window<br/>[SettingsWindow.cs]"]
  node_startup["Windows startup<br/>[Startup.cs]"]
end

subgraph group_updates["Update service"]
  node_updates["Update checker<br/>[Updates.cs]"]
  node_updatedialog["Update dialog<br/>[UpdateDialog.cs]"]
end

node_user(("User"))
node_clipboard["Windows clipboard"]
node_folder["Watched image folders"]
node_otherapps["Other applications"]
node_github["GitHub releases"]

node_user -->|"launches"| node_program
node_program -->|"creates"| node_controller
node_controller -->|"coordinates"| node_store
node_controller -->|"starts capture"| node_capturewatch
node_capturewatch -->|"adds files"| node_store
node_folder -->|"provides file events"| node_capturewatch
node_clipboard -->|"provides images"| node_controller
node_controller -->|"uses Win32"| node_native
node_store -->|"uses defaults"| node_native
node_controller -->|"controls shelf"| node_line
node_line -->|"renders cards"| node_card
node_card -->|"invokes actions"| node_controller
node_user -->|"interacts"| node_line
node_card -->|"drags images"| node_otherapps
node_controller -->|"opens settings"| node_settings
node_settings -->|"saves preferences"| node_controller
node_controller -->|"checks startup"| node_startup
node_controller -->|"checks releases"| node_updates
node_controller -->|"shows update"| node_updatedialog
node_updatedialog -->|"downloads package"| node_updates
node_updates -->|"requests release data"| node_github
node_user -->|"changes options"| node_settings

click node_program "https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/Program.cs"
click node_controller "https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/Controller.cs"
click node_native "https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/Native.cs"
click node_capturewatch "https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/CaptureWatch.cs"
click node_store "https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/ImageStore.cs"
click node_line "https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/LineWindow.cs"
click node_card "https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/ShotCard.cs"
click node_settings "https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/SettingsWindow.cs"
click node_startup "https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/Startup.cs"
click node_updates "https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/Updates.cs"
click node_updatedialog "https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/UpdateDialog.cs"

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_program,node_controller,node_native,node_user toneBlue
class node_capturewatch,node_store toneAmber
class node_line,node_card toneMint
class node_settings,node_startup toneRose
class node_updates,node_updatedialog,node_clipboard,node_folder,node_otherapps,node_github toneIndigo
```

## Components

### App coordination

- [Application entry](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/Program.cs): `windows/src/Program.cs`
- [Controller](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/Controller.cs): `windows/src/Controller.cs`
- [Windows interop](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/Native.cs): `windows/src/Native.cs`

### Capture and storage

- [Folder watcher](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/CaptureWatch.cs): `windows/src/CaptureWatch.cs`
- [Image and settings store](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/ImageStore.cs): `windows/src/ImageStore.cs`

### Shelf interaction

- [Screenshot shelf](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/LineWindow.cs): `windows/src/LineWindow.cs`
- [Screenshot card](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/ShotCard.cs): `windows/src/ShotCard.cs`

### Settings and startup

- [Settings window](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/SettingsWindow.cs): `windows/src/SettingsWindow.cs`
- [Windows startup](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/Startup.cs): `windows/src/Startup.cs`

### Update service

- [Update checker](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/Updates.cs): `windows/src/Updates.cs`
- [Update dialog](https://github.com/jiuyang5354/snapline-windows/blob/main/windows/src/UpdateDialog.cs): `windows/src/UpdateDialog.cs`

### Other components

- **User**
- **Windows clipboard**
- **Watched image folders**
- **Other applications**
- **GitHub releases**

## Connections

- User → Application entry: launches (evidence: `README.md`)
- Application entry → Controller: creates (evidence: `windows/src/Program.cs`)
- Controller → Image and settings store: coordinates (evidence: `windows/src/Controller.cs`)
- Controller → Folder watcher: starts capture (evidence: `windows/src/Controller.cs`)
- Folder watcher → Image and settings store: adds files (evidence: `windows/src/CaptureWatch.cs`)
- Watched image folders → Folder watcher: provides file events (evidence: `windows/src/CaptureWatch.cs`)
- Windows clipboard → Controller: provides images (evidence: `README.md`)
- Controller → Windows interop: uses Win32 (evidence: `windows/src/Controller.cs`)
- Image and settings store → Windows interop: uses defaults (evidence: `windows/src/ImageStore.cs`)
- Controller → Screenshot shelf: controls shelf (evidence: `windows/src/Controller.cs`)
- Screenshot shelf → Screenshot card: renders cards (evidence: `windows/src/LineWindow.cs`)
- Screenshot card → Controller: invokes actions (evidence: `windows/src/ShotCard.cs`)
- User → Screenshot shelf: interacts (evidence: `README.md`)
- Screenshot card → Other applications: drags images (evidence: `README.md`)
- Controller → Settings window: opens settings (evidence: `windows/src/Controller.cs`)
- Settings window → Controller: saves preferences (evidence: `windows/src/SettingsWindow.cs`)
- Controller → Windows startup: checks startup (evidence: `windows/src/Controller.cs`)
- Controller → Update checker: checks releases (evidence: `windows/src/Controller.cs`)
- Controller → Update dialog: shows update (evidence: `windows/src/Controller.cs`)
- Update dialog → Update checker: downloads package (evidence: `windows/src/UpdateDialog.cs`)
- Update checker → GitHub releases: requests release data (evidence: `README.md`)
- User → Settings window: changes options (evidence: `README.md`)
