Skip to content

Add effort level picker to chat model menu - #118

Open
mcintyre94 wants to merge 2 commits into
mainfrom
effort-level-picker
Open

Add effort level picker to chat model menu#118
mcintyre94 wants to merge 2 commits into
mainfrom
effort-level-picker

Conversation

@mcintyre94

Copy link
Copy Markdown
Owner

Summary

  • Adds a ClaudeEffortLevel enum (low, medium, high, max) to ClaudeModel.swift
  • Extends the existing model picker Menu with a second Section("Effort") — no new UI surface, just more items in the same dropdown
  • Pill label stays clean at default (medium): shows Sonnet. Non-default surfaces the level: Sonnet · High
  • max is hidden unless Opus is the effective model; switching away from Opus while on max resets to high
  • Effort is passed on every claude -p invocation via --effort, so it applies per-turn and can be changed mid-chat

Test plan

  • Open a chat, tap the model pill — confirm Model and Effort sections appear
  • Select High effort — confirm pill updates to Sonnet · High
  • Select Medium — confirm pill reverts to Sonnet
  • Switch to Opus — confirm Max appears in the Effort section
  • Select Max, then switch back to Sonnet — confirm effort resets to High and Max disappears
  • Send a message with non-default effort — confirm --effort high is present in the exec command

🤖 Generated with Claude Code

Adds a ClaudeEffortLevel enum (low/medium/high/max) and surfaces it in
the existing model picker as a second Menu section. The pill label shows
the effort level only when non-default (e.g. "Sonnet · High") to avoid
visual noise. Max effort is hidden unless Opus is selected, and switching
away from Opus while on max resets to high. Effort is passed to every
claude invocation via --effort.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Apr 4, 2026

Copy link
Copy Markdown

Code review

1 issue found: Missing unit tests

The new ClaudeEffortLevel enum introduces testable logic (isDefault, displayName) and ChatViewModel is modified to append --effort to the claude command string. Neither change has corresponding unit tests, which conflicts with the project convention in CLAUDE.md:

Add new unit tests when adding or modifying logic (models, parsers, utilities, view models)

The existing ClaudeModelTests.swift covers the analogous ClaudeModel enum and is a good template. Suggested additions:

  • Tests for ClaudeEffortLevel.isDefault (only .medium should return true)
  • Tests for ClaudeEffortLevel.displayName for each case
  • A test in ChatViewModelTests.swift that builds a command with a non-default effort level and asserts --effort high (or similar) appears in the output

See:

enum ClaudeEffortLevel: String, CaseIterable, Identifiable {
case low
case medium
case high
case max
var id: String { rawValue }
var displayName: String {
switch self {
case .low: "Low"
case .medium: "Medium"
case .high: "High"
case .max: "Max"
}
}
var isDefault: Bool { self == .medium }
}

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant