Skip to content

fix(settings): keep experimental state consistent - #959

Merged
H-Chris233 merged 5 commits into
mainfrom
release/1.3.17-stable
Aug 18, 2026
Merged

fix(settings): keep experimental state consistent#959
H-Chris233 merged 5 commits into
mainfrom
release/1.3.17-stable

Conversation

@appergb

@appergb appergb commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Centralize experimental labels across the settings UI and five locales.
  • Prevent stale preference broadcasts from rolling back queued optimistic settings writes.
  • Return backend-canonical preferences from set_settings before applying the final saved state.
  • Carry the existing OpenLess 1.3.17 Cask update into the release branch.

Validation

  • npm test

Notes

  • Includes the existing chore(cask): update OpenLess to 1.3.17 commit from the merged feature branch.

sim and others added 4 commits August 15, 2026 21:18
@appergb
appergb requested a review from H-Chris233 August 16, 2026 09:17
@H-Chris233 H-Chris233 self-assigned this Aug 18, 2026
@H-Chris233
H-Chris233 merged commit aac9bef into main Aug 18, 2026
4 checks passed
@appergb
appergb deleted the release/1.3.17-stable branch September 9, 2026 05:40
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
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