# michengai/dsh-codex-ui architecture

> Architecture diagram of the GitHub repository michengai/dsh-codex-ui, 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/michengai/dsh-codex-ui
- Repository: https://github.com/michengai/dsh-codex-ui

## Overview

DSH Codex UI is a browser plugin that replaces and extends DSH Web’s navigation. A user browses workspaces and conversations in its sidebar, chooses a conversation or starts one, then manages sessions or navigates long chats. The README also documents global search, input recall, scheduled tasks, connectors, and companion-plugin settings. Paths reflect the supplied tree; detailed wiring for unsampled UI modules is intentionally omitted.

Main entry points: [`src/index.ts`](https://github.com/michengai/dsh-codex-ui/blob/main/src/index.ts) (Host plugin entry), [`src/client/session-tree.tsx`](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/session-tree.tsx) (Session tree), [`src/client/session-row-actions.tsx`](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/session-row-actions.tsx) (Session actions), [`src/client/index.ts`](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/index.ts) (Client plugin entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Navigation UI"]
  node_sidebar["Codex sidebar<br/>[CodexSidebar.tsx]"]
  node_workspace_browser["Workspace browser"]
  node_session_tree["Session tree<br/>[session-tree.tsx]"]
  node_search["Sidebar search<br/>[sidebar-search.ts]"]
end

subgraph group_sessions["Conversation workflow"]
  node_session_actions["Session actions"]
  node_navigation_logic["Session navigation"]
  node_turns["Turn navigator<br/>[TurnNavigator.tsx]"]
  node_input_history["Input history"]
end

subgraph group_settings["Settings and tools"]
  node_schedule["Schedule browser"]
  node_channels["Channel browser<br/>[ChannelBrowser.tsx]"]
  node_settings_page["Settings page"]
  node_plugin_config["Plugin configuration"]
end

subgraph group_host["Host integration"]
  node_host_entry["Host plugin entry<br/>[index.ts]"]
  node_client_entry["Client plugin entry<br/>[index.ts]"]
  node_session_api["Session host adapter<br/>[session-host.ts]"]
  node_move_api["Session migration"]
  node_dependency_manager["Companion manager"]
  node_host_services["Host service boundary<br/>[host-services.ts]"]
end

subgraph group_state["Session and workspace state"]
  node_session_state["Unread session state<br/>[session-manager.ts]"]
  node_workspace_state["Workspace preferences"]
end

node_user(("DSH Web user"))
node_dsh["DSH Web host"]
node_host_services_external["DSH host services"]
node_browser_storage[("Browser storage")]

node_user -->|"uses"| node_sidebar
node_dsh -->|"loads plugin"| node_host_entry
node_dsh -->|"loads client"| node_client_entry
node_client_entry -->|"registers UI"| node_sidebar
node_sidebar -->|"shows workspaces"| node_workspace_browser
node_workspace_browser -->|"lists sessions"| node_session_tree
node_user -->|"searches"| node_search
node_user -->|"selects session"| node_session_tree
node_session_tree -->|"offers actions"| node_session_actions
node_session_actions -->|"manages sessions"| node_session_api
node_session_actions -->|"requests move"| node_move_api
node_session_tree -->|"opens conversation"| node_navigation_logic
node_navigation_logic -->|"opens session"| node_session_api
node_user -->|"jumps to turn"| node_turns
node_user -->|"recalls input"| node_input_history
node_user -->|"browses schedules"| node_schedule
node_user -->|"browses channels"| node_channels
node_user -->|"opens settings"| node_settings_page
node_settings_page -->|"configures plugins"| node_plugin_config
node_plugin_config -->|"manages companions"| node_dependency_manager
node_client_entry -->|"tracks unread"| node_session_state
node_session_state -->|"reads and writes"| node_browser_storage
node_host_entry -->|"validates services"| node_host_services
node_host_entry -->|"serves management"| node_dependency_manager
node_host_entry -->|"moves sessions"| node_move_api
node_host_entry -->|"serves preferences"| node_workspace_state
node_host_services -->|"accesses services"| node_host_services_external

click node_host_entry "https://github.com/michengai/dsh-codex-ui/blob/main/src/index.ts"
click node_client_entry "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/index.ts"
click node_sidebar "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/CodexSidebar.tsx"
click node_workspace_browser "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/CodexWorkspaceBrowser.tsx"
click node_session_tree "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/session-tree.tsx"
click node_search "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/sidebar-search.ts"
click node_session_actions "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/session-row-actions.tsx"
click node_navigation_logic "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/session-navigation.ts"
click node_turns "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/TurnNavigator.tsx"
click node_input_history "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/InputHistoryDock.tsx"
click node_schedule "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/ScheduleBrowser.tsx"
click node_channels "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/ChannelBrowser.tsx"
click node_settings_page "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/CodexSettingsPage.tsx"
click node_plugin_config "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/PluginConfigSection.tsx"
click node_session_api "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/session-host.ts"
click node_move_api "https://github.com/michengai/dsh-codex-ui/blob/main/src/session-migration.ts"
click node_dependency_manager "https://github.com/michengai/dsh-codex-ui/blob/main/src/dependency-manager.ts"
click node_host_services "https://github.com/michengai/dsh-codex-ui/blob/main/src/host-services.ts"
click node_session_state "https://github.com/michengai/dsh-codex-ui/blob/main/src/client/session-manager.ts"
click node_workspace_state "https://github.com/michengai/dsh-codex-ui/blob/main/src/workspace-preferences.ts"

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_sidebar,node_workspace_browser,node_session_tree,node_search,node_user toneBlue
class node_session_actions,node_navigation_logic,node_turns,node_input_history,node_browser_storage toneAmber
class node_schedule,node_channels,node_settings_page,node_plugin_config toneMint
class node_host_entry,node_client_entry,node_session_api,node_move_api,node_dependency_manager,node_host_services toneRose
class node_session_state,node_workspace_state,node_dsh,node_host_services_external toneIndigo
```

## Components

### Navigation UI

- [Codex sidebar](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/CodexSidebar.tsx): `src/client/CodexSidebar.tsx`
- [Workspace browser](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/CodexWorkspaceBrowser.tsx): `src/client/CodexWorkspaceBrowser.tsx`
- [Session tree](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/session-tree.tsx): `src/client/session-tree.tsx`
- [Sidebar search](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/sidebar-search.ts): `src/client/sidebar-search.ts`

### Conversation workflow

- [Session actions](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/session-row-actions.tsx): `src/client/session-row-actions.tsx`
- [Session navigation](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/session-navigation.ts): `src/client/session-navigation.ts`
- [Turn navigator](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/TurnNavigator.tsx): `src/client/TurnNavigator.tsx`
- [Input history](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/InputHistoryDock.tsx): `src/client/InputHistoryDock.tsx`

### Settings and tools

- [Schedule browser](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/ScheduleBrowser.tsx): `src/client/ScheduleBrowser.tsx`
- [Channel browser](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/ChannelBrowser.tsx): `src/client/ChannelBrowser.tsx`
- [Settings page](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/CodexSettingsPage.tsx): `src/client/CodexSettingsPage.tsx`
- [Plugin configuration](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/PluginConfigSection.tsx): `src/client/PluginConfigSection.tsx`

### Host integration

- [Host plugin entry](https://github.com/michengai/dsh-codex-ui/blob/main/src/index.ts): `src/index.ts`
- [Client plugin entry](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/index.ts): `src/client/index.ts`
- [Session host adapter](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/session-host.ts): `src/client/session-host.ts`
- [Session migration](https://github.com/michengai/dsh-codex-ui/blob/main/src/session-migration.ts): `src/session-migration.ts`
- [Companion manager](https://github.com/michengai/dsh-codex-ui/blob/main/src/dependency-manager.ts): `src/dependency-manager.ts`
- [Host service boundary](https://github.com/michengai/dsh-codex-ui/blob/main/src/host-services.ts): `src/host-services.ts`

### Session and workspace state

- [Unread session state](https://github.com/michengai/dsh-codex-ui/blob/main/src/client/session-manager.ts): `src/client/session-manager.ts`
- [Workspace preferences](https://github.com/michengai/dsh-codex-ui/blob/main/src/workspace-preferences.ts): `src/workspace-preferences.ts`

### Other components

- **DSH Web user**
- **DSH Web host**
- **DSH host services**
- **Browser storage**

## Connections

- DSH Web user → Codex sidebar: uses
- DSH Web host → Host plugin entry: loads plugin
- DSH Web host → Client plugin entry: loads client
- Client plugin entry → Codex sidebar: registers UI
- Codex sidebar → Workspace browser: shows workspaces
- Workspace browser → Session tree: lists sessions
- DSH Web user → Sidebar search: searches
- DSH Web user → Session tree: selects session
- Session tree → Session actions: offers actions
- Session actions → Session host adapter: manages sessions
- Session actions → Session migration: requests move
- Session tree → Session navigation: opens conversation
- Session navigation → Session host adapter: opens session
- DSH Web user → Turn navigator: jumps to turn
- DSH Web user → Input history: recalls input
- DSH Web user → Schedule browser: browses schedules
- DSH Web user → Channel browser: browses channels
- DSH Web user → Settings page: opens settings
- Settings page → Plugin configuration: configures plugins
- Plugin configuration → Companion manager: manages companions
- Client plugin entry → Unread session state: tracks unread
- Unread session state → Browser storage: reads and writes
- Host plugin entry → Host service boundary: validates services
- Host plugin entry → Companion manager: serves management
- Host plugin entry → Session migration: moves sessions
- Host plugin entry → Workspace preferences: serves preferences
- Host service boundary → DSH host services: accesses services
