Skip to content

Scaffold macos-swift: native SwiftUI/AppKit client for traverse-starter #45

Description

@enricopiovesan

Summary

Create apps/traverse-starter/macos-swift/ — a native macOS client for the traverse-starter reference app using SwiftUI. Phase 1 uses the same HTTP polling approach as web-react. Shares TraverseClient.swift with ios-swift (copy or Swift package — see #58). SSE is the phase 2 upgrade path.

Phase 1 scope (HTTP polling — unblocked)

  • Native macOS app calling the Traverse HTTP/JSON API
  • Text input → POST /v1/workspaces/{workspace}/execute → poll → render result
  • Runtime URL + workspace configurable via Preferences window (⌘,)
  • Health check status in toolbar
  • macOS UI conventions: menu bar, keyboard shortcuts (⌘↵ submit, ⌘R reset), window management

Stack

Concern Choice
Language Swift 6
UI framework SwiftUI (AppKit bridge for menu bar)
HTTP URLSession
Min target macOS 14
Architecture MVVM — ExecutionViewModel owns idle→loading→polling→done state

Directory structure

apps/traverse-starter/macos-swift/
  TraverseStarterMac.xcodeproj/
  TraverseStarterMac/
    TraverseClient.swift          # URLSession HTTP client (shared with ios-swift)
    ExecutionViewModel.swift      # ObservableObject — idle/loading/polling/done
    ContentView.swift             # Main view
    PreferencesView.swift         # Runtime URL + workspace (⌘,)
    AppDelegate.swift             # NSApplicationDelegate, menu bar
    Assets.xcassets/
    Info.plist
  TraverseStarterMacTests/

Phase 2 upgrade path (do not implement now)

When Traverse ships #525 / #526 / #527:

Definition of Done

  • Xcode project builds for macOS 14+ with zero warnings
  • Preferences window: manual URL + workspace, persisted to UserDefaults
  • Health check status in toolbar
  • Note input → execute → poll → renders output fields
  • ⌘↵ submits, ⌘R resets
  • Unit tests for TraverseClient and ExecutionViewModel
  • README in macos-swift/ covering: prerequisites, runtime URL config, build and run
  • scripts/ci/repository_checks.sh updated to acknowledge macos-swift/ directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions