Improve settings: copy tokens and edit without signing out#127
Improve settings: copy tokens and edit without signing out#127mcintyre94 wants to merge 3 commits into
Conversation
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>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Long-press context menu on Sprites API and Claude Code rows to copy the token to clipboard (with "Copied!" flash feedback) or open an edit sheet to update the token without signing out - EditTokenSheet: form sheet for updating a single token; Sprites token validates against the API before saving (rolls back on failure), Claude token saves directly - Shared tokenRow @ViewBuilder helper eliminates duplication between the two rows Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
test |
Code review3 issues found. 1. Bug: Original valid token destroyed on validation failureFile: The save flow for Sprites tokens overwrites the Keychain immediately (line 98), then if wisp/Wisp/Views/Settings/EditTokenSheet.swift Lines 95 to 107 in f47afdd Fix: read the old token before overwriting and restore it in the let oldToken = KeychainService.shared.read(key: tokenType.keychainKey)
isSaving = true
defer { isSaving = false }
do {
try KeychainService.shared.save(trimmed, for: tokenType.keychainKey)
apiClient.refreshAuthState()
try await apiClient.validateToken()
isPresented = false
} catch {
if let oldToken {
try? KeychainService.shared.save(oldToken, for: tokenType.keychainKey)
} else {
KeychainService.shared.delete(key: tokenType.keychainKey)
}
apiClient.refreshAuthState()
errorMessage = "Invalid token. Please check and try again."
}2. CLAUDE.md violation: context menu without matching swipe actionsFile:
wisp/Wisp/Views/Settings/SettingsView.swift Lines 88 to 114 in f47afdd On iPhone/iPad these actions are only reachable via long-press. Add 3. Token copy not
|
Summary
tokenRow@ViewBuilderhelper keeps the two rows DRYTest plan
🤖 Generated with Claude Code