# shark-empire/mitos-file-manager architecture

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

- Interactive diagram: https://gitdiagram.com/shark-empire/mitos-file-manager
- Repository: https://github.com/shark-empire/mitos-file-manager

## Overview

MITOS Files is a GTK desktop file manager. The primary workflow is browsing a location, inspecting file listings and previews, then performing file operations; users can also search, navigate saved/recent/network locations, manage Trash, and configure the app. The tree documents these capabilities, but the README contains only the product name and most runtime source was not sampled, so links between UI components and domain modules are deliberately sparse. The sampled code supports preview-to-archive/thumbnail use and the D-Bus service flows shown below; other nodes indicate product subsystems without asserting unverified wiring.

Main entry points: [`src/main.rs`](https://github.com/shark-empire/mitos-file-manager/blob/main/src/main.rs) (Application runtime), [`src/ui/preview.rs`](https://github.com/shark-empire/mitos-file-manager/blob/main/src/ui/preview.rs) (Item preview), [`src/search/engine.rs`](https://github.com/shark-empire/mitos-file-manager/blob/main/src/search/engine.rs) (Search), [`src/operations/mod.rs`](https://github.com/shark-empire/mitos-file-manager/blob/main/src/operations/mod.rs) (File operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["File manager UI"]
  node_application["Application runtime<br/>[main.rs]"]
  node_window["Main window<br/>[window.rs]"]
  node_file_views["File views<br/>[file_view.rs]"]
  node_preview["Item preview<br/>[preview.rs]"]
  node_trash_view["Trash view<br/>[trash_view.rs]"]
  node_settings_ui["Settings UI<br/>[settings.rs]"]
end

subgraph group_files["Filesystem and navigation"]
  node_directory["Directory listing<br/>[directory.rs]"]
  node_filesystem["Filesystem services<br/>[mod.rs]"]
  node_navigation["Navigation state<br/>[mod.rs]"]
  node_search["Search<br/>[engine.rs]"]
  node_mime["MIME and thumbnails<br/>[mod.rs]"]
end

subgraph group_actions["File operations"]
  node_operations["File operations<br/>[mod.rs]"]
  node_jobs["Operation jobs<br/>[jobs.rs]"]
  node_archive["Archive handling<br/>[archive.rs]"]
end

subgraph group_integration["Desktop integration"]
  node_config["Settings and config<br/>[mod.rs]"]
  node_portal["File chooser portal<br/>[service.rs]"]
  node_xdg_portal["XDG portal<br/>[xdg_portal.rs]"]
  node_desktop_service["Desktop D-Bus service<br/>[service.rs]"]
  node_trash_service["Trash D-Bus service<br/>[trash_service.rs]"]
end

node_user(("File manager user"))
node_desktop_shell(("Desktop shell"))

node_user -->|"uses"| node_application
node_application -->|"presents"| node_window
node_application -->|"lists locations"| node_directory
node_application -->|"handles actions"| node_operations
node_application -->|"runs search"| node_search
node_application -->|"manages navigation"| node_navigation
node_application -->|"loads settings"| node_config
node_preview -->|"reads entries"| node_archive
node_preview -->|"uses thumbnails"| node_mime
node_search -->|"uses item metadata"| node_directory
node_operations -->|"submits jobs"| node_jobs
node_portal -->|"registers portal"| node_xdg_portal
node_desktop_shell -->|"sends requests"| node_desktop_service
node_desktop_service -->|"dispatches requests"| node_application
node_desktop_shell -->|"queries trash"| node_trash_service
node_trash_service -->|"uses trash and mounts"| node_filesystem
node_trash_view -->|"manages trashed items"| node_filesystem

click node_application "https://github.com/shark-empire/mitos-file-manager/blob/main/src/main.rs"
click node_window "https://github.com/shark-empire/mitos-file-manager/blob/main/src/ui/window.rs"
click node_file_views "https://github.com/shark-empire/mitos-file-manager/blob/main/src/ui/file_view.rs"
click node_preview "https://github.com/shark-empire/mitos-file-manager/blob/main/src/ui/preview.rs"
click node_trash_view "https://github.com/shark-empire/mitos-file-manager/blob/main/src/ui/trash_view.rs"
click node_settings_ui "https://github.com/shark-empire/mitos-file-manager/blob/main/src/ui/settings.rs"
click node_directory "https://github.com/shark-empire/mitos-file-manager/blob/main/src/filesystem/directory.rs"
click node_filesystem "https://github.com/shark-empire/mitos-file-manager/blob/main/src/filesystem/mod.rs"
click node_navigation "https://github.com/shark-empire/mitos-file-manager/blob/main/src/navigation/mod.rs"
click node_search "https://github.com/shark-empire/mitos-file-manager/blob/main/src/search/engine.rs"
click node_mime "https://github.com/shark-empire/mitos-file-manager/blob/main/src/mime/mod.rs"
click node_operations "https://github.com/shark-empire/mitos-file-manager/blob/main/src/operations/mod.rs"
click node_jobs "https://github.com/shark-empire/mitos-file-manager/blob/main/src/operations/jobs.rs"
click node_archive "https://github.com/shark-empire/mitos-file-manager/blob/main/src/operations/archive.rs"
click node_config "https://github.com/shark-empire/mitos-file-manager/blob/main/src/config/mod.rs"
click node_portal "https://github.com/shark-empire/mitos-file-manager/blob/main/src/portal/service.rs"
click node_xdg_portal "https://github.com/shark-empire/mitos-file-manager/blob/main/src/portal/xdg_portal.rs"
click node_desktop_service "https://github.com/shark-empire/mitos-file-manager/blob/main/src/desktop/service.rs"
click node_trash_service "https://github.com/shark-empire/mitos-file-manager/blob/main/src/desktop/trash_service.rs"

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_application,node_window,node_file_views,node_preview,node_trash_view,node_settings_ui,node_user toneBlue
class node_directory,node_filesystem,node_navigation,node_search,node_mime toneAmber
class node_operations,node_jobs,node_archive toneMint
class node_config,node_portal,node_xdg_portal,node_desktop_service,node_trash_service toneRose
class node_desktop_shell toneIndigo
```

## Components

### File manager UI

- [Application runtime](https://github.com/shark-empire/mitos-file-manager/blob/main/src/main.rs): `src/main.rs`
- [Main window](https://github.com/shark-empire/mitos-file-manager/blob/main/src/ui/window.rs): `src/ui/window.rs`
- [File views](https://github.com/shark-empire/mitos-file-manager/blob/main/src/ui/file_view.rs): `src/ui/file_view.rs`
- [Item preview](https://github.com/shark-empire/mitos-file-manager/blob/main/src/ui/preview.rs): `src/ui/preview.rs`
- [Trash view](https://github.com/shark-empire/mitos-file-manager/blob/main/src/ui/trash_view.rs): `src/ui/trash_view.rs`
- [Settings UI](https://github.com/shark-empire/mitos-file-manager/blob/main/src/ui/settings.rs): `src/ui/settings.rs`

### Filesystem and navigation

- [Directory listing](https://github.com/shark-empire/mitos-file-manager/blob/main/src/filesystem/directory.rs): `src/filesystem/directory.rs`
- [Filesystem services](https://github.com/shark-empire/mitos-file-manager/blob/main/src/filesystem/mod.rs): `src/filesystem/mod.rs`
- [Navigation state](https://github.com/shark-empire/mitos-file-manager/blob/main/src/navigation/mod.rs): `src/navigation/mod.rs`
- [Search](https://github.com/shark-empire/mitos-file-manager/blob/main/src/search/engine.rs): `src/search/engine.rs`
- [MIME and thumbnails](https://github.com/shark-empire/mitos-file-manager/blob/main/src/mime/mod.rs): `src/mime/mod.rs`

### File operations

- [File operations](https://github.com/shark-empire/mitos-file-manager/blob/main/src/operations/mod.rs): `src/operations/mod.rs`
- [Operation jobs](https://github.com/shark-empire/mitos-file-manager/blob/main/src/operations/jobs.rs): `src/operations/jobs.rs`
- [Archive handling](https://github.com/shark-empire/mitos-file-manager/blob/main/src/operations/archive.rs): `src/operations/archive.rs`

### Desktop integration

- [Settings and config](https://github.com/shark-empire/mitos-file-manager/blob/main/src/config/mod.rs): `src/config/mod.rs`
- [File chooser portal](https://github.com/shark-empire/mitos-file-manager/blob/main/src/portal/service.rs): `src/portal/service.rs`
- [XDG portal](https://github.com/shark-empire/mitos-file-manager/blob/main/src/portal/xdg_portal.rs): `src/portal/xdg_portal.rs`
- [Desktop D-Bus service](https://github.com/shark-empire/mitos-file-manager/blob/main/src/desktop/service.rs): `src/desktop/service.rs`
- [Trash D-Bus service](https://github.com/shark-empire/mitos-file-manager/blob/main/src/desktop/trash_service.rs): `src/desktop/trash_service.rs`

### Other components

- **File manager user**
- **Desktop shell**

## Connections

- File manager user → Application runtime: uses
- Application runtime → Main window: presents
- Application runtime → Directory listing: lists locations
- Application runtime → File operations: handles actions
- Application runtime → Search: runs search
- Application runtime → Navigation state: manages navigation
- Application runtime → Settings and config: loads settings
- Item preview → Archive handling: reads entries
- Item preview → MIME and thumbnails: uses thumbnails
- Search → Directory listing: uses item metadata
- File operations → Operation jobs: submits jobs
- File chooser portal → XDG portal: registers portal
- Desktop shell → Desktop D-Bus service: sends requests
- Desktop D-Bus service → Application runtime: dispatches requests
- Desktop shell → Trash D-Bus service: queries trash
- Trash D-Bus service → Filesystem services: uses trash and mounts
- Trash view → Filesystem services: manages trashed items
