context

Getting Started with Context

Get Context running and understand the codebase in under 10 minutes.

Prerequisites

Quick Setup

# 1. Clone the repository
git clone https://github.com/tartavull/context.git
cd context

# 2. Open in Xcode
open context.xcodeproj

# 3. Build and run (Cmd+R in Xcode)

What You’ll See

  1. Native macOS window with split-pane interface
  2. Left pane: Projects and task tree navigation
  3. Center pane: Visual task chart representation
  4. Right pane: Chat interface for selected task (overlay)

Project Structure

context/
├── context.xcodeproj/           # Xcode project file
├── context/                     # Main app source
│   ├── contextApp.swift        # App entry point (@main)
│   ├── ContentView.swift       # Main UI layout
│   ├── AppStateManager.swift   # Centralized state management
│   ├── Models.swift            # Data models (Project, Task, Message)
│   └── Views/                  # SwiftUI view components
│       ├── ProjectsView.swift  # Task tree sidebar
│       ├── Chat/               # Chat interface components
│       └── Tree/               # Task visualization components
└── docs/                       # Documentation

Key Files

Key Concepts

SwiftUI Architecture

Context uses SwiftUI’s declarative UI with reactive state management:

// AppStateManager is an ObservableObject
@StateObject private var appState = AppStateManager()

// Views automatically update when @Published properties change
@Published var state: AppState

Project and Task Hierarchy

Development Workflow

Making Changes

  1. UI Changes: Edit SwiftUI views in the Views/ directory
  2. State Changes: Update AppStateManager.swift methods
  3. Data Models: Modify structures in Models.swift
  4. Test: Use Cmd+R to rebuild and test

Working with State

All state changes should go through AppStateManager:

// Good: Use AppStateManager methods
appState.createTask(projectId: projectId, title: "New Task")

// Avoid: Direct state manipulation