# dwarvesf/hidden architecture

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

- Interactive diagram: https://gitdiagram.com/dwarvesf/hidden
- Repository: https://github.com/dwarvesf/hidden

## Overview

Hidden Bar is a macOS menu-bar utility for organizing and hiding status items. The main workflow is a user toggling the arrow: the status-bar controller asks the selected engine to collapse or expand the bar, using either separator sizing or native visibility restrictions. Preferences also control auto-hide, startup, shortcuts, separators, and notch overflow. The graph distinguishes the engine implementations and the notch-overflow path; unsampled subsystems are represented only where their paths are supported by the tree and README.

Main entry points: [`hidden/Features/StatusBar/StatusBarController.swift`](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/StatusBarController.swift) (Status bar controller), [`hidden/Features/StatusBar/Engine/NativeVisibilityEngine.swift`](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Engine/NativeVisibilityEngine.swift) (Native visibility), [`hidden/AppDelegate.swift`](https://github.com/dwarvesf/hidden/blob/develop/hidden/AppDelegate.swift) (App delegate), [`hidden/Features/StatusBar/Engine/MenuBarEngineFactory.swift`](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Engine/MenuBarEngineFactory.swift) (Engine selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App coordination"]
  node_appdelegate["App delegate<br/>[AppDelegate.swift]"]
end

subgraph group_status["Menu bar control"]
  node_statuscontroller["Status bar controller"]
  node_action["Expand/collapse action"]
  node_factory["Engine selection"]
  node_engine["Engine contract"]
  node_legacy["Separator sizing"]
  node_native["Native visibility"]
  node_inventory["Menu bar inventory"]
  node_layout["Section layout"]
  node_bridge["Visibility bridge"]
end

subgraph group_preferences["Settings"]
  node_prefsui["Preferences UI"]
  node_prefwindow["Preferences window"]
  node_prefs["Preference values<br/>[Preferences.swift]"]
  node_autostart["Startup management<br/>[AutoStart.swift]"]
  node_keyprefs["Shortcut preferences"]
end

subgraph group_notch["Notch overflow"]
  node_overflow["Notch overflow"]
end

node_user(("Mac user"))
node_macos["macOS services"]
node_systemitems["System status items"]
node_defaults[("User defaults")]

node_user -->|"toggles arrow"| node_statuscontroller
node_statuscontroller -->|"selects engine"| node_factory
node_factory -->|"chooses fallback"| node_legacy
node_factory -.->|"chooses native"| node_native
node_legacy -->|"implements"| node_engine
node_native -->|"implements"| node_engine
node_statuscontroller -->|"collapses or expands"| node_engine
node_legacy -->|"resizes separators"| node_systemitems
node_native -->|"reads sections"| node_inventory
node_inventory -->|"requests accessibility"| node_macos
node_native -->|"resolves sections"| node_layout
node_native -->|"activates restrictions"| node_bridge
node_bridge -->|"sets visibility"| node_macos
node_user -->|"changes settings"| node_prefsui
node_statuscontroller -->|"opens preferences"| node_prefwindow
node_prefwindow -->|"shows settings"| node_prefsui
node_prefsui -->|"updates values"| node_prefs
node_prefs -->|"reads and writes"| node_defaults
node_appdelegate -->|"configures startup"| node_autostart
node_autostart -->|"registers login"| node_macos
node_appdelegate -->|"loads defaults"| node_prefs
node_appdelegate -->|"creates controller"| node_statuscontroller
node_statuscontroller -->|"opens overflow"| node_overflow
node_overflow -->|"enumerates and activates extras"| node_macos
node_user -->|"browses notch items"| node_overflow

click node_appdelegate "https://github.com/dwarvesf/hidden/blob/develop/hidden/AppDelegate.swift"
click node_statuscontroller "https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/StatusBarController.swift"
click node_action "https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/ExpandCollapseAction.swift"
click node_factory "https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Engine/MenuBarEngineFactory.swift"
click node_engine "https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Engine/MenuBarEngine.swift"
click node_legacy "https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Engine/LegacyLengthEngine.swift"
click node_native "https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Engine/NativeVisibilityEngine.swift"
click node_inventory "https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Layout/AccessibilityMenuBarInventory.swift"
click node_layout "https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Layout/MenuBarLayout.swift"
click node_bridge "https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Engine/Native/NativeVisibilityBridge.swift"
click node_prefsui "https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/Preferences/PreferencesViewController.swift"
click node_prefwindow "https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/Preferences/PreferencesWindowController.swift"
click node_prefs "https://github.com/dwarvesf/hidden/blob/develop/hidden/Common/Preferences.swift"
click node_autostart "https://github.com/dwarvesf/hidden/blob/develop/hidden/Common/AutoStart.swift"
click node_keyprefs "https://github.com/dwarvesf/hidden/blob/develop/hidden/Models/GlobalKeybindingPreferences.swift"
click node_overflow "https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/NotchOverflow/NotchOverflowController.swift"

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_appdelegate,node_user toneBlue
class node_statuscontroller,node_action,node_factory,node_engine,node_legacy,node_native,node_inventory,node_layout,node_bridge,node_defaults toneAmber
class node_prefsui,node_prefwindow,node_prefs,node_autostart,node_keyprefs toneMint
class node_overflow toneRose
class node_macos,node_systemitems toneIndigo
```

## Components

### App coordination

- [App delegate](https://github.com/dwarvesf/hidden/blob/develop/hidden/AppDelegate.swift): `hidden/AppDelegate.swift`

### Menu bar control

- [Status bar controller](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/StatusBarController.swift): `hidden/Features/StatusBar/StatusBarController.swift`
- [Expand/collapse action](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/ExpandCollapseAction.swift): `hidden/Features/StatusBar/ExpandCollapseAction.swift`
- [Engine selection](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Engine/MenuBarEngineFactory.swift): `hidden/Features/StatusBar/Engine/MenuBarEngineFactory.swift`
- [Engine contract](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Engine/MenuBarEngine.swift): `hidden/Features/StatusBar/Engine/MenuBarEngine.swift`
- [Separator sizing](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Engine/LegacyLengthEngine.swift): `hidden/Features/StatusBar/Engine/LegacyLengthEngine.swift`
- [Native visibility](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Engine/NativeVisibilityEngine.swift): `hidden/Features/StatusBar/Engine/NativeVisibilityEngine.swift`
- [Menu bar inventory](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Layout/AccessibilityMenuBarInventory.swift): `hidden/Features/StatusBar/Layout/AccessibilityMenuBarInventory.swift`
- [Section layout](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Layout/MenuBarLayout.swift): `hidden/Features/StatusBar/Layout/MenuBarLayout.swift`
- [Visibility bridge](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/StatusBar/Engine/Native/NativeVisibilityBridge.swift): `hidden/Features/StatusBar/Engine/Native/NativeVisibilityBridge.swift`

### Settings

- [Preferences UI](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/Preferences/PreferencesViewController.swift): `hidden/Features/Preferences/PreferencesViewController.swift`
- [Preferences window](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/Preferences/PreferencesWindowController.swift): `hidden/Features/Preferences/PreferencesWindowController.swift`
- [Preference values](https://github.com/dwarvesf/hidden/blob/develop/hidden/Common/Preferences.swift): `hidden/Common/Preferences.swift`
- [Startup management](https://github.com/dwarvesf/hidden/blob/develop/hidden/Common/AutoStart.swift): `hidden/Common/AutoStart.swift`
- [Shortcut preferences](https://github.com/dwarvesf/hidden/blob/develop/hidden/Models/GlobalKeybindingPreferences.swift): `hidden/Models/GlobalKeybindingPreferences.swift`

### Notch overflow

- [Notch overflow](https://github.com/dwarvesf/hidden/blob/develop/hidden/Features/NotchOverflow/NotchOverflowController.swift): `hidden/Features/NotchOverflow/NotchOverflowController.swift`

### Other components

- **Mac user**
- **macOS services**
- **System status items**
- **User defaults**

## Connections

- Mac user → Status bar controller: toggles arrow
- Status bar controller → Engine selection: selects engine
- Engine selection → Separator sizing: chooses fallback
- Engine selection → Native visibility: chooses native
- Separator sizing → Engine contract: implements
- Native visibility → Engine contract: implements
- Status bar controller → Engine contract: collapses or expands
- Separator sizing → System status items: resizes separators
- Native visibility → Menu bar inventory: reads sections
- Menu bar inventory → macOS services: requests accessibility
- Native visibility → Section layout: resolves sections
- Native visibility → Visibility bridge: activates restrictions
- Visibility bridge → macOS services: sets visibility
- Mac user → Preferences UI: changes settings
- Status bar controller → Preferences window: opens preferences
- Preferences window → Preferences UI: shows settings
- Preferences UI → Preference values: updates values
- Preference values → User defaults: reads and writes
- App delegate → Startup management: configures startup
- Startup management → macOS services: registers login
- App delegate → Preference values: loads defaults
- App delegate → Status bar controller: creates controller
- Status bar controller → Notch overflow: opens overflow
- Notch overflow → macOS services: enumerates and activates extras
- Mac user → Notch overflow: browses notch items
