# nathancartlidge/powertoys-run-unicode architecture

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

- Interactive diagram: https://gitdiagram.com/nathancartlidge/powertoys-run-unicode
- Repository: https://github.com/nathancartlidge/powertoys-run-unicode

## Overview

##### Main Components

a. Input Layer:
- PowerToys Run Interface (entry point)
- Command Parser (for \ne, &times;, etc.)

b. Core Processing Components:
- Lookup System
- AgdaLookup (for Latex-style inputs)
- HtmlLookup (for HTML entity inputs)
- BaseLookup (shared functionality)
- Character Mapping Storage (assets/mappings.txt)

c. Output Handlers:
- Typer (for direct input)
- Clipboard Manager (for clipboard operations)

##### Relationships and Data Flow

**User Input -> PowerToys Run Interface -> Command Parser**
- ↓
- ┌────────────── Lookup System ───────────┐
- ↓                    ↓                   ↓
- AgdaLookup             BaseLookup         HtmlLookup
- ↓                    ↓                   ↓
- Character Mapping ───────────┘
- ↓
- ┌─────────── Output Handler ────────────┐
- ↓                                       ↓
- Typer                              Clipboard Manager

##### Additional Details

- Testing Framework connection (showing test coverage)
- Configuration options (plugin.json settings)
- External dependencies (PowerToys Run API)

##### Implementation Notes

- Relationship between test files and their corresponding implementation
- Build/deployment workflow from GitHub Actions
- Separation between core functionality and extension points

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        PTR["PowerToys Run Interface"]:::interface
        CP["Command Parser"]:::processor
    end

    subgraph Lookup
        LS["Lookup System"]:::processor
        AL["AgdaLookup"]:::lookup
        HL["HtmlLookup"]:::lookup
        BL["BaseLookup"]:::lookup
    end

    subgraph Storage
        CM[("Character Mapping")]:::storage
    end

    subgraph Output
        OH["Output Handler"]:::processor
        T["Typer"]:::output
        CB["Clipboard Manager"]:::output
    end

    subgraph Testing
        TF["Testing Framework"]:::test
        HLT["HTML Lookup Tests"]:::test
        ELT["Exact Lookup Tests"]:::test
        PLT["Partial Lookup Tests"]:::test
        UT["Usage Tests"]:::test
    end

    subgraph Build
        GHA["GitHub Actions"]:::build
        BW["Build Workflow"]:::build
        TW["Test Workflow"]:::build
    end

    %% Relationships
    PTR --> CP
    CP --> LS
    LS --> AL & HL & BL
    AL & HL & BL --> CM
    CM --> OH
    OH --> T
    OH --> CB

    %% Testing relationships
    TF --> HLT & ELT & PLT & UT
    HLT -.-> HL
    ELT & PLT -.-> BL
    UT -.-> PTR

    %% Build relationships
    GHA --> BW & TW
    BW -.-> PTR
    TW -.-> TF

    %% Click events
    click PTR "https://github.com/nathancartlidge/powertoys-run-unicode/blob/main/src/Community.PowerToys.Run.Plugin.UnicodeInput/Main.cs"
    click AL "https://github.com/nathancartlidge/powertoys-run-unicode/blob/main/src/Community.PowerToys.Run.Plugin.UnicodeInput/AgdaLookup.cs"
    click HL "https://github.com/nathancartlidge/powertoys-run-unicode/blob/main/src/Community.PowerToys.Run.Plugin.UnicodeInput/HtmlLookup.cs"
    click BL "https://github.com/nathancartlidge/powertoys-run-unicode/blob/main/src/Community.PowerToys.Run.Plugin.UnicodeInput/BaseLookup.cs"
    click CM "https://github.com/nathancartlidge/powertoys-run-unicode/blob/main/assets/mappings.txt"
    click T "https://github.com/nathancartlidge/powertoys-run-unicode/blob/main/src/Community.PowerToys.Run.Plugin.UnicodeInput/Typer.cs"
    click HLT "https://github.com/nathancartlidge/powertoys-run-unicode/blob/main/src/Community.PowerToys.Run.Plugin.UnicodeInput.Tests/HtmlLookupTest.cs"
    click ELT "https://github.com/nathancartlidge/powertoys-run-unicode/blob/main/src/Community.PowerToys.Run.Plugin.UnicodeInput.Tests/ExactLookupTest.cs"
    click PLT "https://github.com/nathancartlidge/powertoys-run-unicode/blob/main/src/Community.PowerToys.Run.Plugin.UnicodeInput.Tests/PartialLookupTest.cs"
    click UT "https://github.com/nathancartlidge/powertoys-run-unicode/blob/main/src/Community.PowerToys.Run.Plugin.UnicodeInput.Tests/UsageTests.cs"
    click BW "https://github.com/nathancartlidge/powertoys-run-unicode/blob/main/.github/workflows/build.yml"
    click TW "https://github.com/nathancartlidge/powertoys-run-unicode/blob/main/.github/workflows/test.yml"

    %% Styling
    classDef interface fill:#2374ab
    classDef processor fill:#48a9a6
    classDef lookup fill:#4aad52
    classDef storage fill:#e4a0ae
    classDef output fill:#9b5de5
    classDef test fill:#ffafcc
    classDef build fill:#cdb4db

    %% Legend
    subgraph Legend
        L1["Interface Component"]:::interface
        L2["Processor Component"]:::processor
        L3["Lookup Component"]:::lookup
        L4[("Storage Component")]:::storage
        L5["Output Component"]:::output
        L6["Test Component"]:::test
        L7["Build Component"]:::build
    end
```
