fix: make API key optional for custom providers & sync nativeTheme for IME#644
Open
MrRealORG wants to merge 1 commit into
Open
Conversation
…r IME color - XiaomiMiMo#529: Custom provider wizard no longer requires an API key. Users can press Enter to skip the key step for local providers. The env array and auth.set call are now conditional on key presence. - XiaomiMiMo#518: Sync Electron's nativeTheme.themeSource with the app's theme mode so that IME composition text color matches the active theme. On Windows, Chromium's internal dark mode flag (from nativeTheme) influences how Microsoft IME renders composition text. Without this sync, a system-dark + app-light mismatch caused white IME text on a white background, making pre-input characters invisible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #529 and #518.
1. Custom provider API key is now optional (#529)
The custom provider wizard previously required an API key — pressing Enter with an empty value silently aborted the entire setup. This blocked users with local providers (e.g., llama.cpp, Ollama) that don't need authentication.
Changes:
if (!apiKey) returnguard that blocked empty keysenvarray conditional — only added when a key is providedauth.set()call inif (apiKey)— skipped entirely for keyless providers2. Sync Electron nativeTheme with app theme (#518)
On Windows, when the system is in dark mode but the app is set to light mode, IME composition text (pre-input characters from Microsoft IME) appeared white on white — completely invisible.
Root cause: Electron's
nativeTheme.themeSourcedefaulted to"system", so Chromium's internal dark mode flag followed the OS theme, not the app's CSS theme. On Windows, this flag influences how Microsoft IME (TSF) renders composition text.Changes:
setNativeThemeSource()inwindows.tsto setnativeTheme.themeSourceset-native-themein `ipc.ts"setNativeTheme()in preload bridge and typeswindow.api.setNativeTheme(mode)alongsidesetBackgroundColorwhenever the theme changesCloses #529, closes #518.