feat(settings): add Developer Mode section gating Feature Releases#3039
Conversation
harshitsinghbhandari
left a comment
There was a problem hiding this comment.
Review: ready to merge (posting as COMMENT since GitHub blocks self-approval).
Clean, tightly-scoped UI gate. developerMode follows the existing ui-store + localStorage pattern; the feature channel option and FeatureBuildsSelect picker are fully hidden (not disabled) when off; and the primaryValue fallback correctly avoids showing a selection with no matching option. The activeBuild banner is deliberately left ungated as an escape hatch, so a user who pinned a build and later disables Developer Mode keeps a Return-to-Stable/Nightly path. Verified npx vitest run GlobalSettingsForm.test.tsx (21 passing) and the tests exercise both gated states. The stray frontend/node_modules file removal is a legitimate cleanup of a broken symlink that had been committed as text.
One minor, non-blocking UX note inline. No changes required.
| const primaryValue: PrimaryValue = form.feature != null || showFeature ? "feature" : form.channel; | ||
| // With Developer Mode off the "feature" value has no matching option, so fall | ||
| // back to the home channel to keep the dropdown showing a valid selection. | ||
| const primaryValue: PrimaryValue = developerMode && (form.feature != null || showFeature) ? "feature" : form.channel; |
There was a problem hiding this comment.
Non-blocking: when a feature build is pinned (form.feature != null) and Developer Mode is then turned off, the channel dropdown shows form.channel (e.g. "Stable (Latest)") as the selected value while the app is actually running the pinned feature build. The activeBuild banner mitigates this and it is a documented tradeoff, so this is fine as-is; just flagging the dropdown/banner divergence for awareness.
Adds a Developer Mode toggle (single Switch, default off) to global Settings, persisted via the ui-store + localStorage pattern under ~/.ao/electron. When off, the Feature Releases update channel option and its build picker are hidden entirely; when on, Updates behaves as before. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fa59ec7 to
9552566
Compare
There was a problem hiding this comment.
Reviews
-
[P1] A persisted feature pin can remain effective while Developer Mode hides every indication of it.
Pinning writes
feature: { pr }before checking availability (auto-updater.ts:470). If that check fails, the app can remain on Stable while the pin persists and future manual/automatic checks continue using thepr<N>feed.With Developer Mode off,
UpdatesSectionthen displays the home channel, hides the picker, and renders no banner or Return action becausegetActive()is stillnull. The concealed pin can later install a feature build.Please render an escape/status action whenever
form.featureexists, independently of whether the feature build is already running, or explicitly clear the pin when Developer Mode is disabled. -
[P1] Return can overwrite unrelated update preferences after a settings-load failure.
If active-build detection succeeds but
updateSettings.get()fails, the banner renders whileformRefstill containsDEFAULT_SETTINGS. Clicking Return submits{ enabled: false, channel: "latest", ... }, potentially replacing enabled/Nightly preferences instead of only clearing the feature pin.Please disable Return until update settings have loaded, or clear the feature pin atomically against main-process state.
-
The new tests do not exercise the meaningful picker-gating state.
The off test starts with
feature: nullandshowFeature: false, so the picker was already absent before this change; it still passes if the newdeveloperMode &&guard aroundprimaryValueis removed. Please cover a persisted pin with Developer Mode off and toggling Developer Mode off after transiently selecting Feature Releases. Persistence also needs coverage for default-off, localStorage restoration/write, and reload. -
frontend/docs/desktop-release.mdis now stale.Its user workflow directs people straight to Settings → Updates → Feature Releases, which is impossible by default. It should first instruct users to enable Developer Mode.
Minor naming note: STABLE_CHANNEL_OPTIONS contains both Stable and Nightly; NON_FEATURE_CHANNEL_OPTIONS would be clearer.
I reproduced the two runtime failure paths with temporary characterization tests; the existing focused suite and GitHub checks remain green.
Address review on PR AgentWrapper#3039: - Show the Return-to-home banner whenever a feature build is pinned in settings (not only when one is already running), so a pin that stays effective in the main-process updater is never hidden while Developer Mode is off. - Disable Return until update settings load, avoiding a clobber of enabled/channel prefs with defaults when settings failed to load. - Rename STABLE_CHANNEL_OPTIONS to NON_FEATURE_CHANNEL_OPTIONS (it includes Nightly). - Cover persisted-pin gating, the primaryValue guard on toggle-off, and localStorage persistence with tests (24 passing). - Update desktop-release.md: Feature Releases now requires enabling Developer Mode. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks @illegalcall, verified each against the code. Pushed 07a7e17.
Naming: renamed |
Summary
Adds a Developer Mode section to the global app Settings and gates the Feature Releases update channel behind it.
Developer Modesection in Global Settings: a single Switch toggle, default off, persisted via the existingui-store+localStoragepattern (same one the Theme/sidebar preferences use;localStorageresolves under~/.ao/electron, respecting the~/.ao-only state rule).Feature Releasesoption is removed entirely from the Updates channel dropdown and the feature-build picker is hidden (hidden, not disabled). When on, Updates behaves exactly as before.Note on scope
The pre-existing "Feature Releases" surface is the
featurechannel option insideUpdatesSection(plus itsFeatureBuildsSelectpicker). There is no separate top-level Feature Releases page inmain, so this gates that entry point. Feature Releases itself is unchanged.Changes
stores/ui-store.ts— adddeveloperModestate +setDeveloperMode, initialized from and persisted tolocalStorage.settings/DeveloperModeSection.tsx— new section with a single shadcnSwitch.GlobalSettingsForm.tsx— render the new section.settings/UpdatesSection.tsx— hide thefeaturechannel option / picker unless Developer Mode is on.Tests
npx vitest run GlobalSettingsForm.test.tsx— 21 passing, including two new gating tests (option hidden when off, revealed when toggled on) plus a section-render assertion.vite build) passes.ao previewon/settings.Known risks / follow-ups
tscerrors insrc/renderer/lib/command-palette.tsare unrelated (that file is byte-identical tomain).