Skip to content

Let users choose the writing provider - #6

Open
wanming wants to merge 2 commits into
mainfrom
claude/project-thread-zqloql
Open

wanming wants to merge 2 commits into
mainfrom
claude/project-thread-zqloql

Conversation

@wanming

@wanming wanming commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Requested by Tom · project thread

Before: Inklet only worked with an OpenAI API key. The app already had presets for 20 other providers, but Settings and the saved config always forced writing back to OpenAI.

After: General settings has a Provider picker. The choices are OpenAI, Anthropic, Gemini, DeepSeek, Qwen, Kimi, GLM, and the other existing presets, plus Custom (OpenAI Compatible) with an Endpoint field. Writing and selection translation use the chosen provider and its own key. Realtime dictation and pronunciation still use OpenAI, so when another provider is selected, a separate optional OpenAI API Key field appears for those features. With OpenAI selected, the screen works exactly as before: one key covers everything.

This removes the biggest setup blocker for people who can't easily pay for OpenAI, which is the first step in the growth plan for the project.

How

  • AppConfig now keeps the saved providerID. Configs saved before version 5 still resolve to OpenAI, so stale provider IDs from early builds don't switch anyone's provider when they upgrade. Unknown IDs also fall back to OpenAI. resolvedProviderPreset applies the custom endpoint when it's a valid http(s) URL.
  • SettingsViewModel loads and saves each provider's key under its own Keychain account. Switching providers first flushes any key you were typing, then loads the new provider's key and default model. The model list now comes from the selected provider's catalog.
  • Onboarding checks for the selected provider's key, not the OpenAI key.
  • The UI reuses the existing Provider, API Key, and Endpoint strings, and their help text is rewritten. Two new keys are added in all ten languages.
  • README (English and Chinese) and the manual QA checklist are updated.
  • I didn't touch the popover or dictation code. One known gap: the popover header shows the custom preset's English name.

Verification

  • I added config decoding and round-trip tests, plus Settings view model tests for switching providers and saving keys per provider. I couldn't run swift test here (no Swift toolchain), so CI is the first run.
  • Manual QA still needed: switch to another provider and transform and translate with it, check that dictation and pronunciation still use the OpenAI key, try a local custom endpoint, switch back to OpenAI, and check that the General panel fits in English and Chinese.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KrJfbzXfbZ33kLGiZbfpz7


Generated by Claude Code

Settings now offers every built-in provider preset plus a custom
OpenAI-compatible endpoint for writing and selection translation.
Realtime dictation and pronunciation keep using OpenAI, so a separate
optional OpenAI key field appears whenever another provider is chosen.

Configurations saved before version 5 still resolve to OpenAI, so
stale provider IDs from early builds cannot switch providers on upgrade.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KrJfbzXfbZ33kLGiZbfpz7
@wanming wanming self-assigned this Oct 4, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KrJfbzXfbZ33kLGiZbfpz7
@wanming
wanming marked this pull request as ready for review October 4, 2026 23:44
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.

2 participants