fix(settings): keep experimental state consistent - #959
Merged
Conversation
Release follow-up: apply the cask update through the required PR path after the automated direct push was rejected.
DepengWang
pushed a commit
to DepengWang/openless
that referenced
this pull request
Sep 13, 2026
(cherry picked from commit aac9bef on origin/main, adapted for this branch) Pulls in the write-gate race-condition fix from upstream main: a local optimistic settings write could be overwritten by an older `prefs:changed` broadcast that arrives after the write started but before it resolves, making a toggle briefly "bounce back" to its old value. Fixes this by tracking per-field pending local changes and correlating incoming broadcasts against writes this webview itself issued (via an upgraded PreferencesWriteGate with value comparison and recent-write history, replacing the old counter-only version). Adapted for divergence from upstream main (this branch already contains all of beta, which has evolved well past main in this area): - android::commands::settings::set_settings (the #[cfg(mobile)] variant) now returns Result<UserPreferences, String> instead of Result<(), String>, matching desktop's set_settings and what ipc/settings.ts's setSettings() already expects. This also fixes a latent Android-only bug: the frontend's setSettings() has been typed to return Promise<UserPreferences> since it already matches desktop, but on Android it silently got `undefined` back at runtime. Kept this branch's existing coord.backend() accessor style rather than upstream's newer coord.prefs()/coord.style_packs() (this branch has never adopted that accessor split). Did not add upstream's inline app.emit("prefs:changed", ...) calls or an app: AppHandle parameter: this branch already broadcasts prefs changes through BackendEventKind::PreferencesChanged -> tauri_events.rs, which mobile_runtime.rs wires up for Android too, so an inline emit would just double-broadcast. - HotkeySettingsContext.tsx: ported upstream's write-gate integration (applyIncomingPrefs, pendingLocalChangesRef, prefsChangeVersionRef, waitForPersistence) but dropped its locale-output-preference sync effect — that feature (outputPrefsForLocale/SupportedLocale) no longer exists anywhere in this branch's i18n module, so re-adding it would resurrect removed functionality and fail to compile. Re-applied this branch's own applyStackedLayoutFromPrefs/applyConservativeLayout calls (upstream doesn't have these) in the three spots this branch already had them. - shared.tsx: merged cleanly on its own; manually added upstream's new SectionDesc no-op placeholder component that was missing here. - ipc/settings.ts, ExperimentalSectionTitle.test.ts, i18n/experimentalTitles.test.ts, i18n/{en,ja,ko,zh-CN,zh-TW}.ts, MultimodalPipelineSection.tsx, Casks/openless.rb: kept this branch's existing content — either already a superset of upstream's fix, or differed only in formatting with identical text/logic. - LocalModelSection.tsx: kept deleted (this branch already replaced it via beta's "2.0 model settings page" rework; upstream's change here only applied ExperimentalSectionTitle to the old file). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ngBxFcjxx36GkNKt7UWHV
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
set_settingsbefore applying the final saved state.Validation
npm testNotes
chore(cask): update OpenLess to 1.3.17commit from the merged feature branch.