# parkhw328/wook-text architecture

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

- Interactive diagram: https://gitdiagram.com/parkhw328/wook-text
- Repository: https://github.com/parkhw328/wook-text

## Overview

wText is a Windows WPF text editor. The main workflow is opening or creating documents, editing and searching them, then saving while preserving encoding and line endings; users can also browse project folders, compare text, and format supported languages. Session restoration and preferences support the editing experience. The graph combines sampled implementation with capabilities documented in the README; edges for documented but unsampled behavior are cited to the README, and source excerpts do not expose every event-handler relationship.

Main entry points: [`src/WookText.App/MainWindow.xaml.cs`](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/MainWindow.xaml.cs) (Main window), [`src/WookText.App/EditorDocument.cs`](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/EditorDocument.cs) (Editor document), [`src/WookText.App/Explorer/ExplorerView.xaml.cs`](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/Explorer/ExplorerView.xaml.cs) (Explorer view), [`src/WookText.App/CompareWindow.xaml.cs`](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/CompareWindow.xaml.cs) (Comparison window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Editor experience"]
  node_main["Main window<br/>[MainWindow.xaml.cs]"]
  node_document["Editor document<br/>[EditorDocument.cs]"]
  node_editor["Editor control setup<br/>[EditorFactory.cs]"]
  node_syntax["Syntax catalog<br/>[SyntaxCatalog.cs]"]
end

subgraph group_workspace["Project browsing"]
  node_explorer["Explorer view"]
  node_workspace["Workspace coordinator"]
  node_workspacefiles["Workspace file operations<br/>[WorkspaceFiles.cs]"]
end

subgraph group_texttools["Text operations"]
  node_search["Search highlighting"]
  node_linked["Linked search editing"]
  node_fileio["Text file I/O<br/>[TextFileService.cs]"]
  node_analysis["Text analysis<br/>[TextAnalysis.cs]"]
  node_format["Text formatting"]
  node_formatter["Formatter adapter<br/>[format.cjs]"]
  node_compare["Comparison window"]
  node_diff["Diff service<br/>[TextDiffService.cs]"]
end

subgraph group_state["Local state"]
  node_session["Session coordinator"]
  node_sessionstore[("Session persistence<br/>[SessionStore.cs]")]
  node_workspacestate[("Workspace state")]
end

subgraph group_settings["Editor configuration"]
  node_preferences["Preferences UI"]
  node_prefservice["Preferences service"]
  node_prefstore[("Preferences persistence")]
end

node_user(("Editor user"))

node_user -->|"edits documents"| node_main
node_main -->|"manages tabs"| node_document
node_main -->|"opens and saves"| node_fileio
node_main -->|"highlights matches"| node_search
node_main -->|"dispatches linked edits"| node_linked
node_main -->|"formats documents"| node_format
node_document -->|"creates editor"| node_editor
node_document -->|"resolves language"| node_syntax
node_linked -->|"finds matches"| node_analysis
node_format -->|"runs formatter"| node_formatter
node_user -->|"compares inputs"| node_compare
node_compare -->|"loads comparison files"| node_fileio
node_compare -->|"computes differences"| node_diff
node_user -->|"browses projects"| node_explorer
node_explorer -->|"routes workspace actions"| node_workspace
node_workspace -->|"reads and changes files"| node_workspacefiles
node_explorer -->|"loads workspace state"| node_workspacestate
node_main -->|"restores work session"| node_session
node_session -->|"loads and saves session"| node_sessionstore
node_main -->|"persists workspace state"| node_workspacestate
node_user -->|"configures editor"| node_preferences
node_preferences -->|"updates preferences"| node_prefservice
node_prefservice -->|"loads and saves settings"| node_prefstore
node_prefservice -.->|"applies editor options"| node_editor

click node_main "https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/MainWindow.xaml.cs"
click node_document "https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/EditorDocument.cs"
click node_editor "https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/EditorFactory.cs"
click node_syntax "https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/SyntaxCatalog.cs"
click node_search "https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/SearchMatchColorizer.cs"
click node_linked "https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/SearchLinkedEditor.cs"
click node_fileio "https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/TextFileService.cs"
click node_analysis "https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/TextAnalysis.cs"
click node_format "https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/TextFormattingService.cs"
click node_formatter "https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/Formatting/format.cjs"
click node_compare "https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/CompareWindow.xaml.cs"
click node_diff "https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/TextDiffService.cs"
click node_explorer "https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/Explorer/ExplorerView.xaml.cs"
click node_workspace "https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/Explorer/ExplorerWorkspace.cs"
click node_workspacefiles "https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/WorkspaceFiles.cs"
click node_session "https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/SessionCoordinator.cs"
click node_sessionstore "https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/SessionStore.cs"
click node_workspacestate "https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/WorkspaceStateStore.cs"
click node_preferences "https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/PreferencesWindow.xaml.cs"
click node_prefservice "https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/EditorPreferencesService.cs"
click node_prefstore "https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/PreferencesStore.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_main,node_document,node_editor,node_syntax,node_user toneBlue
class node_explorer,node_workspace,node_workspacefiles toneAmber
class node_search,node_linked,node_fileio,node_analysis,node_format,node_formatter,node_compare,node_diff toneMint
class node_session,node_sessionstore,node_workspacestate toneRose
class node_preferences,node_prefservice,node_prefstore toneIndigo
```

## Components

### Editor experience

- [Main window](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/MainWindow.xaml.cs): `src/WookText.App/MainWindow.xaml.cs`
- [Editor document](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/EditorDocument.cs): `src/WookText.App/EditorDocument.cs`
- [Editor control setup](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/EditorFactory.cs): `src/WookText.App/EditorFactory.cs`
- [Syntax catalog](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/SyntaxCatalog.cs): `src/WookText.App/SyntaxCatalog.cs`

### Project browsing

- [Explorer view](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/Explorer/ExplorerView.xaml.cs): `src/WookText.App/Explorer/ExplorerView.xaml.cs`
- [Workspace coordinator](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/Explorer/ExplorerWorkspace.cs): `src/WookText.App/Explorer/ExplorerWorkspace.cs`
- [Workspace file operations](https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/WorkspaceFiles.cs): `src/WookText.Core/WorkspaceFiles.cs`

### Text operations

- [Search highlighting](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/SearchMatchColorizer.cs): `src/WookText.App/SearchMatchColorizer.cs`
- [Linked search editing](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/SearchLinkedEditor.cs): `src/WookText.App/SearchLinkedEditor.cs`
- [Text file I/O](https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/TextFileService.cs): `src/WookText.Core/TextFileService.cs`
- [Text analysis](https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/TextAnalysis.cs): `src/WookText.Core/TextAnalysis.cs`
- [Text formatting](https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/TextFormattingService.cs): `src/WookText.Core/TextFormattingService.cs`
- [Formatter adapter](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/Formatting/format.cjs): `src/WookText.App/Formatting/format.cjs`
- [Comparison window](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/CompareWindow.xaml.cs): `src/WookText.App/CompareWindow.xaml.cs`
- [Diff service](https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/TextDiffService.cs): `src/WookText.Core/TextDiffService.cs`

### Local state

- [Session coordinator](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/SessionCoordinator.cs): `src/WookText.App/SessionCoordinator.cs`
- [Session persistence](https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/SessionStore.cs): `src/WookText.Core/SessionStore.cs`
- [Workspace state](https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/WorkspaceStateStore.cs): `src/WookText.Core/WorkspaceStateStore.cs`

### Editor configuration

- [Preferences UI](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/PreferencesWindow.xaml.cs): `src/WookText.App/PreferencesWindow.xaml.cs`
- [Preferences service](https://github.com/parkhw328/wook-text/blob/main/src/WookText.App/EditorPreferencesService.cs): `src/WookText.App/EditorPreferencesService.cs`
- [Preferences persistence](https://github.com/parkhw328/wook-text/blob/main/src/WookText.Core/PreferencesStore.cs): `src/WookText.Core/PreferencesStore.cs`

### Other components

- **Editor user**

## Connections

- Editor user → Main window: edits documents (evidence: `README.md`)
- Main window → Editor document: manages tabs (evidence: `src/WookText.App/MainWindow.xaml.cs`)
- Main window → Text file I/O: opens and saves (evidence: `src/WookText.App/MainWindow.xaml.cs`)
- Main window → Search highlighting: highlights matches (evidence: `src/WookText.App/MainWindow.xaml.cs`)
- Main window → Linked search editing: dispatches linked edits (evidence: `src/WookText.App/MainWindow.xaml.cs`)
- Main window → Text formatting: formats documents (evidence: `src/WookText.App/MainWindow.xaml.cs`)
- Editor document → Editor control setup: creates editor (evidence: `src/WookText.App/EditorDocument.cs`)
- Editor document → Syntax catalog: resolves language (evidence: `src/WookText.App/EditorDocument.cs`)
- Linked search editing → Text analysis: finds matches
- Text formatting → Formatter adapter: runs formatter (evidence: `src/WookText.Core/TextFormattingService.cs`)
- Editor user → Comparison window: compares inputs (evidence: `README.md`)
- Comparison window → Text file I/O: loads comparison files (evidence: `src/WookText.App/CompareWindow.xaml.cs`)
- Comparison window → Diff service: computes differences (evidence: `src/WookText.App/CompareWindow.xaml.cs`)
- Editor user → Explorer view: browses projects (evidence: `README.md`)
- Explorer view → Workspace coordinator: routes workspace actions (evidence: `src/WookText.App/Explorer/ExplorerView.xaml.cs`)
- Workspace coordinator → Workspace file operations: reads and changes files (evidence: `src/WookText.App/Explorer/ExplorerWorkspace.cs`)
- Explorer view → Workspace state: loads workspace state (evidence: `src/WookText.App/Explorer/ExplorerView.xaml.cs`)
- Main window → Session coordinator: restores work session (evidence: `src/WookText.App/MainWindow.xaml.cs`)
- Session coordinator → Session persistence: loads and saves session (evidence: `src/WookText.App/SessionCoordinator.cs`)
- Main window → Workspace state: persists workspace state (evidence: `src/WookText.App/MainWindow.xaml.cs`)
- Editor user → Preferences UI: configures editor (evidence: `README.md`)
- Preferences UI → Preferences service: updates preferences (evidence: `src/WookText.App/PreferencesWindow.xaml.cs`)
- Preferences service → Preferences persistence: loads and saves settings (evidence: `src/WookText.App/EditorPreferencesService.cs`)
- Preferences service → Editor control setup: applies editor options (evidence: `src/WookText.App/EditorFactory.cs`)
