Skip to content

D-24: SettingsStore — preferredClaudeSurface + cost thresholds + Settings UI #274

@kirich1409

Description

@kirich1409

Description

Extend SettingsStore and the Settings pane with Dialogue-relevant preferences: default surface for Claude Code sessions, cost alert thresholds, and Stream Inspector persistence toggle.

Spec: Epic #250 §5 (preferredClaudeSurface); docs/architecture/dialogue-events.md §6.7 (cost thresholds), §8 (inspector persistence).

Scope

SettingsStore

```swift
@published var preferredClaudeSurface: SessionSurface = .agentTerminal(.claudeCode) // first release default
@published var experimentalDialogueEnabled: Bool = false // opt-in flag
@published var dialogueCostWarningUSD: Double = 1.0
@published var dialogueCostBlockingUSD: Double = 5.0
@published var dialoguePersistRawStreams: Bool = false
```

Persist via UserDefaults; add migration for absent keys (default values applied silently).

Settings UI

Add a "Dialogue" (or extend existing "Agents") section in Settings:

  • Dialogue default — Picker: Terminal (default) / Dialogue (experimental). Explanatory note: "Dialogue renders Claude Code with markdown, tool cards, and thinking blocks. Opt-in during MVP."
  • Cost alerts — two steppers:
    • Warn at $: 1.0
    • Block at $: 5.0
  • Advanced — toggle: "Persist raw event streams (for debugging)".

Wiring

  • TabFeature.newAgentTab and AgentOrchestratorFeature.newSession(workingDirectory:) read preferredClaudeSurface when user didn't specify explicitly.
  • AgentChatFeature reducer reads cost thresholds.
  • StreamInspectorStore reads persistence toggle.

Acceptance Criteria

  • SettingsStore extended, values persisted via UserDefaults.
  • Settings UI shows Dialogue section with all three controls.
  • Changing preferredClaudeSurface takes effect for next new agent session (no restart required).
  • Cost thresholds trigger banner in DialogueView when exceeded.
  • Persistence toggle enables/disables Stream Inspector file mirroring.
  • A11y: all controls labelled and keyboard-navigable.

Relationships

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions